Do db sync and apk cache settings summaries too
This commit is contained in:
parent
abef4f36e0
commit
6c9a375b27
@ -7,8 +7,10 @@
|
||||
<string name="installIncompatible">It seems like this package is not compatible with your device. Do you want to try and install it anyway?</string>
|
||||
<string name="installDowngrade">You are trying to downgrade this application. Doing so might get it to malfunction and even lose your data. Do you want to try and downgrade it anyway?</string>
|
||||
<string name="version">Version</string>
|
||||
<string name="cache_downloaded">Cache downloaded apps</string>
|
||||
<string name="keep_downloaded">Keep downloaded apk files on SD card</string>
|
||||
<string name="cache_downloaded">App cache</string>
|
||||
<string name="cache_downloaded_on">Keep downloaded apk files on SD card</string>
|
||||
<string name="cache_downloaded_off">Do not keep any apk files</string>
|
||||
|
||||
<string name="updates">Updates</string>
|
||||
<string name="other">Other</string>
|
||||
<string name="last_update_check">Last repo scan: %s</string>
|
||||
@ -123,7 +125,6 @@
|
||||
<string name="search_hint">Search applications</string>
|
||||
|
||||
<string name="db_sync_mode">Database sync mode</string>
|
||||
<string name="db_sync_mode_long">Set the value of SQLite\'s "synchronous" flag</string>
|
||||
|
||||
<string name="appcompatibility">Application compatibility</string>
|
||||
<string name="show_incompat_versions">Incompatible versions</string>
|
||||
|
@ -16,7 +16,6 @@
|
||||
android:key="updateHistoryDays"
|
||||
android:maxLength="2"
|
||||
android:numeric="integer"
|
||||
android:summary="@string/update_history_desc"
|
||||
android:title="@string/update_history" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/display">
|
||||
@ -45,13 +44,13 @@
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/other">
|
||||
<CheckBoxPreference android:title="@string/cache_downloaded"
|
||||
android:defaultValue="false" android:summary="@string/keep_downloaded"
|
||||
android:defaultValue="false"
|
||||
android:key="cacheDownloaded" />
|
||||
<CheckBoxPreference android:title="@string/expert"
|
||||
android:defaultValue="false" android:summary="@string/expert_mode"
|
||||
android:key="expert" />
|
||||
<ListPreference android:title="@string/db_sync_mode"
|
||||
android:summary="@string/db_sync_mode_long" android:key="dbSyncMode"
|
||||
android:key="dbSyncMode"
|
||||
android:dependency="expert"
|
||||
android:defaultValue="full" android:entries="@array/dbSyncModeNames"
|
||||
android:entryValues="@array/dbSyncModeValues" />
|
||||
|
@ -35,6 +35,8 @@ public class Preferences implements SharedPreferences.OnSharedPreferenceChangeLi
|
||||
public static final String PREF_PERMISSIONS = "showPermissions";
|
||||
public static final String PREF_COMPACT_LAYOUT = "compactlayout";
|
||||
public static final String PREF_IGN_TOUCH = "ignoreTouchscreen";
|
||||
public static final String PREF_CACHE_APK = "cacheDownloaded";
|
||||
public static final String PREF_DB_SYNC = "dbSyncMode";
|
||||
|
||||
private static final boolean DEFAULT_COMPACT_LAYOUT = false;
|
||||
|
||||
|
@ -50,7 +50,9 @@ public class PreferencesActivity extends PreferenceActivity implements
|
||||
Preferences.PREF_THEME,
|
||||
Preferences.PREF_PERMISSIONS,
|
||||
Preferences.PREF_COMPACT_LAYOUT,
|
||||
Preferences.PREF_IGN_TOUCH };
|
||||
Preferences.PREF_IGN_TOUCH,
|
||||
Preferences.PREF_DB_SYNC,
|
||||
Preferences.PREF_CACHE_APK };
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -147,9 +149,9 @@ public class PreferencesActivity extends PreferenceActivity implements
|
||||
if (key.equals(Preferences.PREF_THEME)) {
|
||||
result |= RESULT_RESTART;
|
||||
setResult(result);
|
||||
ListPreference theme = (ListPreference)findPreference(
|
||||
ListPreference pref = (ListPreference)findPreference(
|
||||
Preferences.PREF_THEME);
|
||||
theme.setSummary(theme.getEntry());
|
||||
pref.setSummary(pref.getEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -163,6 +165,24 @@ public class PreferencesActivity extends PreferenceActivity implements
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (key.equals(Preferences.PREF_CACHE_APK)) {
|
||||
CheckBoxPreference pref = (CheckBoxPreference)findPreference(
|
||||
Preferences.PREF_CACHE_APK);
|
||||
if (pref.isChecked()) {
|
||||
pref.setSummary(R.string.cache_downloaded_on);
|
||||
} else {
|
||||
pref.setSummary(R.string.cache_downloaded_off);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (key.equals(Preferences.PREF_DB_SYNC)) {
|
||||
ListPreference pref = (ListPreference)findPreference(
|
||||
Preferences.PREF_DB_SYNC);
|
||||
pref.setSummary(pref.getEntry());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,7 +136,8 @@ abstract public class AppListAdapter extends BaseAdapter {
|
||||
|
||||
return convertView;
|
||||
}
|
||||
String ellipsize(String input, int maxLength) {
|
||||
|
||||
private String ellipsize(String input, int maxLength) {
|
||||
if (input == null || input.length() < maxLength+1) {
|
||||
return input;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user