Merge "Fading out keyguard only content instead of occluding them with the scrim" into sc-dev am: 0e7b5cc8f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14788790 Change-Id: I4f6069a007ca8273b1912c481a9caafe794203ba
This commit is contained in:
@@ -64,18 +64,6 @@
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false">
|
||||
|
||||
<com.android.systemui.scrim.ScrimView
|
||||
android:id="@+id/scrim_notifications"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:importantForAccessibility="no"
|
||||
systemui:ignoreRightInset="true"
|
||||
systemui:layout_constraintStart_toStartOf="parent"
|
||||
systemui:layout_constraintEnd_toEndOf="parent"
|
||||
systemui:layout_constraintTop_toTopOf="parent"
|
||||
systemui:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<include
|
||||
layout="@layout/keyguard_status_view"
|
||||
android:visibility="gone"/>
|
||||
|
||||
@@ -51,6 +51,14 @@
|
||||
sysui:ignoreRightInset="true"
|
||||
/>
|
||||
|
||||
<com.android.systemui.scrim.ScrimView
|
||||
android:id="@+id/scrim_notifications"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:importantForAccessibility="no"
|
||||
sysui:ignoreRightInset="true"
|
||||
/>
|
||||
|
||||
<com.android.systemui.statusbar.LightRevealScrim
|
||||
android:id="@+id/light_reveal_scrim"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -87,6 +87,11 @@ public class LockIconView extends ImageView {
|
||||
updateSensorRect(h, w);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlappingRendering() {
|
||||
return false;
|
||||
}
|
||||
|
||||
float getLocationTop() {
|
||||
return mLockIconCenter.y - mRadius;
|
||||
}
|
||||
|
||||
@@ -451,4 +451,11 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
||||
|
||||
private final AccessibilityManager.TouchExplorationStateChangeListener
|
||||
mTouchExplorationStateChangeListener = enabled -> updateClickListener();
|
||||
|
||||
/**
|
||||
* Set the alpha of this view.
|
||||
*/
|
||||
public void setAlpha(float alpha) {
|
||||
mView.setAlpha(alpha);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,6 +287,8 @@ class LockscreenShadeTransitionController @Inject constructor(
|
||||
// TODO: appear media also in split shade
|
||||
val mediaAmount = if (useSplitShade) 0f else field
|
||||
mediaHierarchyManager.setTransitionToFullShadeAmount(mediaAmount)
|
||||
// Fade out all content only visible on the lockscreen
|
||||
notificationPanelController.setKeyguardOnlyContentAlpha(1.0f - scrimProgress)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,6 +577,11 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
*/
|
||||
private ValueAnimator mQsClippingAnimation = null;
|
||||
private final Rect mKeyguardStatusAreaClipBounds = new Rect();
|
||||
|
||||
/**
|
||||
* The alpha of the views which only show on the keyguard but not in shade / shade locked
|
||||
*/
|
||||
private float mKeyguardOnlyContentAlpha = 1.0f;
|
||||
private int mOldLayoutDirection;
|
||||
private NotificationShelfController mNotificationShelfController;
|
||||
private int mScrimCornerRadius;
|
||||
@@ -1412,12 +1417,13 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
}
|
||||
|
||||
private void updateClock() {
|
||||
mKeyguardStatusViewController.setAlpha(mClockPositionResult.clockAlpha);
|
||||
float alpha = mClockPositionResult.clockAlpha * mKeyguardOnlyContentAlpha;
|
||||
mKeyguardStatusViewController.setAlpha(alpha);
|
||||
if (mKeyguardQsUserSwitchController != null) {
|
||||
mKeyguardQsUserSwitchController.setAlpha(mClockPositionResult.clockAlpha);
|
||||
mKeyguardQsUserSwitchController.setAlpha(alpha);
|
||||
}
|
||||
if (mKeyguardUserSwitcherController != null) {
|
||||
mKeyguardUserSwitcherController.setAlpha(mClockPositionResult.clockAlpha);
|
||||
mKeyguardUserSwitcherController.setAlpha(alpha);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2024,6 +2030,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private void maybeAnimateBottomAreaAlpha() {
|
||||
mBottomAreaShadeAlphaAnimator.cancel();
|
||||
if (mBarState == StatusBarState.SHADE_LOCKED) {
|
||||
mBottomAreaShadeAlphaAnimator.setFloatValues(mBottomAreaShadeAlpha, 0.0f);
|
||||
mBottomAreaShadeAlphaAnimator.start();
|
||||
} else {
|
||||
mBottomAreaShadeAlpha = 1f;
|
||||
@@ -2439,6 +2446,20 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
updateQsExpansion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the alpha of the keyguard elements which only show on the lockscreen, but not in
|
||||
* shade locked / shade. This is used when dragging down to the full shade.
|
||||
*/
|
||||
public void setKeyguardOnlyContentAlpha(float keyguardAlpha) {
|
||||
mKeyguardOnlyContentAlpha = Interpolators.ALPHA_IN.getInterpolation(keyguardAlpha);
|
||||
if (mBarState == KEYGUARD) {
|
||||
// If the animator is running, it's already fading out the content and this is a reset
|
||||
mBottomAreaShadeAlpha = mKeyguardOnlyContentAlpha;
|
||||
updateKeyguardBottomAreaAlpha();
|
||||
}
|
||||
updateClock();
|
||||
}
|
||||
|
||||
private void trackMovement(MotionEvent event) {
|
||||
if (mQsVelocityTracker != null) mQsVelocityTracker.addMovement(event);
|
||||
}
|
||||
@@ -2897,6 +2918,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
if (ambientIndicationContainer != null) {
|
||||
ambientIndicationContainer.setAlpha(alpha);
|
||||
}
|
||||
mLockIconViewController.setAlpha(alpha);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user