diff options
author | David van Tonder <david.vantonder@gmail.com> | 2013-04-03 16:01:37 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-04-03 16:01:37 -0700 |
commit | 48a296b4d309112ec422f1a0ef4a472873e6cbdc (patch) | |
tree | 1a1d611a98bf19f637dd6ebb311ea2fafd0cccf8 /src/com/android/settings/cyanogenmod | |
parent | 37efd15fdaba7409f39dc2845370c17cc17bf415 (diff) | |
parent | d527c9162051d72b9faf8ffa361068bb17233df7 (diff) | |
download | packages_apps_settings-48a296b4d309112ec422f1a0ef4a472873e6cbdc.zip packages_apps_settings-48a296b4d309112ec422f1a0ef4a472873e6cbdc.tar.gz packages_apps_settings-48a296b4d309112ec422f1a0ef4a472873e6cbdc.tar.bz2 |
Merge "Settings : Toggle expanded desktop for navbar" into cm-10.1
Diffstat (limited to 'src/com/android/settings/cyanogenmod')
-rw-r--r-- | src/com/android/settings/cyanogenmod/NavBar.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/settings/cyanogenmod/NavBar.java b/src/com/android/settings/cyanogenmod/NavBar.java index bee3cb4..2c69163 100644 --- a/src/com/android/settings/cyanogenmod/NavBar.java +++ b/src/com/android/settings/cyanogenmod/NavBar.java @@ -41,6 +41,7 @@ public class NavBar extends Fragment { private ViewGroup mContainer; private Activity mActivity; private MenuItem mEditMenu; + private boolean mWasInExpandedState; private final static Intent mIntent = new Intent("android.intent.action.NAVBAR_EDIT"); private static final int MENU_RESET = Menu.FIRST; private static final int MENU_EDIT = Menu.FIRST + 1; @@ -74,6 +75,9 @@ public class NavBar extends Fragment { @Override public void onResume() { super.onResume(); + mWasInExpandedState = Settings.System.getInt(mActivity.getContentResolver(), + Settings.System.EXPANDED_DESKTOP_STATE, 0) == 1; + setExpandedDesktopState(false); // If running on a phone, remove padding around container if (Utils.isPhone(mActivity)) { mContainer.setPadding(0, 0, 0, 0); @@ -129,21 +133,34 @@ public class NavBar extends Fragment { } } + private void setExpandedDesktopState(boolean on) { + if (mWasInExpandedState) { + Settings.System.putInt(mActivity.getContentResolver(), + Settings.System.EXPANDED_DESKTOP_STATE, on ? 1 : 0); + if (on) { + mWasInExpandedState = false; + } + } + } + @Override public void onPause() { toggleEditMode(false, false); + setExpandedDesktopState(true); super.onPause(); } @Override public void onStop() { toggleEditMode(false, false); + setExpandedDesktopState(true); super.onStop(); } @Override public void onDestroy() { toggleEditMode(false, false); + setExpandedDesktopState(true); super.onDestroy(); } } |