diff options
| author | d34d <clark@cyngn.com> | 2015-02-15 17:43:27 -0800 |
|---|---|---|
| committer | Clark Scheff <clark@cyngn.com> | 2015-10-27 10:40:02 -0700 |
| commit | 6338f8d198756523e8fdd94a3223da68041bb875 (patch) | |
| tree | 28ba3cd2a1ce3e3b4e8dacabab41eacd14b6a28b /packages/SystemUI/src/com/android/systemui/statusbar/stack | |
| parent | 0cd07c8d03d51ee95f4efd0c15a66278409e3210 (diff) | |
| download | frameworks_base-6338f8d198756523e8fdd94a3223da68041bb875.zip frameworks_base-6338f8d198756523e8fdd94a3223da68041bb875.tar.gz frameworks_base-6338f8d198756523e8fdd94a3223da68041bb875.tar.bz2 | |
Themes: Don't clip notification when a theme defines a larger radius
The normal behavior is to clip notifications as they go behind
other notifications. The clipping is much more obvious when a
larger radius is being used so we should forgoe clipping in this
situation.
Change-Id: Iacffc8bdb146d47dd61686314297ddb851416a65
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/stack')
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java index 82064a7..ccbbbbd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -42,6 +42,8 @@ public class StackScrollAlgorithm { private static final int MAX_ITEMS_IN_BOTTOM_STACK = 3; private static final int MAX_ITEMS_IN_TOP_STACK = 3; + private static final int DEFAULT_CORNER_RADIUS = 2; + public static final float DIMMED_SCALE = 0.95f; private int mPaddingBetweenElements; @@ -72,6 +74,7 @@ public class StackScrollAlgorithm { private int mMaxNotificationHeight; private boolean mScaleDimmed; private HeadsUpManager mHeadsUpManager; + private boolean mPerformClipping; public StackScrollAlgorithm(Context context) { initConstants(context); @@ -128,6 +131,12 @@ public class StackScrollAlgorithm { R.dimen.notification_collapse_second_card_padding); mScaleDimmed = context.getResources().getDisplayMetrics().densityDpi >= DisplayMetrics.DENSITY_XXHIGH; + + // We don't want to clip the notification if a theme overrides the corner radius with + // a value larger than the default. + mPerformClipping = context.getResources() + .getDimension(R.dimen.notification_material_rounded_rect_radius) <= + DEFAULT_CORNER_RADIUS * context.getResources().getDisplayMetrics().density; } public boolean shouldScaleDimmed() { @@ -228,8 +237,7 @@ public class StackScrollAlgorithm { // In the unlocked shade we have to clip a little bit higher because of the rounded // corners of the notifications, but only if we are not fully overlapped by // the top card. - float clippingCorrection = state.dimmed - ? 0 + float clippingCorrection = state.dimmed ? (mPerformClipping ? 0 : newHeight) : mRoundedRectCornerRadius * state.scale; clipHeight += clippingCorrection; } |
