diff options
author | Daniel Sandler <dsandler@android.com> | 2011-11-29 16:10:41 -0500 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2011-11-29 16:10:41 -0500 |
commit | c949ef6e64adcf1c1590ec15cc5d4a4403e77ddf (patch) | |
tree | 6d8f2a210c53106f19fd6adb439a4a63aa4c25a0 | |
parent | 2fa017f874d20a5b037ebe57f3fc0c53964080bc (diff) | |
download | packages_apps_Settings-c949ef6e64adcf1c1590ec15cc5d4a4403e77ddf.tar.gz packages_apps_Settings-c949ef6e64adcf1c1590ec15cc5d4a4403e77ddf.tar.bz2 packages_apps_Settings-c949ef6e64adcf1c1590ec15cc5d4a4403e77ddf.zip |
Show screen saver toggle on tablets.
Bug: 5669263
Change-Id: I16ca00ff96b17cc367c4f6fa4260da5a08480ac0
-rw-r--r-- | src/com/android/settings/DreamSettings.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/com/android/settings/DreamSettings.java b/src/com/android/settings/DreamSettings.java index d59242a5e..d9953aafc 100644 --- a/src/com/android/settings/DreamSettings.java +++ b/src/com/android/settings/DreamSettings.java @@ -69,18 +69,19 @@ public class DreamSettings extends SettingsPreferenceFragment { if (activity instanceof PreferenceActivity) { PreferenceActivity preferenceActivity = (PreferenceActivity) activity; - if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) { - final int padding = activity.getResources().getDimensionPixelSize( - R.dimen.action_bar_switch_padding); - mEnableSwitch.setPadding(0, 0, padding, 0); - activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, - ActionBar.DISPLAY_SHOW_CUSTOM); - activity.getActionBar().setCustomView(mEnableSwitch, new ActionBar.LayoutParams( - ActionBar.LayoutParams.WRAP_CONTENT, - ActionBar.LayoutParams.WRAP_CONTENT, - Gravity.CENTER_VERTICAL | Gravity.RIGHT)); - activity.getActionBar().setTitle(R.string.screensaver_settings_title); - } + // note: we do not check onIsHidingHeaders() or onIsMultiPane() because there's no + // switch in the left-hand pane to control this; we need to show the ON/OFF in our + // fragment every time + final int padding = activity.getResources().getDimensionPixelSize( + R.dimen.action_bar_switch_padding); + mEnableSwitch.setPadding(0, 0, padding, 0); + activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, + ActionBar.DISPLAY_SHOW_CUSTOM); + activity.getActionBar().setCustomView(mEnableSwitch, new ActionBar.LayoutParams( + ActionBar.LayoutParams.WRAP_CONTENT, + ActionBar.LayoutParams.WRAP_CONTENT, + Gravity.CENTER_VERTICAL | Gravity.RIGHT)); + activity.getActionBar().setTitle(R.string.screensaver_settings_title); } mEnabler = new Enabler(activity, mEnableSwitch); |