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

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

Merge "Keeping the header hidden while the hun is going away" into pi-dev am: 2cfd9fb9

am: cb4e490d

Change-Id: I0c2780d928c6bbe52a664655f5cc1f3750f19b2c
parents 3a09a2d8 cb4e490d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ import java.util.function.Consumer;
/**
 * Controls the appearance of heads up notifications in the icon area and the header itself.
 */
class HeadsUpAppearanceController implements OnHeadsUpChangedListener,
public class HeadsUpAppearanceController implements OnHeadsUpChangedListener,
        DarkIconDispatcher.DarkReceiver {
    public static final int CONTENT_FADE_DURATION = 110;
    public static final int CONTENT_FADE_DELAY = 100;
@@ -92,6 +92,7 @@ class HeadsUpAppearanceController implements OnHeadsUpChangedListener,
        panelView.setHeadsUpAppearanceController(this);
        mStackScroller.addOnExpandedHeightListener(mSetExpandedHeight);
        mStackScroller.addOnLayoutChangeListener(mStackScrollLayoutChangeListener);
        mStackScroller.setHeadsUpAppearanceController(this);
        mClockView = clockView;
        mDarkIconDispatcher = Dependency.get(DarkIconDispatcher.class);
        mDarkIconDispatcher.addDarkReceiver(this);
@@ -226,10 +227,10 @@ class HeadsUpAppearanceController implements OnHeadsUpChangedListener,
        });
    }

    private void updateHeader(NotificationData.Entry entry) {
    public void updateHeader(NotificationData.Entry entry) {
        ExpandableNotificationRow row = entry.row;
        float headerVisibleAmount = 1.0f;
        if (row.isPinned() || row == mTrackedChild) {
        if (row.isPinned() || row.isHeadsUpAnimatingAway() || row == mTrackedChild) {
            headerVisibleAmount = mExpandFraction;
        }
        row.setHeaderVisibleAmount(headerVisibleAmount);
+11 −2
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ import com.android.systemui.statusbar.notification.FakeShadowView;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.VisibilityLocationProvider;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.ScrimController;
@@ -413,6 +414,7 @@ public class NotificationStackScrollLayout extends ViewGroup
    private int mAntiBurnInOffsetX;
    private ArrayList<BiConsumer<Float, Float>> mExpandedHeightListeners = new ArrayList<>();
    private int mHeadsUpInset;
    private HeadsUpAppearanceController mHeadsUpAppearanceController;

    public NotificationStackScrollLayout(Context context) {
        this(context, null);
@@ -3079,8 +3081,10 @@ public class NotificationStackScrollLayout extends ViewGroup

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

    @Override
@@ -4635,6 +4639,11 @@ public class NotificationStackScrollLayout extends ViewGroup
        mExpandedHeightListeners.remove(listener);
    }

    public void setHeadsUpAppearanceController(
            HeadsUpAppearanceController headsUpAppearanceController) {
        mHeadsUpAppearanceController = headsUpAppearanceController;
    }

    /**
     * A listener that is notified when the empty space below the notifications is clicked on
     */