Loading packages/SystemUI/res/drawable/notification_material_bg.xml +3 −2 Original line number Diff line number Diff line Loading @@ -28,9 +28,10 @@ <solid android:color="@color/notification_state_color_default" /> </shape> </item> <item> <item android:id="@+id/notification_focus_overlay"> <shape> <stroke android:width="3dp" android:color="@color/notification_focus_overlay_color"/> <stroke android:width="@dimen/notification_focus_stroke_width" android:color="@color/notification_focus_overlay_color"/> </shape> </item> </layer-list> No newline at end of file packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,9 @@ <!-- Radius for notifications corners without adjacent notifications --> <dimen name="notification_corner_radius">28dp</dimen> <!-- Stroke width for notifications focus state overlay, see id/notification_focus_outline --> <dimen name="notification_focus_stroke_width">3dp</dimen> <!-- Distance over which notification corner animations run, near the shelf while scrolling. --> <dimen name="notification_corner_animation_distance">48dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java +21 −4 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ public class NotificationBackgroundView extends View implements Dumpable { private int mTintColor; @Nullable private Integer mRippleColor; private final float[] mCornerRadii = new float[8]; private final float[] mFocusOverlayCornerRadii = new float[8]; private float mFocusOverlayStroke = 0; private boolean mBottomIsRounded; private boolean mBottomAmountClips = true; private int mActualHeight = -1; Loading @@ -74,6 +76,7 @@ public class NotificationBackgroundView extends View implements Dumpable { R.color.notification_state_color_dark); mNormalColor = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorSurfaceContainerHigh); mFocusOverlayStroke = getResources().getDimension(R.dimen.notification_focus_stroke_width); } @Override Loading Loading @@ -290,14 +293,28 @@ public class NotificationBackgroundView extends View implements Dumpable { if (mDontModifyCorners) { return; } if (mBackground instanceof LayerDrawable) { int numberOfLayers = ((LayerDrawable) mBackground).getNumberOfLayers(); if (mBackground instanceof LayerDrawable layerDrawable) { int numberOfLayers = layerDrawable.getNumberOfLayers(); for (int i = 0; i < numberOfLayers; i++) { GradientDrawable gradientDrawable = (GradientDrawable) ((LayerDrawable) mBackground).getDrawable(i); GradientDrawable gradientDrawable = (GradientDrawable) layerDrawable.getDrawable(i); gradientDrawable.setCornerRadii(mCornerRadii); } updateFocusOverlayRadii(layerDrawable); } } private void updateFocusOverlayRadii(LayerDrawable background) { GradientDrawable overlay = (GradientDrawable) background.findDrawableByLayerId( R.id.notification_focus_overlay); for (int i = 0; i < mCornerRadii.length; i++) { // in theory subtracting mFocusOverlayStroke/2 should be enough but notification // background is still peeking a bit from below - probably due to antialiasing or // overlay uneven scaling. So let's subtract full mFocusOverlayStroke to make sure the // radius is a bit smaller and covers background corners fully mFocusOverlayCornerRadii[i] = Math.max(0, mCornerRadii[i] - mFocusOverlayStroke); } overlay.setCornerRadii(mFocusOverlayCornerRadii); } /** Set the current expand animation size. */ Loading Loading
packages/SystemUI/res/drawable/notification_material_bg.xml +3 −2 Original line number Diff line number Diff line Loading @@ -28,9 +28,10 @@ <solid android:color="@color/notification_state_color_default" /> </shape> </item> <item> <item android:id="@+id/notification_focus_overlay"> <shape> <stroke android:width="3dp" android:color="@color/notification_focus_overlay_color"/> <stroke android:width="@dimen/notification_focus_stroke_width" android:color="@color/notification_focus_overlay_color"/> </shape> </item> </layer-list> No newline at end of file
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,9 @@ <!-- Radius for notifications corners without adjacent notifications --> <dimen name="notification_corner_radius">28dp</dimen> <!-- Stroke width for notifications focus state overlay, see id/notification_focus_outline --> <dimen name="notification_focus_stroke_width">3dp</dimen> <!-- Distance over which notification corner animations run, near the shelf while scrolling. --> <dimen name="notification_corner_animation_distance">48dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java +21 −4 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ public class NotificationBackgroundView extends View implements Dumpable { private int mTintColor; @Nullable private Integer mRippleColor; private final float[] mCornerRadii = new float[8]; private final float[] mFocusOverlayCornerRadii = new float[8]; private float mFocusOverlayStroke = 0; private boolean mBottomIsRounded; private boolean mBottomAmountClips = true; private int mActualHeight = -1; Loading @@ -74,6 +76,7 @@ public class NotificationBackgroundView extends View implements Dumpable { R.color.notification_state_color_dark); mNormalColor = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorSurfaceContainerHigh); mFocusOverlayStroke = getResources().getDimension(R.dimen.notification_focus_stroke_width); } @Override Loading Loading @@ -290,14 +293,28 @@ public class NotificationBackgroundView extends View implements Dumpable { if (mDontModifyCorners) { return; } if (mBackground instanceof LayerDrawable) { int numberOfLayers = ((LayerDrawable) mBackground).getNumberOfLayers(); if (mBackground instanceof LayerDrawable layerDrawable) { int numberOfLayers = layerDrawable.getNumberOfLayers(); for (int i = 0; i < numberOfLayers; i++) { GradientDrawable gradientDrawable = (GradientDrawable) ((LayerDrawable) mBackground).getDrawable(i); GradientDrawable gradientDrawable = (GradientDrawable) layerDrawable.getDrawable(i); gradientDrawable.setCornerRadii(mCornerRadii); } updateFocusOverlayRadii(layerDrawable); } } private void updateFocusOverlayRadii(LayerDrawable background) { GradientDrawable overlay = (GradientDrawable) background.findDrawableByLayerId( R.id.notification_focus_overlay); for (int i = 0; i < mCornerRadii.length; i++) { // in theory subtracting mFocusOverlayStroke/2 should be enough but notification // background is still peeking a bit from below - probably due to antialiasing or // overlay uneven scaling. So let's subtract full mFocusOverlayStroke to make sure the // radius is a bit smaller and covers background corners fully mFocusOverlayCornerRadii[i] = Math.max(0, mCornerRadii[i] - mFocusOverlayStroke); } overlay.setCornerRadii(mFocusOverlayCornerRadii); } /** Set the current expand animation size. */ Loading