Bouncer: Remove overlap with shade and bouncer
Scale values of fading away shade content. Also scale the notification scrim alpha as well when state is SHADE_LOCKED. There are a few ternaries to preserve the state of the notification shade when device is unlocked. (The notification shade content will not disapper as quickly if the bouncer is not about to show). There also seems to be some flickering of the notification scrim alpha when enter bouncer from the notification shade and successfully passing the security method, but this seems to be a separate issue. Bug: 226108150 Test: Manual on device Change-Id: Id717191cefe3901983ef6a46174383110d89f5ae
This commit is contained in:
@@ -37,6 +37,7 @@ import android.view.ViewTreeObserver;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.keyguard.BouncerPanelExpansionCalculator;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.animation.Interpolators;
|
||||
import com.android.systemui.animation.ShadeInterpolation;
|
||||
@@ -593,7 +594,9 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
} else if (progress > 0 && view.getVisibility() != View.VISIBLE) {
|
||||
view.setVisibility((View.VISIBLE));
|
||||
}
|
||||
float alpha = ShadeInterpolation.getContentAlpha(progress);
|
||||
float alpha = (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED)
|
||||
? BouncerPanelExpansionCalculator.getBackScrimScaledExpansion(progress)
|
||||
: ShadeInterpolation.getContentAlpha(progress);
|
||||
view.setAlpha(alpha);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ import android.view.animation.Interpolator;
|
||||
import com.android.internal.jank.InteractionJankMonitor;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.util.LatencyTracker;
|
||||
import com.android.keyguard.BouncerPanelExpansionCalculator;
|
||||
import com.android.systemui.DejankUtils;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.animation.Interpolators;
|
||||
@@ -796,7 +797,10 @@ public abstract class PanelViewController {
|
||||
}
|
||||
mExpandedFraction = Math.min(1f,
|
||||
maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight);
|
||||
mAmbientState.setExpansionFraction(mExpandedFraction);
|
||||
mAmbientState.setExpansionFraction(mKeyguardStateController.isUnlocked()
|
||||
? mExpandedFraction
|
||||
: BouncerPanelExpansionCalculator
|
||||
.getBackScrimScaledExpansion(mExpandedFraction));
|
||||
onHeightUpdated(mExpandedHeight);
|
||||
updatePanelExpansionAndVisibility();
|
||||
});
|
||||
|
||||
@@ -836,14 +836,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
|
||||
private Pair<Integer, Float> calculateBackStateForState(ScrimState state) {
|
||||
// Either darken of make the scrim transparent when you
|
||||
// pull down the shade
|
||||
float interpolatedFract;
|
||||
|
||||
if (state == ScrimState.KEYGUARD) {
|
||||
interpolatedFract = BouncerPanelExpansionCalculator
|
||||
.getBackScrimScaledExpansion(mPanelExpansionFraction);
|
||||
} else {
|
||||
interpolatedFract = getInterpolatedFraction();
|
||||
}
|
||||
float interpolatedFract = getInterpolatedFraction();
|
||||
|
||||
float stateBehind = mClipsQsScrim ? state.getNotifAlpha() : state.getBehindAlpha();
|
||||
float behindAlpha;
|
||||
@@ -1025,6 +1018,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
|
||||
}
|
||||
|
||||
private float getInterpolatedFraction() {
|
||||
if (mState == ScrimState.KEYGUARD || mState == ScrimState.SHADE_LOCKED) {
|
||||
return BouncerPanelExpansionCalculator
|
||||
.getBackScrimScaledExpansion(mPanelExpansionFraction);
|
||||
}
|
||||
return ShadeInterpolation.getNotificationScrimAlpha(mPanelExpansionFraction);
|
||||
}
|
||||
|
||||
|
||||
@@ -1228,8 +1228,8 @@ public class ScrimControllerTest extends SysuiTestCase {
|
||||
public void testNotificationTransparency_followsPanelExpansionInShadeLockedState() {
|
||||
mScrimController.transitionTo(ScrimState.SHADE_LOCKED);
|
||||
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 0.8f, /* expansion */ 0.8f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 0.47f, /* expansion */ 0.2f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 0f, /* expansion */ 0.8f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 0f, /* expansion */ 0.2f);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1242,15 +1242,16 @@ public class ScrimControllerTest extends SysuiTestCase {
|
||||
|
||||
// Verify normal behavior after
|
||||
mScrimController.setUnocclusionAnimationRunning(false);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 0.2f, /* expansion */ 0.4f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 1f, /* expansion */ 0.4f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotificationTransparency_inKeyguardState() {
|
||||
mScrimController.transitionTo(ScrimState.KEYGUARD);
|
||||
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 0.2f, /* expansion */ 0.4f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 0.52f, /* expansion */ 0.2f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 1f, /* expansion */ 0.8f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 1f, /* expansion */ 0.4f);
|
||||
assertAlphaAfterExpansion(mNotificationsScrim, /* alpha */ 1f, /* expansion */ 0.2f);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user