Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0a580b6 authored by Selim Cinek's avatar Selim Cinek Committed by Android Git Automerger
Browse files

am 0e8614b1: Merge "Notifications where clipped incorrectly in the unlocked...

am 0e8614b1: Merge "Notifications where clipped incorrectly in the unlocked shade." into lmp-preview-dev

* commit '0e8614b1ecd6c6cfe506323c6f6d6bae65804aea':
  Notifications where clipped incorrectly in the unlocked shade.
parents 4885f2f7 a08334e5
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -37,12 +37,15 @@ public class StackScrollState {
    private static final String CHILD_NOT_FOUND_TAG = "StackScrollStateNoSuchChild";
    private static final String CHILD_NOT_FOUND_TAG = "StackScrollStateNoSuchChild";


    private final ViewGroup mHostView;
    private final ViewGroup mHostView;
    private final int mRoundedRectCornerRadius;
    private Map<ExpandableView, ViewState> mStateMap;
    private Map<ExpandableView, ViewState> mStateMap;
    private final Rect mClipRect = new Rect();
    private final Rect mClipRect = new Rect();


    public StackScrollState(ViewGroup hostView) {
    public StackScrollState(ViewGroup hostView) {
        mHostView = hostView;
        mHostView = hostView;
        mStateMap = new HashMap<ExpandableView, ViewState>();
        mStateMap = new HashMap<ExpandableView, ViewState>();
        mRoundedRectCornerRadius = mHostView.getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_quantum_rounded_rect_radius);
    }
    }


    public ViewGroup getHostView() {
    public ViewGroup getHostView() {
@@ -155,11 +158,15 @@ public class StackScrollState {
                // apply clipping and shadow
                // apply clipping and shadow
                float newNotificationEnd = newYTranslation + newHeight;
                float newNotificationEnd = newYTranslation + newHeight;


                // In the unlocked shade we have to clip a little bit higher because of the rounded
                // corners of the notifications.
                float clippingCorrection = state.dimmed ? 0 : mRoundedRectCornerRadius;

                // When the previous notification is swiped, we don't clip the content to the
                // When the previous notification is swiped, we don't clip the content to the
                // bottom of it.
                // bottom of it.
                float clipHeight = previousNotificationIsSwiped
                float clipHeight = previousNotificationIsSwiped
                        ? newHeight
                        ? newHeight
                        : newNotificationEnd - (previousNotificationEnd);
                        : newNotificationEnd - (previousNotificationEnd - clippingCorrection);


                updateChildClippingAndBackground(child, newHeight,
                updateChildClippingAndBackground(child, newHeight,
                        clipHeight,
                        clipHeight,