Enable short shelf for split shade

Bug: 213480466
Test: NotificationShelfTest
Test: swipe down on lockscreen notifications, let go
   => short shelf expands, retracts width
Test: swipe down on lockscreen notifications to go to unlocked shade
   => short shelf expands to full width
Test: expand notification on lockscreen
   => short shelf expands to full width as shade opens
Test: tap hidden/visible part of shelf
   => only visible part of shelf launches full shade
Test: the above in LTR/RTL
Change-Id: I3f7d488531be3af544a41f4fab496b3ccc137f24
This commit is contained in:
Lyn Han
2022-02-07 19:40:06 -06:00
parent 7315b7278c
commit 4c3248c4b0

View File

@@ -86,7 +86,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
private float mCornerAnimationDistance;
private NotificationShelfController mController;
private int mActualWidth = -1;
private boolean mUseSplitShade;
/** Fraction of lockscreen to shade animation (on lockscreen swipe down). */
private float mFractionToShade;
@@ -138,9 +137,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
mCornerAnimationDistance = res.getDimensionPixelSize(
R.dimen.notification_corner_animation_distance);
// TODO(b/213480466) enable short shelf on split shade
mUseSplitShade = Utils.shouldUseSplitNotificationShade(mContext.getResources());
mShelfIcons.setInNotificationIconShelf(true);
if (!mShowNotificationShelf) {
setVisibility(GONE);
@@ -233,7 +229,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
*/
@VisibleForTesting
public void updateStateWidth(ShelfState shelfState, float fraction, int shortestWidth) {
shelfState.actualWidth = !mUseSplitShade && mAmbientState.isOnKeyguard()
shelfState.actualWidth = mAmbientState.isOnKeyguard()
? (int) MathUtils.lerp(shortestWidth, getWidth(), fraction)
: getWidth();
}