添加自动更新设置

This commit is contained in:
seven332 committed 2014-05-24 17:44:26 +08:00
1 parent a9506b1f53
commit 15a2db978c
5 files changed
+23 -6

No files matched your search

+3
View File
@@ -172,6 +172,9 @@
<string name="thanks_title">感谢</string>
<string name="source_title">源码</string>
<string name="update_about_settings_title">更新</string>
<string name="auto_check_for_update_title">自动检查更新</string>
<string name="auto_check_for_update_summary_on">每日第一次启动时检查更新</string>
<string name="auto_check_for_update_summary_off">从不自动检查更新</string>
<string name="check_for_update_title">检查更新</string>
<string name="check_for_update_summary">点击检查更新</string>
<string name="update_server_title">更新服务器</string>
+3
View File
@@ -175,6 +175,9 @@
<string name="thanks_title">Thanks</string>
<string name="source_title">Source</string>
<string name="update_about_settings_title">Update</string>
<string name="auto_check_for_update_title">Check for update automatically</string>
<string name="auto_check_for_update_summary_on">Check for update once a day</string>
<string name="auto_check_for_update_summary_off">Never check for update without your permission</string>
<string name="check_for_update_title">Check for update</string>
<string name="check_for_update_summary">Tap to check for update</string>
<string name="update_server_title">Update server</string>
+7
View File
@@ -36,6 +36,13 @@
<PreferenceCategory
android:title="@string/update_about_settings_title">
<CheckBoxPreference
android:key="auto_check_for_update"
android:title="@string/auto_check_for_update_title"
android:summaryOn="@string/auto_check_for_update_summary_on"
android:summaryOff="@string/auto_check_for_update_summary_off"
android:defaultValue="true" />
<Preference
android:key="check_for_update"
android:title="@string/check_for_update_title"
@@ -1565,7 +1565,8 @@ public class MangaListActivity extends SlidingActivity
// Check update
checkUpdate();
if (Config.isAutoCheckForUpdate())
checkUpdate();
// Check login and update user panel
checkLogin(false);
+8 -5
View File
@@ -31,7 +31,6 @@ public class Config {
private static final String KEY_ALLOWED = "allowed";
private static final String KEY_FIRST = "first_time";
private static final String KEY_LOGIN = "login";
private static final String KEY_IS_EXHENTAI = "is_exhentai";
private static final String KEY_UPDATE_DATE = "update_date";
private static final String KEY_MODE = "mode";
private static final int MODE_DEFAULT = 0;
@@ -50,6 +49,8 @@ public class Config {
private static final String KEY_MEDIA_SCAN = "media_scan";
private static final boolean DEFAULT_MEDIA_SCAN = false;
private static final String KEY_AUTO_CHECK_FOR_UPDATE = "auto_check_for_update";
private static final boolean DEFAULT_AUTO_CHECK_FOR_UPDATE = true;
private static final String KEY_UPDATE_SERVER = "update_server";
private static final String DEFAULT_UPDATE_SERVER = "2";
@@ -215,12 +216,14 @@ public class Config {
}
}
public static boolean isExhentai() {
return mConfigPre.getBoolean(KEY_IS_EXHENTAI, false);
public static boolean isAutoCheckForUpdate() {
return mConfigPre.getBoolean(KEY_AUTO_CHECK_FOR_UPDATE,
DEFAULT_AUTO_CHECK_FOR_UPDATE);
}
public static void exhentai(boolean isExhentai) {
mConfigPre.edit().putBoolean(KEY_IS_EXHENTAI, isExhentai).apply();
public static void setAutoCheckForUpdate(boolean autoCheckForUpdate) {
mConfigPre.edit().putBoolean(KEY_AUTO_CHECK_FOR_UPDATE,
autoCheckForUpdate).apply();
}
public static int getUpdateDate() {