OSDN Git Service

Fixed an issue where the action bar below wasn't rounded
authorSelim Cinek <cinek@google.com>
Wed, 17 Jan 2018 19:00:47 +0000 (11:00 -0800)
committerSelim Cinek <cinek@google.com>
Thu, 18 Jan 2018 00:22:38 +0000 (16:22 -0800)
Bug: 69168591
Test: add notification with action bar, observe propper rounding
Change-Id: I69d3a7c776635b1c63d0b91b998f066a0d2f130f

packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationCustomViewWrapper.java
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMediaTemplateViewWrapper.java
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java

index bf8a64c..5f4854a 100644 (file)
@@ -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) {
index c73e548..64df92c 100644 (file)
@@ -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);
     }
 }
index 0d22095..adc0914 100644 (file)
@@ -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;
     }
 }
index d7c08cc..548f006 100644 (file)
@@ -62,7 +62,7 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi
     }
 
     @Override
-    public boolean shouldClipToRounding() {
+    public boolean shouldClipToRounding(boolean topRounded, boolean bottomRounded) {
         return true;
     }
 }
index fd085d9..d463eae 100644 (file)
@@ -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.
index c71d604..17eb4c1 100644 (file)
@@ -195,7 +195,7 @@ public abstract class NotificationViewWrapper implements TransformableView {
         return 0;
     }
 
-    public boolean shouldClipToRounding() {
+    public boolean shouldClipToRounding(boolean topRounded, boolean bottomRounded) {
         return false;
     }
 }