change all Settings from CheckBox to Switch, except "expert"
This follows the Material preferred style using Switches instead of CheckBoxes for boolean preferences. This leaves the "expert" preferences as CheckBoxes to differentiate them, and make them stand out as something different.
This commit is contained in:
parent
d0d0c1d62c
commit
ce934d3846
@ -6,6 +6,7 @@ import android.content.SharedPreferences;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v14.preference.PreferenceFragment;
|
import android.support.v14.preference.PreferenceFragment;
|
||||||
|
import android.support.v14.preference.SwitchPreference;
|
||||||
import android.support.v7.preference.CheckBoxPreference;
|
import android.support.v7.preference.CheckBoxPreference;
|
||||||
import android.support.v7.preference.EditTextPreference;
|
import android.support.v7.preference.EditTextPreference;
|
||||||
import android.support.v7.preference.ListPreference;
|
import android.support.v7.preference.ListPreference;
|
||||||
@ -62,8 +63,8 @@ public class PreferencesFragment extends PreferenceFragment
|
|||||||
|
|
||||||
private static final int REQUEST_INSTALL_ORBOT = 0x1234;
|
private static final int REQUEST_INSTALL_ORBOT = 0x1234;
|
||||||
private SeekBarPreference updateIntervalSeekBar;
|
private SeekBarPreference updateIntervalSeekBar;
|
||||||
private CheckBoxPreference enableProxyCheckPref;
|
private SwitchPreference enableProxyCheckPref;
|
||||||
private CheckBoxPreference useTorCheckPref;
|
private SwitchPreference useTorCheckPref;
|
||||||
private Preference updateAutoDownloadPref;
|
private Preference updateAutoDownloadPref;
|
||||||
private Preference updatePrivilegedExtensionPref;
|
private Preference updatePrivilegedExtensionPref;
|
||||||
private long currentKeepCacheTime;
|
private long currentKeepCacheTime;
|
||||||
@ -74,8 +75,8 @@ public class PreferencesFragment extends PreferenceFragment
|
|||||||
Preferences.get().migrateUpdateIntervalStringToInt();
|
Preferences.get().migrateUpdateIntervalStringToInt();
|
||||||
|
|
||||||
addPreferencesFromResource(R.xml.preferences);
|
addPreferencesFromResource(R.xml.preferences);
|
||||||
useTorCheckPref = (CheckBoxPreference) findPreference(Preferences.PREF_USE_TOR);
|
useTorCheckPref = (SwitchPreference) findPreference(Preferences.PREF_USE_TOR);
|
||||||
enableProxyCheckPref = (CheckBoxPreference) findPreference(Preferences.PREF_ENABLE_PROXY);
|
enableProxyCheckPref = (SwitchPreference) findPreference(Preferences.PREF_ENABLE_PROXY);
|
||||||
updateAutoDownloadPref = findPreference(Preferences.PREF_AUTO_DOWNLOAD_INSTALL_UPDATES);
|
updateAutoDownloadPref = findPreference(Preferences.PREF_AUTO_DOWNLOAD_INSTALL_UPDATES);
|
||||||
updatePrivilegedExtensionPref = findPreference(Preferences.PREF_UNINSTALL_PRIVILEGED_APP);
|
updatePrivilegedExtensionPref = findPreference(Preferences.PREF_UNINSTALL_PRIVILEGED_APP);
|
||||||
|
|
||||||
@ -201,7 +202,7 @@ public class PreferencesFragment extends PreferenceFragment
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Preferences.PREF_ENABLE_PROXY:
|
case Preferences.PREF_ENABLE_PROXY:
|
||||||
CheckBoxPreference checkPref = (CheckBoxPreference) findPreference(key);
|
SwitchPreference checkPref = (SwitchPreference) findPreference(key);
|
||||||
checkPref.setSummary(R.string.enable_proxy_summary);
|
checkPref.setSummary(R.string.enable_proxy_summary);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -35,12 +35,12 @@
|
|||||||
android:title="@string/only_on_wifi"
|
android:title="@string/only_on_wifi"
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="updateOnWifiOnly"/>
|
android:key="updateOnWifiOnly"/>
|
||||||
<android.support.v7.preference.CheckBoxPreference
|
<SwitchPreference
|
||||||
android:title="@string/update_auto_download"
|
android:title="@string/update_auto_download"
|
||||||
android:summary="@string/update_auto_download_summary"
|
android:summary="@string/update_auto_download_summary"
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="updateAutoDownload"/>
|
android:key="updateAutoDownload"/>
|
||||||
<android.support.v7.preference.CheckBoxPreference
|
<SwitchPreference
|
||||||
android:title="@string/notify"
|
android:title="@string/notify"
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="updateNotify"/>
|
android:key="updateNotify"/>
|
||||||
@ -60,16 +60,20 @@
|
|||||||
</android.support.v7.preference.PreferenceCategory>
|
</android.support.v7.preference.PreferenceCategory>
|
||||||
|
|
||||||
<android.support.v7.preference.PreferenceCategory android:title="@string/appcompatibility">
|
<android.support.v7.preference.PreferenceCategory android:title="@string/appcompatibility">
|
||||||
<CheckBoxPreference android:title="@string/show_incompat_versions"
|
<SwitchPreference
|
||||||
|
android:title="@string/show_incompat_versions"
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="incompatibleVersions"/>
|
android:key="incompatibleVersions"/>
|
||||||
<CheckBoxPreference android:title="@string/show_root_apps"
|
<SwitchPreference
|
||||||
|
android:title="@string/show_root_apps"
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="rooted"/>
|
android:key="rooted"/>
|
||||||
<CheckBoxPreference android:title="@string/show_anti_feature_apps"
|
<SwitchPreference
|
||||||
|
android:title="@string/show_anti_feature_apps"
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="showAntiFeatureApps"/>
|
android:key="showAntiFeatureApps"/>
|
||||||
<CheckBoxPreference android:title="@string/force_touch_apps"
|
<SwitchPreference
|
||||||
|
android:title="@string/force_touch_apps"
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="ignoreTouchscreen"/>
|
android:key="ignoreTouchscreen"/>
|
||||||
</android.support.v7.preference.PreferenceCategory>
|
</android.support.v7.preference.PreferenceCategory>
|
||||||
@ -81,11 +85,11 @@
|
|||||||
</android.support.v7.preference.PreferenceCategory>
|
</android.support.v7.preference.PreferenceCategory>
|
||||||
|
|
||||||
<android.support.v7.preference.PreferenceCategory android:title="@string/proxy">
|
<android.support.v7.preference.PreferenceCategory android:title="@string/proxy">
|
||||||
<android.support.v7.preference.CheckBoxPreference
|
<SwitchPreference
|
||||||
android:key="useTor"
|
android:key="useTor"
|
||||||
android:summary="@string/useTorSummary"
|
android:summary="@string/useTorSummary"
|
||||||
android:title="@string/useTor"/>
|
android:title="@string/useTor"/>
|
||||||
<android.support.v7.preference.CheckBoxPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="enableProxy"
|
android:key="enableProxy"
|
||||||
android:title="@string/enable_proxy_title"
|
android:title="@string/enable_proxy_title"
|
||||||
@ -106,13 +110,13 @@
|
|||||||
android:key="pref_category_privacy"
|
android:key="pref_category_privacy"
|
||||||
android:title="@string/privacy">
|
android:title="@string/privacy">
|
||||||
|
|
||||||
<android.support.v7.preference.CheckBoxPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="preventScreenshots"
|
android:key="preventScreenshots"
|
||||||
android:summary="@string/preventScreenshots_summary"
|
android:summary="@string/preventScreenshots_summary"
|
||||||
android:title="@string/preventScreenshots_title"/>
|
android:title="@string/preventScreenshots_title"/>
|
||||||
|
|
||||||
<android.support.v7.preference.CheckBoxPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="hideOnLongPressSearch"
|
android:key="hideOnLongPressSearch"
|
||||||
android:summary="@string/hide_on_long_search_press_summary"
|
android:summary="@string/hide_on_long_search_press_summary"
|
||||||
@ -138,7 +142,7 @@
|
|||||||
android:defaultValue="86400000"
|
android:defaultValue="86400000"
|
||||||
android:entries="@array/keepCacheNames"
|
android:entries="@array/keepCacheNames"
|
||||||
android:entryValues="@array/keepCacheValues"/>
|
android:entryValues="@array/keepCacheValues"/>
|
||||||
<android.support.v7.preference.CheckBoxPreference
|
<SwitchPreference
|
||||||
android:title="@string/expert"
|
android:title="@string/expert"
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="expert"/>
|
android:key="expert"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user