Merge "Keeping the header hidden while the hun is going away" into pi-dev
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user