Do incompatible versions and permissions settings too

This commit is contained in:
Daniel Martí 2014-01-01 01:20:21 +01:00
parent 65981e3a25
commit abef4f36e0
4 changed files with 26 additions and 4 deletions

View File

@ -127,7 +127,8 @@
<string name="appcompatibility">Application compatibility</string>
<string name="show_incompat_versions">Incompatible versions</string>
<string name="show_incompat_versions_l">Show versions of apps that are incompatible with the device</string>
<string name="show_incompat_versions_on">Show app versions incompatible with the device</string>
<string name="show_incompat_versions_off">Hide app versions incompatible with the device</string>
<string name="rooted">Root</string>
<string name="rooted_on">Do not grey out apps requiring root privileges</string>
<string name="rooted_off">Grey out apps requiring root privileges</string>
@ -153,7 +154,8 @@
<string name="no_permissions">No permissions are used.</string>
<string name="permissions_for_long">Permissions for version %s</string>
<string name="showPermissions">Show permissions</string>
<string name="showPermissions_long">Display a list of permissions an app needs</string>
<string name="showPermissions_on">Display a list of permissions an app requires</string>
<string name="showPermissions_off">Don\'t show permissions before downloading</string>
<string name="no_handler_app">You don\'t have any available app that can handle %s</string>
<string name="compactlayout">Compact Layout</string>
<string name="compactlayout_on">Show icons at a smaller size</string>

View File

@ -21,7 +21,7 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/display">
<CheckBoxPreference android:title="@string/showPermissions"
android:defaultValue="false" android:summary="@string/showPermissions_long"
android:defaultValue="false"
android:key="showPermissions"/>
<CheckBoxPreference android:title="@string/compactlayout"
android:defaultValue="false"
@ -34,7 +34,7 @@
</PreferenceCategory>
<PreferenceCategory android:title="@string/appcompatibility">
<CheckBoxPreference android:title="@string/show_incompat_versions"
android:defaultValue="false" android:summary="@string/show_incompat_versions_l"
android:defaultValue="false"
android:key="incompatibleVersions" />
<CheckBoxPreference android:title="@string/rooted"
android:defaultValue="true"

View File

@ -32,6 +32,7 @@ public class Preferences implements SharedPreferences.OnSharedPreferenceChangeLi
public static final String PREF_ROOTED = "rooted";
public static final String PREF_INCOMP_VER = "incompatibleVersions";
public static final String PREF_THEME = "theme";
public static final String PREF_PERMISSIONS = "showPermissions";
public static final String PREF_COMPACT_LAYOUT = "compactlayout";
public static final String PREF_IGN_TOUCH = "ignoreTouchscreen";

View File

@ -48,6 +48,7 @@ public class PreferencesActivity extends PreferenceActivity implements
Preferences.PREF_ROOTED,
Preferences.PREF_INCOMP_VER,
Preferences.PREF_THEME,
Preferences.PREF_PERMISSIONS,
Preferences.PREF_COMPACT_LAYOUT,
Preferences.PREF_IGN_TOUCH };
@ -109,6 +110,13 @@ public class PreferencesActivity extends PreferenceActivity implements
if (key.equals(Preferences.PREF_INCOMP_VER)) {
result ^= RESULT_RELOAD;
setResult(result);
CheckBoxPreference pref = (CheckBoxPreference)findPreference(
Preferences.PREF_INCOMP_VER);
if (pref.isChecked()) {
pref.setSummary(R.string.show_incompat_versions_on);
} else {
pref.setSummary(R.string.show_incompat_versions_off);
}
return;
}
@ -144,6 +152,17 @@ public class PreferencesActivity extends PreferenceActivity implements
theme.setSummary(theme.getEntry());
return;
}
if (key.equals(Preferences.PREF_PERMISSIONS)) {
CheckBoxPreference pref = (CheckBoxPreference)findPreference(
Preferences.PREF_PERMISSIONS);
if (pref.isChecked()) {
pref.setSummary(R.string.showPermissions_on);
} else {
pref.setSummary(R.string.showPermissions_off);
}
return;
}
}
@Override