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

Commit 00882302 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Fixed an issue where the roundness of a notification could be wrong" into pi-dev

am: 65cb06cf

Change-Id: I0800723e0c6b1b4b0b277d1a2b69859bb0e791cd
parents bc64c0d5 65cb06cf
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ import com.android.systemui.statusbar.stack.StackScrollState;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;

public class ExpandableNotificationRow extends ActivatableNotificationView
        implements PluginListener<NotificationMenuRowPlugin> {
@@ -179,6 +180,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private boolean mExpandAnimationRunning;
    private AboveShelfChangedListener mAboveShelfChangedListener;
    private HeadsUpManager mHeadsUpManager;
    private Consumer<Boolean> mHeadsUpAnimatingAwayListener;
    private View mHelperButton;
    private boolean mChildIsExpanding;

@@ -1115,13 +1117,21 @@ public class ExpandableNotificationRow extends ActivatableNotificationView

    public void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) {
        boolean wasAboveShelf = isAboveShelf();
        boolean changed = headsUpAnimatingAway != mHeadsupDisappearRunning;
        mHeadsupDisappearRunning = headsUpAnimatingAway;
        mPrivateLayout.setHeadsUpAnimatingAway(headsUpAnimatingAway);
        if (changed && mHeadsUpAnimatingAwayListener != null) {
            mHeadsUpAnimatingAwayListener.accept(headsUpAnimatingAway);
        }
        if (isAboveShelf() != wasAboveShelf) {
            mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf);
        }
    }

    public void setHeadsUpAnimatingAwayListener(Consumer<Boolean> listener) {
        mHeadsUpAnimatingAwayListener = listener;
    }

    /**
     * @return if the view was just heads upped and is now animating away. During such a time the
     * layout needs to be kept consistent
+1 −0
Original line number Diff line number Diff line
@@ -332,6 +332,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
        row.setOnExpandClickListener(mPresenter);
        row.setInflationCallback(this);
        row.setLongPressListener(getNotificationLongClicker());
        mListContainer.bindRow(row);
        mRemoteInputManager.bindRow(row);

        // Get the app name.
+7 −0
Original line number Diff line number Diff line
@@ -188,4 +188,11 @@ public interface NotificationListContainer {
    default void applyExpandAnimationParams(ExpandAnimationParameters params) {}

    default void setExpandingNotification(ExpandableNotificationRow row) {}

    /**
     * Bind a newly created row.
     *
     * @param row The notification to bind.
     */
    default void bindRow(ExpandableNotificationRow row) {}
}
+5 −0
Original line number Diff line number Diff line
@@ -47,6 +47,11 @@ class NotificationRoundnessManager implements OnHeadsUpChangedListener {
        updateRounding(headsUp, true /* animate */);
    }

    public void onHeadsupAnimatingAwayChanged(ExpandableNotificationRow row,
            boolean isAnimatingAway) {
        updateRounding(row, false /* animate */);
    }

    private void updateRounding(ActivatableNotificationView view, boolean animate) {
        float topRoundness = getRoundness(view, true /* top */);
        float bottomRoundness = getRoundness(view, false /* top */);
+7 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

/**
 * A layout which handles a dynamic amount of notifications and presents them in a scrollable stack.
@@ -3021,6 +3022,12 @@ public class NotificationStackScrollLayout extends ViewGroup
        requestChildrenUpdate();
    }

    @Override
    public void bindRow(ExpandableNotificationRow row) {
        row.setHeadsUpAnimatingAwayListener(animatingAway
                -> mRoundnessManager.onHeadsupAnimatingAwayChanged(row, animatingAway));
    }

    @Override
    public void applyExpandAnimationParams(ExpandAnimationParameters params) {
        mAmbientState.setExpandAnimationTopChange(params == null ? 0 : params.getTopChange());
Loading