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

Commit 02389f9b authored by Yuri Lin's avatar Yuri Lin Committed by Android (Google) Code Review
Browse files

Merge "Don't round the top corners of the topmost magnetic target" into main

parents b3c1732a e5647768
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -115,15 +115,25 @@ public class NotificationRoundnessManager implements Dumpable {
    void setRoundnessForAffectedViews(List<TopBottomRoundness> roundnessSet, boolean animate) {
        if (roundnessSet.size() != mCurrentRoundables.size()) return;

        // In case there are fewer actual roundables than the full set/list allows for (for example,
        // if the notification is within a group and close to the group header), track which is the
        // first non-null element to avoid unnecessarily rounding the top corners.
        boolean seenFirst = false;
        for (int i = 0; i < roundnessSet.size(); i++) {
            Roundable roundable = mCurrentRoundables.get(i);
            if (roundable != null) {
            TopBottomRoundness roundnessConfig = roundnessSet.get(i);
            if (roundable != null) {
                if (!seenFirst) {
                    seenFirst = true;
                    roundable.requestBottomRoundness(roundnessConfig.getBottomRoundness(),
                            DISMISS_ANIMATION, animate);
                } else {
                    roundable.requestRoundness(roundnessConfig.getTopRoundness(),
                            roundnessConfig.getBottomRoundness(), DISMISS_ANIMATION, animate);
                }
            }
        }
    }

    void setClearAllInProgress(boolean isClearingAll) {
        mIsClearAllInProgress = isClearingAll;