From 4f878ef5cc7b543b8cdda1c32d6258de1be001fe Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Sat, 23 Jan 2016 14:37:38 -0500 Subject: Re-add support for the app shelf Accidentally broken as a part of tuner customization of the nav bar. Now supported for inflation. Change-Id: Id097fb48d1d77aa37518246cca8c7a9494de2af2 --- .../res/layout-sw600dp/navigation_layout_rot90.xml | 20 +- packages/SystemUI/res/layout/apps_bar.xml | 31 ++ .../res/layout/navigation_bar_with_apps.xml | 331 --------------------- packages/SystemUI/res/layout/navigation_layout.xml | 20 +- .../res/layout/navigation_layout_rot90.xml | 20 +- .../statusbar/phone/NavigationBarInflaterView.java | 66 ++-- .../systemui/statusbar/phone/PhoneStatusBar.java | 25 +- 7 files changed, 88 insertions(+), 425 deletions(-) create mode 100644 packages/SystemUI/res/layout/apps_bar.xml delete mode 100644 packages/SystemUI/res/layout/navigation_bar_with_apps.xml diff --git a/packages/SystemUI/res/layout-sw600dp/navigation_layout_rot90.xml b/packages/SystemUI/res/layout-sw600dp/navigation_layout_rot90.xml index dd559c534351..38265f6019f5 100644 --- a/packages/SystemUI/res/layout-sw600dp/navigation_layout_rot90.xml +++ b/packages/SystemUI/res/layout-sw600dp/navigation_layout_rot90.xml @@ -25,10 +25,9 @@ android:layout_height="match_parent"> - - - - + + + + + + diff --git a/packages/SystemUI/res/layout/navigation_bar_with_apps.xml b/packages/SystemUI/res/layout/navigation_bar_with_apps.xml deleted file mode 100644 index ac95b5eb6530..000000000000 --- a/packages/SystemUI/res/layout/navigation_bar_with_apps.xml +++ /dev/null @@ -1,331 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/SystemUI/res/layout/navigation_layout.xml b/packages/SystemUI/res/layout/navigation_layout.xml index 7ebf4edfc78b..f9a36533f613 100644 --- a/packages/SystemUI/res/layout/navigation_layout.xml +++ b/packages/SystemUI/res/layout/navigation_layout.xml @@ -26,10 +26,9 @@ android:layout_height="match_parent"> - - - - - - - - = 0) { mButtonDispatchers.valueAt(indexOfKey).addView(v); } } - return v; } private boolean isSw600Dp() { 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 ffc836c7bbf8..3a41832e3f4c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -962,14 +962,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } protected void inflateNavigationBarView(Context context) { - // Optionally show app shortcuts in the nav bar "shelf" area. - if (shouldShowAppShelf()) { - mNavigationBarView = (NavigationBarView) View.inflate( - context, R.layout.navigation_bar_with_apps, null); - } else { - mNavigationBarView = (NavigationBarView) View.inflate( - context, R.layout.navigation_bar, null); - } + mNavigationBarView = (NavigationBarView) View.inflate( + context, R.layout.navigation_bar, null); } protected void initSignalCluster(View containerView) { @@ -982,21 +976,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } - /** Returns true if the app shelf should be shown in the nav bar. */ - private boolean shouldShowAppShelf() { - // Allow adb to override the default shelf behavior: - // adb shell settings put system demo_app_shelf 0 # Zero forces it off. - // adb shell settings put system demo_app_shelf 1 # Non-zero forces it on. - final int DEFAULT = -1; - final int shelfOverride = - Settings.System.getInt(mContext.getContentResolver(), "demo_app_shelf", DEFAULT); - if (shelfOverride != DEFAULT) { - return shelfOverride != 0; - } - // Otherwise default to the platform feature. - return FREEFORM_WINDOW_MANAGEMENT; - } - private void clearAllNotifications() { // animate-swipe all dismissable notifications, then animate the shade closed -- cgit v1.2.3-59-g8ed1b