diff options
author | Daniel Sandler <dsandler@android.com> | 2011-09-12 10:06:53 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-12 10:06:53 -0700 |
commit | aeb116750110cf9cc1ef82d208f3a8ba3b8be009 (patch) | |
tree | 4afd644b714d50b51efa735cd4cb2b964f280cca /packages | |
parent | fa0d2316f98ab787ff26383ff651dc31aac60ffd (diff) | |
parent | 029d5877b0c19af09c6a1cb7d1c3d3507e88430c (diff) | |
download | frameworks_base-aeb116750110cf9cc1ef82d208f3a8ba3b8be009.zip frameworks_base-aeb116750110cf9cc1ef82d208f3a8ba3b8be009.tar.gz frameworks_base-aeb116750110cf9cc1ef82d208f3a8ba3b8be009.tar.bz2 |
Merge "Hide navigation buttons when they are DISABLEd."
Diffstat (limited to 'packages')
3 files changed, 14 insertions, 16 deletions
diff --git a/packages/SystemUI/res/layout/navigation_bar.xml b/packages/SystemUI/res/layout/navigation_bar.xml index fbca299..25bc2ea 100644 --- a/packages/SystemUI/res/layout/navigation_bar.xml +++ b/packages/SystemUI/res/layout/navigation_bar.xml @@ -38,6 +38,7 @@ android:clipChildren="false" android:clipToPadding="false" android:id="@+id/nav_buttons" + android:animateLayoutChanges="true" > <!-- navigation controls --> @@ -165,6 +166,7 @@ android:clipChildren="false" android:clipToPadding="false" android:id="@+id/nav_buttons" + android:animateLayoutChanges="true" > <!-- navigation controls --> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 98dca92..cd361ad 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -60,7 +60,6 @@ public class NavigationBarView extends LinearLayout { boolean mVertical; boolean mHidden, mLowProfile; - boolean mEnabled = true; public View getRecentsButton() { return mCurrentView.findViewById(R.id.recent_apps); @@ -93,11 +92,6 @@ public class NavigationBarView extends LinearLayout { mVertical = false; } - public void setEnabled(final boolean enable) { - mEnabled = enable; - mCurrentView.setVisibility(enable ? View.VISIBLE : View.INVISIBLE); - } - View.OnTouchListener mLightsOutListener = new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent ev) { @@ -116,6 +110,16 @@ public class NavigationBarView extends LinearLayout { } }; + public void setNavigationVisibility(int disabledFlags) { + boolean disableNavigation = ((disabledFlags & View.STATUS_BAR_DISABLE_NAVIGATION) != 0); + boolean disableBack = ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0); + + getBackButton() .setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE); + getHomeButton() .setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE); + getRecentsButton().setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE); + getMenuButton() .setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE); + } + public void setLowProfile(final boolean lightsOut) { setLowProfile(lightsOut, true); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 3d05341..69e0752 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -297,7 +297,7 @@ public class PhoneStatusBar extends StatusBar { mNavigationBarView = (NavigationBarView) View.inflate(context, R.layout.navigation_bar, null); - mNavigationBarView.setEnabled((mDisabled & StatusBarManager.DISABLE_NAVIGATION) == 0); + setNavigationVisibility(mDisabled); sb.setOnSystemUiVisibilityChangeListener( new View.OnSystemUiVisibilityChangeListener() { @@ -1129,15 +1129,7 @@ public class PhoneStatusBar extends StatusBar { Slog.i(TAG, "DISABLE_NAVIGATION: " + (disableNavigation ? "yes" : "no")); if (mNavigationBarView != null) { - if (disableNavigation && disableBack) { - mNavigationBarView.setEnabled(false); - } else { - mNavigationBarView.getBackButton().setEnabled(!disableBack); - mNavigationBarView.getHomeButton().setEnabled(!disableNavigation); - mNavigationBarView.getRecentsButton().setEnabled(!disableNavigation); - - mNavigationBarView.setEnabled(true); - } + mNavigationBarView.setNavigationVisibility(visibility); } if (disableNavigation) { |