diff options
| author | 2018-01-17 11:00:47 -0800 | |
|---|---|---|
| committer | 2018-01-17 16:22:38 -0800 | |
| commit | 86bfcee04bdad331ac9d41e690eaa1190ea7e334 (patch) | |
| tree | 97b84ae38228651e6470ee2e3a62ac4f4535029e | |
| parent | 1397ea3b910d0981dc4bf91016a78af8fcec08bf (diff) | |
Fixed an issue where the action bar below wasn't rounded
Bug: 69168591
Test: add notification with action bar, observe propper rounding
Change-Id: I69d3a7c776635b1c63d0b91b998f066a0d2f130f
6 files changed, 22 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index bf8a64cee974..5f4854aeeb7b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -2377,7 +2377,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView NotificationContentView contentView = (NotificationContentView) child; if (isClippingNeeded()) { return true; - } else if (!hasNoRounding() && contentView.shouldClipToRounding()) { + } else if (!hasNoRounding() + && contentView.shouldClipToRounding(getCurrentTopRoundness() != 0.0f, + getCurrentBottomRoundness() != 0.0f)) { return true; } } else if (child == mChildrenContainer) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index c73e548eaa17..64df92c3bd51 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -1489,19 +1489,21 @@ public class NotificationContentView extends FrameLayout { return false; } - public boolean shouldClipToRounding() { - boolean needsPaddings = shouldClipToRounding(getVisibleType()); + public boolean shouldClipToRounding(boolean topRounded, boolean bottomRounded) { + boolean needsPaddings = shouldClipToRounding(getVisibleType(), topRounded, bottomRounded); if (mUserExpanding) { - needsPaddings |= shouldClipToRounding(mTransformationStartVisibleType); + needsPaddings |= shouldClipToRounding(mTransformationStartVisibleType, topRounded, + bottomRounded); } return needsPaddings; } - private boolean shouldClipToRounding(int visibleType) { + private boolean shouldClipToRounding(int visibleType, boolean topRounded, + boolean bottomRounded) { NotificationViewWrapper visibleWrapper = getVisibleWrapper(visibleType); if (visibleWrapper == null) { return false; } - return visibleWrapper.shouldClipToRounding(); + return visibleWrapper.shouldClipToRounding(topRounded, bottomRounded); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationCustomViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationCustomViewWrapper.java index 0d2209569093..adc091457364 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationCustomViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationCustomViewWrapper.java @@ -21,7 +21,6 @@ import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.graphics.ColorMatrixColorFilter; import android.graphics.Paint; -import android.os.Build; import android.view.View; import com.android.systemui.R; @@ -118,7 +117,7 @@ public class NotificationCustomViewWrapper extends NotificationViewWrapper { } @Override - public boolean shouldClipToRounding() { + public boolean shouldClipToRounding(boolean topRounded, boolean bottomRounded) { return true; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java index d7c08cc89c25..548f006c934d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java @@ -62,7 +62,7 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi } @Override - public boolean shouldClipToRounding() { + public boolean shouldClipToRounding(boolean topRounded, boolean bottomRounded) { return true; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java index fd085d9c2391..d463eae6e43f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java @@ -265,6 +265,15 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp updateActionOffset(); } + @Override + public boolean shouldClipToRounding(boolean topRounded, boolean bottomRounded) { + if (super.shouldClipToRounding(topRounded, bottomRounded)) { + return true; + } + return bottomRounded && mActionsContainer != null + && mActionsContainer.getVisibility() != View.GONE; + } + private void updateActionOffset() { if (mActionsContainer != null) { // We should never push the actions higher than they are in the headsup view. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java index c71d604c9122..17eb4c110031 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java @@ -195,7 +195,7 @@ public abstract class NotificationViewWrapper implements TransformableView { return 0; } - public boolean shouldClipToRounding() { + public boolean shouldClipToRounding(boolean topRounded, boolean bottomRounded) { return false; } } |