diff options
author | Danesh Mondegarian <daneshm90@gmail.com> | 2012-12-16 12:02:16 -0500 |
---|---|---|
committer | Danesh Mondegarian <daneshm90@gmail.com> | 2012-12-16 18:55:53 -0500 |
commit | 8cb740563263546a109a0f5b918d1487b3a20d42 (patch) | |
tree | a6a86b9c9415b7382b2ff906d1f40d513e974691 /src | |
parent | 28d7594b866e3cd13aea9b570b0a4f9976c9cf8c (diff) | |
download | packages_apps_settings-8cb740563263546a109a0f5b918d1487b3a20d42.zip packages_apps_settings-8cb740563263546a109a0f5b918d1487b3a20d42.tar.gz packages_apps_settings-8cb740563263546a109a0f5b918d1487b3a20d42.tar.bz2 |
QuickSettings : Option to dismiss on toggle
This option dismisses the notification pane when a toggle is selected
Patchset 2,3 : Shorten preference title
Rework logic for removing preferences on tablets
Change-Id: Ia2392b2336f018bcc52e9ddbaf2dfa4433dd62c2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/cyanogenmod/QuickSettings.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/com/android/settings/cyanogenmod/QuickSettings.java b/src/com/android/settings/cyanogenmod/QuickSettings.java index 9cd6d4d..8bd4a03 100644 --- a/src/com/android/settings/cyanogenmod/QuickSettings.java +++ b/src/com/android/settings/cyanogenmod/QuickSettings.java @@ -50,7 +50,7 @@ public class QuickSettings extends SettingsPreferenceFragment implements OnPrefe private static final String DYNAMIC_IME = "dynamic_ime"; private static final String DYNAMIC_WIFI = "dynamic_wifi"; private static final String QUICK_PULLDOWN = "quick_pulldown"; - private static final String GENERAL_SETTINGS = "pref_general_settings"; + private static final String COLLAPSE_PANEL = "collapse_panel"; MultiSelectListPreference mRingMode; CheckBoxPreference mDynamicAlarm; @@ -58,7 +58,7 @@ public class QuickSettings extends SettingsPreferenceFragment implements OnPrefe CheckBoxPreference mDynamicWifi; CheckBoxPreference mDynamicIme; CheckBoxPreference mQuickPulldown; - PreferenceCategory mGeneralSettings; + CheckBoxPreference mCollapsePanel; @Override public void onCreate(Bundle savedInstanceState) { @@ -74,17 +74,16 @@ public class QuickSettings extends SettingsPreferenceFragment implements OnPrefe PackageManager pm = getPackageManager(); ContentResolver resolver = getActivity().getApplicationContext().getContentResolver(); - // Get the General settings category - mGeneralSettings = (PreferenceCategory) prefSet.findPreference(GENERAL_SETTINGS); - if (Utils.isTablet(getActivity())) { - // Nothing for tablets in the general settings section, remove it - prefSet.removePreference(mGeneralSettings); + mQuickPulldown = (CheckBoxPreference) prefSet.findPreference(QUICK_PULLDOWN); + if (!Utils.isPhone(getActivity())) { + prefSet.removePreference(mQuickPulldown); } else { - // Add the Quick Pulldown preference - mQuickPulldown = (CheckBoxPreference) prefSet.findPreference(QUICK_PULLDOWN); mQuickPulldown.setChecked(Settings.System.getInt(resolver, Settings.System.QS_QUICK_PULLDOWN, 0) == 1); } + mCollapsePanel = (CheckBoxPreference) prefSet.findPreference(COLLAPSE_PANEL); + mCollapsePanel.setChecked(Settings.System.getInt(resolver, Settings.System.QS_COLLAPSE_PANEL, 0) == 1); + // Add the sound mode mRingMode = (MultiSelectListPreference) prefSet.findPreference(EXP_RING_MODE); String storedRingMode = Settings.System.getString(getActivity() @@ -142,6 +141,10 @@ public class QuickSettings extends SettingsPreferenceFragment implements OnPrefe Settings.System.putInt(resolver, Settings.System.QS_QUICK_PULLDOWN, mQuickPulldown.isChecked() ? 1 : 0); return true; + } else if (preference == mCollapsePanel) { + Settings.System.putInt(resolver, Settings.System.QS_COLLAPSE_PANEL, + mCollapsePanel.isChecked() ? 1 : 0); + return true; } return super.onPreferenceTreeClick(preferenceScreen, preference); } |