Skip to content

Commit

Permalink
Fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
zjn0505 committed Oct 19, 2018
1 parent 3eeed73 commit adc19c4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion xkcd/src/main/java/xyz/jienan/xkcd/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Const {
public static final String PREF_WHAT_IF_SEARCH_IGNORE_CONTENT = "ignore_content";
public static final String PREF_WHAT_IF_SEARCH_INCLUDE_READ = "include_read";
public static final String PREF_WHAT_IF_SEARCH_ALL = "search_all";
public static final String PREF_XKCD_GIF_ECHO = "pref_xkcd_gif_echo_mode";
public static final String PREF_XKCD_GIF_ECO = "pref_xkcd_gif_eco_mode";

public static final String FIRE_LARGE_IMAGE = "large_image";
public static final String FIRE_COMIC_ID = "comic_id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import static xyz.jienan.xkcd.Const.FIRE_GIF_PREVIOUS_HOLD;
import static xyz.jienan.xkcd.Const.FIRE_GIF_USER_PROGRESS;
import static xyz.jienan.xkcd.Const.FIRE_LARGE_IMAGE;
import static xyz.jienan.xkcd.Const.PREF_XKCD_GIF_ECHO;
import static xyz.jienan.xkcd.Const.PREF_XKCD_GIF_ECO;

/**
* Created by jienanzhang on 09/07/2017.
Expand Down Expand Up @@ -123,7 +123,7 @@ public class ImageDetailPageActivity extends BaseActivity implements ImageDetail

private String url = "";

private boolean isEchoMode = true;
private boolean isEcoMode = true;

public static void startActivity(Context context,
@Nullable String url,
Expand Down Expand Up @@ -151,8 +151,8 @@ public static void startActivityFromId(Context context, @NonNull Long id) {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
imageDetailPagePresenter = new ImageDetailPagePresenter(this);
isEchoMode = sharedPreferences.getBoolean(PREF_XKCD_GIF_ECHO, true);
imageDetailPagePresenter.setEcoMode(isEchoMode);
isEcoMode = sharedPreferences.getBoolean(PREF_XKCD_GIF_ECO, true);
imageDetailPagePresenter.setEcoMode(isEcoMode);
setContentView(R.layout.activity_image_detail);
ButterKnife.bind(this);
glide = Glide.with(this);
Expand Down Expand Up @@ -354,7 +354,7 @@ public void onGifPlayClicked() {

private void startPlayingGif(boolean isForward, boolean isFromUserLongPress) {
stopPlayingGif();
holdDisposable = Observable.interval(isEchoMode ? 100 : 60, TimeUnit.MILLISECONDS)
holdDisposable = Observable.interval(isEcoMode ? 100 : 60, TimeUnit.MILLISECONDS)
.delay(isFromUserLongPress ? 500 : 0, TimeUnit.MILLISECONDS)
.subscribeOn(AndroidSchedulers.mainThread())
.doOnSubscribe(ignored -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ interface Presenter extends BasePresenter {

void adjustGifFrame(boolean isForward);

void setEcoMode(boolean isEchoMode);
void setEcoMode(boolean isEcoMode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import static xyz.jienan.xkcd.Const.PREF_ARROW;
import static xyz.jienan.xkcd.Const.PREF_FONT;
import static xyz.jienan.xkcd.Const.PREF_WHAT_IF_SEARCH;
import static xyz.jienan.xkcd.Const.PREF_XKCD_GIF_ECHO;
import static xyz.jienan.xkcd.Const.PREF_XKCD_GIF_ECO;
import static xyz.jienan.xkcd.Const.PREF_ZOOM;

/**
Expand All @@ -34,7 +34,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
addPreferencesFromResource(R.xml.prefs);
arrowPref = (ListPreference) findPreference(PREF_ARROW);
SwitchPreference fontPref = (SwitchPreference) findPreference(PREF_FONT);
SwitchPreference gifEchoPref = (SwitchPreference) findPreference(PREF_XKCD_GIF_ECHO);
SwitchPreference gifEcoPref = (SwitchPreference) findPreference(PREF_XKCD_GIF_ECO);
zoomPref = (ListPreference) findPreference(PREF_ZOOM);
zoomPref.setSummary(String.valueOf(zoomPref.getEntry()));
arrowPref.setSummary(getResources().getQuantityString(R.plurals.pref_arrow_summary,
Expand All @@ -43,7 +43,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
searchPref = (ListPreference) findPreference(PREF_WHAT_IF_SEARCH);
searchPref.setSummary(String.valueOf(searchPref.getEntry()));
fontPref.setOnPreferenceChangeListener(this);
gifEchoPref.setOnPreferenceChangeListener(this);
gifEcoPref.setOnPreferenceChangeListener(this);
zoomPref.setOnPreferenceChangeListener(this);
searchPref.setOnPreferenceChangeListener(this);
}
Expand All @@ -70,7 +70,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
((ListPreference) preference).setValue(newValue.toString());
searchPref.setSummary(String.valueOf(searchPref.getEntry()));
break;
case PREF_XKCD_GIF_ECHO:
case PREF_XKCD_GIF_ECO:
((SwitchPreference) preference).setChecked((boolean) newValue);
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions xkcd/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
<string name="pref_font_xkcd">正在使用 xkcd 字体</string>
<string name="pref_font_normal">正在使用正常字体</string>
<string name="pref_appearance">外观</string>
<string name="pref_xkcd_gif_echo_mode_title">xkcd 动画节能模式</string>
<string name="pref_xkcd_gif_echo_mode_on">更加节能,每秒钟 10 帧画面</string>
<string name="pref_xkcd_gif_echo_mode_off">更多细节,帧率提高70%</string>
<string name="pref_xkcd_gif_eco_mode_title">xkcd 动画节能模式</string>
<string name="pref_xkcd_gif_eco_mode_on">更加节能,每秒钟 10 帧画面</string>
<string name="pref_xkcd_gif_eco_mode_off">更多细节,帧率提高70%</string>
<string name="settings">设置</string>
<string name="share_text">一起来看看这张有趣的 xkcd 漫画吧. %s</string>
<string name="toast_more_explain_failed">获取失败,请尝试访问 Explainxkcd</string>
Expand Down
6 changes: 3 additions & 3 deletions xkcd/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
<string name="pref_font_xkcd">Using xkcd font</string>
<string name="pref_font_normal">Using normal font</string>
<string name="pref_appearance">Appearance</string>
<string name="pref_xkcd_gif_echo_mode_title">xkcd gif echo mode</string>
<string name="pref_xkcd_gif_echo_mode_on">Better performance, 10 frames per second</string>
<string name="pref_xkcd_gif_echo_mode_off">Better details, higher fps when playing</string>
<string name="pref_xkcd_gif_eco_mode_title">xkcd gif eco mode</string>
<string name="pref_xkcd_gif_eco_mode_on">Better performance, 10 frames per second</string>
<string name="pref_xkcd_gif_eco_mode_off">Better details, higher fps when playing</string>
<string name="pref_what_if" translatable="false">what if</string>
<string name="pref_xkcd" translatable="false">xkcd</string>
<string name="settings">Settings</string>
Expand Down
8 changes: 4 additions & 4 deletions xkcd/src/main/res/xml/prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

<SwitchPreference
android:defaultValue="true"
android:key="pref_xkcd_gif_echo_mode"
android:summaryOff="@string/pref_xkcd_gif_echo_mode_off"
android:summaryOn="@string/pref_xkcd_gif_echo_mode_on"
android:title="@string/pref_xkcd_gif_echo_mode_title" />
android:key="pref_xkcd_gif_eco_mode"
android:summaryOff="@string/pref_xkcd_gif_eco_mode_off"
android:summaryOn="@string/pref_xkcd_gif_eco_mode_on"
android:title="@string/pref_xkcd_gif_eco_mode_title" />

</PreferenceCategory>

Expand Down

0 comments on commit adc19c4

Please sign in to comment.