From 0fb81090c0ad144e9eaec5d761070ac55b20ce3d Mon Sep 17 00:00:00 2001 From: George Mount Date: Thu, 28 Aug 2014 16:23:05 -0700 Subject: [PATCH] Add IDs for status and nav-bar backgrounds. Bug 17299689 Change-Id: I9b2168c547fe2670900614805031c3bb5fa63802 --- api/current.txt | 2 ++ core/res/res/values/ids.xml | 2 ++ core/res/res/values/public.xml | 2 ++ .../com/android/internal/policy/impl/PhoneWindow.java | 9 ++++++--- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index 6fbd40bfe2306..55b11e8232413 100644 --- a/api/current.txt +++ b/api/current.txt @@ -1757,6 +1757,7 @@ package android { field public static final int list = 16908298; // 0x102000a field public static final int mask = 16908353; // 0x1020041 field public static final int message = 16908299; // 0x102000b + field public static final int navigationBarBackground = 16908355; // 0x1020043 field public static final int paste = 16908322; // 0x1020022 field public static final int primary = 16908300; // 0x102000c field public static final int progress = 16908301; // 0x102000d @@ -1765,6 +1766,7 @@ package android { field public static final int selectTextMode = 16908333; // 0x102002d field public static final int selectedIcon = 16908302; // 0x102000e field public static final int startSelectingText = 16908328; // 0x1020028 + field public static final int statusBarBackground = 16908354; // 0x1020042 field public static final int stopSelectingText = 16908329; // 0x1020029 field public static final int summary = 16908304; // 0x1020010 field public static final int switchInputMethod = 16908324; // 0x1020024 diff --git a/core/res/res/values/ids.xml b/core/res/res/values/ids.xml index 4c59f73ff53e6..bd24f3e4212f7 100644 --- a/core/res/res/values/ids.xml +++ b/core/res/res/values/ids.xml @@ -87,4 +87,6 @@ + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 3b49bed3fdc44..954cf08c14a51 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2286,6 +2286,8 @@ + + diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index a13da609a7ff7..93591a915cd32 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -2754,11 +2754,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mStatusColorView = updateColorViewInt(mStatusColorView, SYSTEM_UI_FLAG_FULLSCREEN, FLAG_TRANSLUCENT_STATUS, mStatusBarColor, mLastTopInset, Gravity.TOP, - STATUS_BAR_BACKGROUND_TRANSITION_NAME); + STATUS_BAR_BACKGROUND_TRANSITION_NAME, + com.android.internal.R.id.statusBarBackground); mNavigationColorView = updateColorViewInt(mNavigationColorView, SYSTEM_UI_FLAG_HIDE_NAVIGATION, FLAG_TRANSLUCENT_NAVIGATION, mNavigationBarColor, mLastBottomInset, Gravity.BOTTOM, - NAVIGATION_BAR_BACKGROUND_TRANSITION_NAME); + NAVIGATION_BAR_BACKGROUND_TRANSITION_NAME, + com.android.internal.R.id.navigationBarBackground); } if (insets != null) { insets = insets.consumeStableInsets(); @@ -2767,7 +2769,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } private View updateColorViewInt(View view, int systemUiHideFlag, int translucentFlag, - int color, int height, int verticalGravity, String transitionName) { + int color, int height, int verticalGravity, String transitionName, int id) { boolean show = height > 0 && (mLastSystemUiVisibility & systemUiHideFlag) == 0 && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 @@ -2778,6 +2780,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { view = new View(mContext); view.setBackgroundColor(color); view.setTransitionName(transitionName); + view.setId(id); addView(view, new LayoutParams(LayoutParams.MATCH_PARENT, height, Gravity.START | verticalGravity)); }