diff options
| -rw-r--r-- | libs/WindowManager/Shell/res/drawable/bubble_manage_menu_bg.xml (renamed from libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml) | 3 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml | 2 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java | 18 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt | 16 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java | 17 |
5 files changed, 26 insertions, 30 deletions
diff --git a/libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml b/libs/WindowManager/Shell/res/drawable/bubble_manage_menu_bg.xml index e95744573960..4bd2f134d027 100644 --- a/libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_manage_menu_bg.xml @@ -15,8 +15,9 @@ ~ limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" android:shape="rectangle"> - <solid android:color="?android:attr/colorBackgroundFloating" /> + <solid android:color="?androidprv:attr/colorSurface" /> <corners android:bottomLeftRadius="?android:attr/dialogCornerRadius" android:topLeftRadius="?android:attr/dialogCornerRadius" diff --git a/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml b/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml index 3a6aa805d071..f4b3aca33dd7 100644 --- a/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml @@ -17,7 +17,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/rounded_bg_full" + android:background="@drawable/bubble_manage_menu_bg" android:elevation="@dimen/bubble_manage_menu_elevation" android:orientation="vertical"> diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java index a87da88273ea..7755cc0e6aed 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java @@ -111,6 +111,7 @@ public class BubbleExpandedView extends LinearLayout { private ShapeDrawable mRightPointer; private int mExpandedViewPadding; private float mCornerRadius = 0f; + private int mBackgroundColorFloating; @Nullable private Bubble mBubble; private PendingIntent mPendingIntent; @@ -384,7 +385,11 @@ public class BubbleExpandedView extends LinearLayout { android.R.attr.dialogCornerRadius, android.R.attr.colorBackgroundFloating}); mCornerRadius = ta.getDimensionPixelSize(0, 0); - mExpandedViewContainer.setBackgroundColor(ta.getColor(1, Color.WHITE)); + final int mode = + getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + final boolean isNightMode = (mode == Configuration.UI_MODE_NIGHT_YES); + mBackgroundColorFloating = ta.getColor(1, isNightMode ? Color.BLACK : Color.WHITE); + mExpandedViewContainer.setBackgroundColor(mBackgroundColorFloating); ta.recycle(); if (mTaskView != null && ScreenDecorationsUtils.supportsRoundedCornersOnWindows( @@ -395,16 +400,6 @@ public class BubbleExpandedView extends LinearLayout { } private void updatePointerView() { - final int mode = - getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; - switch (mode) { - case Configuration.UI_MODE_NIGHT_NO: - mCurrentPointer.setTint(getResources().getColor(R.color.bubbles_light)); - break; - case Configuration.UI_MODE_NIGHT_YES: - mCurrentPointer.setTint(getResources().getColor(R.color.bubbles_dark)); - break; - } LayoutParams lp = (LayoutParams) mPointerView.getLayoutParams(); if (mCurrentPointer == mLeftPointer || mCurrentPointer == mRightPointer) { lp.width = mPointerHeight; @@ -414,6 +409,7 @@ public class BubbleExpandedView extends LinearLayout { lp.height = mPointerHeight; } mPointerView.setLayoutParams(lp); + mCurrentPointer.setTint(mBackgroundColorFloating); mPointerView.setBackground(mCurrentPointer); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt index e4b1f64e090b..b7a30ea94f87 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt @@ -18,7 +18,6 @@ package com.android.wm.shell.bubbles import android.app.ActivityTaskManager.INVALID_TASK_ID import android.content.Context -import android.content.res.Configuration import android.graphics.Bitmap import android.graphics.Matrix import android.graphics.Path @@ -93,22 +92,21 @@ class BubbleOverflow( // Set overflow button accent color, dot color val typedValue = TypedValue() - context.theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true) + context.theme.resolveAttribute(com.android.internal.R.attr.colorAccentPrimary, + typedValue, true) val colorAccent = res.getColor(typedValue.resourceId, null) - overflowBtn?.drawable?.setTint(colorAccent) dotColor = colorAccent + val shapeColor = res.getColor(android.R.color.system_accent1_1000) + overflowBtn?.drawable?.setTint(shapeColor) + val iconFactory = BubbleIconFactory(context) // Update bitmap - val nightMode = (res.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK - == Configuration.UI_MODE_NIGHT_YES) - val bg = ColorDrawable(res.getColor( - if (nightMode) R.color.bubbles_dark else R.color.bubbles_light, null)) - val fg = InsetDrawable(overflowBtn?.drawable, bitmapSize - iconBitmapSize /* inset */) - bitmap = iconFactory.createBadgedIconBitmap(AdaptiveIconDrawable(bg, fg), + bitmap = iconFactory.createBadgedIconBitmap(AdaptiveIconDrawable( + ColorDrawable(colorAccent), fg), null /* user */, true /* shrinkNonAdaptiveIcons */).icon // Update dot path diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java index d3b7ae21f0c3..82849e2020e1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java @@ -89,15 +89,16 @@ public class BubbleOverflowContainerView extends LinearLayout { } public BubbleOverflowContainerView(Context context) { - super(context); + this(context, null); } public BubbleOverflowContainerView(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); + this(context, attrs, 0); } - public BubbleOverflowContainerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); + public BubbleOverflowContainerView(Context context, @Nullable AttributeSet attrs, + int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); } public BubbleOverflowContainerView(Context context, AttributeSet attrs, int defStyleAttr, @@ -170,14 +171,14 @@ public class BubbleOverflowContainerView extends LinearLayout { ? res.getColor(R.color.bubbles_dark) : res.getColor(R.color.bubbles_light)); - final TypedArray typedArray = getContext().obtainStyledAttributes( - new int[]{android.R.attr.colorBackgroundFloating, - android.R.attr.textColorSecondary}); + final TypedArray typedArray = getContext().obtainStyledAttributes(new int[] { + android.R.attr.colorBackgroundFloating, + android.R.attr.textColorSecondary}); int bgColor = typedArray.getColor(0, isNightMode ? Color.BLACK : Color.WHITE); int textColor = typedArray.getColor(1, isNightMode ? Color.WHITE : Color.BLACK); textColor = ContrastColorUtil.ensureTextContrast(textColor, bgColor, isNightMode); typedArray.recycle(); - + setBackgroundColor(bgColor); mEmptyStateTitle.setTextColor(textColor); mEmptyStateSubtitle.setTextColor(textColor); } |