Loading libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml→libs/WindowManager/Shell/res/drawable/bubble_manage_menu_bg.xml +2 −1 Original line number Diff line number Diff line Loading @@ -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" Loading libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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"> Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +7 −11 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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( Loading @@ -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; Loading @@ -414,6 +409,7 @@ public class BubbleExpandedView extends LinearLayout { lp.height = mPointerHeight; } mPointerView.setLayoutParams(lp); mCurrentPointer.setTint(mBackgroundColorFloating); mPointerView.setBackground(mCurrentPointer); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt +7 −9 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java +9 −8 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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, 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); } Loading Loading
libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml→libs/WindowManager/Shell/res/drawable/bubble_manage_menu_bg.xml +2 −1 Original line number Diff line number Diff line Loading @@ -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" Loading
libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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"> Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +7 −11 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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( Loading @@ -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; Loading @@ -414,6 +409,7 @@ public class BubbleExpandedView extends LinearLayout { lp.height = mPointerHeight; } mPointerView.setLayoutParams(lp); mCurrentPointer.setTint(mBackgroundColorFloating); mPointerView.setBackground(mCurrentPointer); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt +7 −9 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java +9 −8 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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, 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); } Loading