Merge "[View Controllers] (1/3) Move KeyguardStatusBarView's animation methods out of NotificationPanelViewController and into KeyguardStatusBarViewController." into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c1db271def
@@ -34,7 +34,10 @@ public interface KeyguardStatusBarViewComponent {
|
|||||||
/** Simple factory for {@link KeyguardStatusBarViewComponent}. */
|
/** Simple factory for {@link KeyguardStatusBarViewComponent}. */
|
||||||
@Subcomponent.Factory
|
@Subcomponent.Factory
|
||||||
interface Factory {
|
interface Factory {
|
||||||
KeyguardStatusBarViewComponent build(@BindsInstance KeyguardStatusBarView view);
|
KeyguardStatusBarViewComponent build(
|
||||||
|
@BindsInstance KeyguardStatusBarView view,
|
||||||
|
@BindsInstance KeyguardStatusBarViewController.ViewStateProvider
|
||||||
|
viewStateProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Builds a {@link KeyguardStatusViewController}. */
|
/** Builds a {@link KeyguardStatusViewController}. */
|
||||||
|
|||||||
@@ -19,16 +19,21 @@ package com.android.systemui.statusbar.phone;
|
|||||||
import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_IN;
|
import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_IN;
|
||||||
import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_OUT;
|
import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_OUT;
|
||||||
|
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.android.keyguard.CarrierTextController;
|
import com.android.keyguard.CarrierTextController;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.animation.Interpolators;
|
||||||
import com.android.systemui.battery.BatteryMeterViewController;
|
import com.android.systemui.battery.BatteryMeterViewController;
|
||||||
import com.android.systemui.statusbar.events.SystemStatusAnimationCallback;
|
import com.android.systemui.statusbar.events.SystemStatusAnimationCallback;
|
||||||
import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
|
import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
|
||||||
|
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
|
||||||
import com.android.systemui.statusbar.policy.BatteryController;
|
import com.android.systemui.statusbar.policy.BatteryController;
|
||||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||||
import com.android.systemui.statusbar.policy.UserInfoController;
|
import com.android.systemui.statusbar.policy.UserInfoController;
|
||||||
@@ -52,6 +57,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
|
|||||||
private final StatusBarIconController mStatusBarIconController;
|
private final StatusBarIconController mStatusBarIconController;
|
||||||
private final StatusBarIconController.TintedIconManager.Factory mTintedIconManagerFactory;
|
private final StatusBarIconController.TintedIconManager.Factory mTintedIconManagerFactory;
|
||||||
private final BatteryMeterViewController mBatteryMeterViewController;
|
private final BatteryMeterViewController mBatteryMeterViewController;
|
||||||
|
private final ViewStateProvider mViewStateProvider;
|
||||||
|
|
||||||
private final ConfigurationController.ConfigurationListener mConfigurationListener =
|
private final ConfigurationController.ConfigurationListener mConfigurationListener =
|
||||||
new ConfigurationController.ConfigurationListener() {
|
new ConfigurationController.ConfigurationListener() {
|
||||||
@@ -103,11 +109,19 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
|
|||||||
private final UserInfoController.OnUserInfoChangedListener mOnUserInfoChangedListener =
|
private final UserInfoController.OnUserInfoChangedListener mOnUserInfoChangedListener =
|
||||||
(name, picture, userAccount) -> mView.onUserInfoChanged(picture);
|
(name, picture, userAccount) -> mView.onUserInfoChanged(picture);
|
||||||
|
|
||||||
|
private final ValueAnimator.AnimatorUpdateListener mAnimatorUpdateListener =
|
||||||
|
animation -> {
|
||||||
|
mKeyguardStatusBarAnimateAlpha = (float) animation.getAnimatedValue();
|
||||||
|
updateViewState();
|
||||||
|
};
|
||||||
|
|
||||||
private final List<String> mBlockedIcons;
|
private final List<String> mBlockedIcons;
|
||||||
|
|
||||||
private boolean mBatteryListening;
|
private boolean mBatteryListening;
|
||||||
private StatusBarIconController.TintedIconManager mTintedIconManager;
|
private StatusBarIconController.TintedIconManager mTintedIconManager;
|
||||||
|
|
||||||
|
private float mKeyguardStatusBarAnimateAlpha = 1f;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public KeyguardStatusBarViewController(
|
public KeyguardStatusBarViewController(
|
||||||
KeyguardStatusBarView view,
|
KeyguardStatusBarView view,
|
||||||
@@ -118,7 +132,8 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
|
|||||||
UserInfoController userInfoController,
|
UserInfoController userInfoController,
|
||||||
StatusBarIconController statusBarIconController,
|
StatusBarIconController statusBarIconController,
|
||||||
StatusBarIconController.TintedIconManager.Factory tintedIconManagerFactory,
|
StatusBarIconController.TintedIconManager.Factory tintedIconManagerFactory,
|
||||||
BatteryMeterViewController batteryMeterViewController) {
|
BatteryMeterViewController batteryMeterViewController,
|
||||||
|
ViewStateProvider viewStateProvider) {
|
||||||
super(view);
|
super(view);
|
||||||
mCarrierTextController = carrierTextController;
|
mCarrierTextController = carrierTextController;
|
||||||
mConfigurationController = configurationController;
|
mConfigurationController = configurationController;
|
||||||
@@ -128,6 +143,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
|
|||||||
mStatusBarIconController = statusBarIconController;
|
mStatusBarIconController = statusBarIconController;
|
||||||
mTintedIconManagerFactory = tintedIconManagerFactory;
|
mTintedIconManagerFactory = tintedIconManagerFactory;
|
||||||
mBatteryMeterViewController = batteryMeterViewController;
|
mBatteryMeterViewController = batteryMeterViewController;
|
||||||
|
mViewStateProvider = viewStateProvider;
|
||||||
|
|
||||||
Resources r = getResources();
|
Resources r = getResources();
|
||||||
mBlockedIcons = Collections.unmodifiableList(Arrays.asList(
|
mBlockedIcons = Collections.unmodifiableList(Arrays.asList(
|
||||||
@@ -205,6 +221,49 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
|
|||||||
mView.setTopClipping(notificationPanelTop - mView.getTop());
|
mView.setTopClipping(notificationPanelTop - mView.getTop());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Animate the keyguard status bar in. */
|
||||||
|
public void animateKeyguardStatusBarIn() {
|
||||||
|
mView.setVisibility(View.VISIBLE);
|
||||||
|
mView.setAlpha(0f);
|
||||||
|
ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
|
||||||
|
anim.addUpdateListener(mAnimatorUpdateListener);
|
||||||
|
anim.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
|
||||||
|
anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
|
||||||
|
anim.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Animate the keyguard status bar out. */
|
||||||
|
public void animateKeyguardStatusBarOut(long startDelay, long duration) {
|
||||||
|
ValueAnimator anim = ValueAnimator.ofFloat(mView.getAlpha(), 0f);
|
||||||
|
anim.addUpdateListener(mAnimatorUpdateListener);
|
||||||
|
anim.setStartDelay(startDelay);
|
||||||
|
anim.setDuration(duration);
|
||||||
|
anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
|
||||||
|
anim.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
mView.setVisibility(View.INVISIBLE);
|
||||||
|
mView.setAlpha(1f);
|
||||||
|
mKeyguardStatusBarAnimateAlpha = 1f;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
anim.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the {@link KeyguardStatusBarView} state based on what the {@link ViewStateProvider}
|
||||||
|
* provides.
|
||||||
|
*/
|
||||||
|
public void updateViewState() {
|
||||||
|
ViewState newViewState = mViewStateProvider.provideViewState();
|
||||||
|
if (!newViewState.mShouldUpdate) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateViewState(
|
||||||
|
newViewState.mAlpha * mKeyguardStatusBarAnimateAlpha,
|
||||||
|
newViewState.mVisibility);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the {@link KeyguardStatusBarView} state based on the provided values.
|
* Updates the {@link KeyguardStatusBarView} state based on the provided values.
|
||||||
*/
|
*/
|
||||||
@@ -219,4 +278,23 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
|
|||||||
pw.println(" mBatteryListening: " + mBatteryListening);
|
pw.println(" mBatteryListening: " + mBatteryListening);
|
||||||
mView.dump(fd, pw, args);
|
mView.dump(fd, pw, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** An interface that provides the desired state of {@link KeyguardStatusBarView}. */
|
||||||
|
public interface ViewStateProvider {
|
||||||
|
/** Provides the state. */
|
||||||
|
ViewState provideViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A POJO for the desired state of {@link KeyguardStatusBarView}. */
|
||||||
|
static class ViewState {
|
||||||
|
final boolean mShouldUpdate;
|
||||||
|
final float mAlpha;
|
||||||
|
final int mVisibility;
|
||||||
|
|
||||||
|
ViewState(boolean shouldUpdate, float alpha, int visibility) {
|
||||||
|
this.mShouldUpdate = shouldUpdate;
|
||||||
|
this.mAlpha = alpha;
|
||||||
|
this.mVisibility = visibility;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
&& !mDelayShowingKeyguardStatusBar
|
&& !mDelayShowingKeyguardStatusBar
|
||||||
&& !mBiometricUnlockController.isBiometricUnlock()) {
|
&& !mBiometricUnlockController.isBiometricUnlock()) {
|
||||||
mFirstBypassAttempt = false;
|
mFirstBypassAttempt = false;
|
||||||
animateKeyguardStatusBarIn(StackStateAnimator.ANIMATION_DURATION_STANDARD);
|
mKeyguardStatusBarViewController.animateKeyguardStatusBarIn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,7 +432,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
private boolean mQsTouchAboveFalsingThreshold;
|
private boolean mQsTouchAboveFalsingThreshold;
|
||||||
private int mQsFalsingThreshold;
|
private int mQsFalsingThreshold;
|
||||||
|
|
||||||
private float mKeyguardStatusBarAnimateAlpha = 1f;
|
|
||||||
private HeadsUpTouchHelper mHeadsUpTouchHelper;
|
private HeadsUpTouchHelper mHeadsUpTouchHelper;
|
||||||
private boolean mListenForHeadsUp;
|
private boolean mListenForHeadsUp;
|
||||||
private int mNavigationBarBottomHeight;
|
private int mNavigationBarBottomHeight;
|
||||||
@@ -683,6 +682,27 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private final KeyguardStatusBarViewController.ViewStateProvider mViewStateProvider =
|
||||||
|
new KeyguardStatusBarViewController.ViewStateProvider() {
|
||||||
|
@Override
|
||||||
|
public KeyguardStatusBarViewController.ViewState provideViewState() {
|
||||||
|
float alphaQsExpansion = 1 - Math.min(1, computeQsExpansionFraction() * 2);
|
||||||
|
float newAlpha = Math.min(getKeyguardContentsAlpha(), alphaQsExpansion)
|
||||||
|
* (1.0f - mKeyguardHeadsUpShowingAmount);
|
||||||
|
|
||||||
|
boolean hideForBypass =
|
||||||
|
mFirstBypassAttempt && mUpdateMonitor.shouldListenForFace()
|
||||||
|
|| mDelayShowingKeyguardStatusBar;
|
||||||
|
int newVisibility = newAlpha != 0f && !mDozing && !hideForBypass
|
||||||
|
? View.VISIBLE : View.INVISIBLE;
|
||||||
|
|
||||||
|
return new KeyguardStatusBarViewController.ViewState(
|
||||||
|
/* shouldAnimate= */ mKeyguardShowing,
|
||||||
|
newAlpha,
|
||||||
|
newVisibility);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public NotificationPanelViewController(NotificationPanelView view,
|
public NotificationPanelViewController(NotificationPanelView view,
|
||||||
@Main Resources resources,
|
@Main Resources resources,
|
||||||
@@ -884,7 +904,9 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mKeyguardStatusBarViewController =
|
mKeyguardStatusBarViewController =
|
||||||
mKeyguardStatusBarViewComponentFactory.build(mKeyguardStatusBar)
|
mKeyguardStatusBarViewComponentFactory.build(
|
||||||
|
mKeyguardStatusBar,
|
||||||
|
mViewStateProvider)
|
||||||
.getKeyguardStatusBarViewController();
|
.getKeyguardStatusBarViewController();
|
||||||
mKeyguardStatusBarViewController.init();
|
mKeyguardStatusBarViewController.init();
|
||||||
|
|
||||||
@@ -2160,59 +2182,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Runnable mAnimateKeyguardStatusBarInvisibleEndRunnable = new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mKeyguardStatusBar.setVisibility(View.INVISIBLE);
|
|
||||||
mKeyguardStatusBar.setAlpha(1f);
|
|
||||||
mKeyguardStatusBarAnimateAlpha = 1f;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private void animateKeyguardStatusBarOut() {
|
|
||||||
ValueAnimator anim = ValueAnimator.ofFloat(mKeyguardStatusBar.getAlpha(), 0f);
|
|
||||||
anim.addUpdateListener(mStatusBarAnimateAlphaListener);
|
|
||||||
anim.setStartDelay(mKeyguardStateController.isKeyguardFadingAway()
|
|
||||||
? mKeyguardStateController.getKeyguardFadingAwayDelay() : 0);
|
|
||||||
|
|
||||||
long duration;
|
|
||||||
if (mKeyguardStateController.isKeyguardFadingAway()) {
|
|
||||||
duration = mKeyguardStateController.getShortenedFadingAwayDuration();
|
|
||||||
} else {
|
|
||||||
duration = StackStateAnimator.ANIMATION_DURATION_STANDARD;
|
|
||||||
}
|
|
||||||
anim.setDuration(duration);
|
|
||||||
|
|
||||||
anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
|
|
||||||
anim.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
mAnimateKeyguardStatusBarInvisibleEndRunnable.run();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
anim.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private final ValueAnimator.AnimatorUpdateListener
|
|
||||||
mStatusBarAnimateAlphaListener =
|
|
||||||
new ValueAnimator.AnimatorUpdateListener() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationUpdate(ValueAnimator animation) {
|
|
||||||
mKeyguardStatusBarAnimateAlpha = (float) animation.getAnimatedValue();
|
|
||||||
updateHeaderKeyguardAlpha();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private void animateKeyguardStatusBarIn(long duration) {
|
|
||||||
mKeyguardStatusBar.setVisibility(View.VISIBLE);
|
|
||||||
mKeyguardStatusBar.setAlpha(0f);
|
|
||||||
ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
|
|
||||||
anim.addUpdateListener(mStatusBarAnimateAlphaListener);
|
|
||||||
anim.setDuration(duration);
|
|
||||||
anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
|
|
||||||
anim.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Runnable mAnimateKeyguardBottomAreaInvisibleEndRunnable = new Runnable() {
|
private final Runnable mAnimateKeyguardBottomAreaInvisibleEndRunnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -2265,7 +2234,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
mQsExpansionHeight = height;
|
mQsExpansionHeight = height;
|
||||||
updateQsExpansion();
|
updateQsExpansion();
|
||||||
requestScrollerTopPaddingUpdate(false /* animate */);
|
requestScrollerTopPaddingUpdate(false /* animate */);
|
||||||
updateHeaderKeyguardAlpha();
|
mKeyguardStatusBarViewController.updateViewState();
|
||||||
if (mBarState == StatusBarState.SHADE_LOCKED || mBarState == KEYGUARD) {
|
if (mBarState == StatusBarState.SHADE_LOCKED || mBarState == KEYGUARD) {
|
||||||
updateKeyguardBottomAreaAlpha();
|
updateKeyguardBottomAreaAlpha();
|
||||||
positionClockAndNotifications();
|
positionClockAndNotifications();
|
||||||
@@ -2989,7 +2958,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
*/
|
*/
|
||||||
private void updateHeader() {
|
private void updateHeader() {
|
||||||
if (mBarState == KEYGUARD) {
|
if (mBarState == KEYGUARD) {
|
||||||
updateHeaderKeyguardAlpha();
|
mKeyguardStatusBarViewController.updateViewState();
|
||||||
}
|
}
|
||||||
updateQsExpansion();
|
updateQsExpansion();
|
||||||
}
|
}
|
||||||
@@ -3037,23 +3006,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
return alpha;
|
return alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateHeaderKeyguardAlpha() {
|
|
||||||
if (!mKeyguardShowing) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
float alphaQsExpansion = 1 - Math.min(1, computeQsExpansionFraction() * 2);
|
|
||||||
float newAlpha = Math.min(getKeyguardContentsAlpha(), alphaQsExpansion)
|
|
||||||
* mKeyguardStatusBarAnimateAlpha;
|
|
||||||
newAlpha *= 1.0f - mKeyguardHeadsUpShowingAmount;
|
|
||||||
mKeyguardStatusBar.setAlpha(newAlpha);
|
|
||||||
boolean
|
|
||||||
hideForBypass =
|
|
||||||
mFirstBypassAttempt && mUpdateMonitor.shouldListenForFace()
|
|
||||||
|| mDelayShowingKeyguardStatusBar;
|
|
||||||
mKeyguardStatusBar.setVisibility(
|
|
||||||
newAlpha != 0f && !mDozing && !hideForBypass ? View.VISIBLE : View.INVISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateKeyguardBottomAreaAlpha() {
|
private void updateKeyguardBottomAreaAlpha() {
|
||||||
// There are two possible panel expansion behaviors:
|
// There are two possible panel expansion behaviors:
|
||||||
// • User dragging up to unlock: we want to fade out as quick as possible
|
// • User dragging up to unlock: we want to fade out as quick as possible
|
||||||
@@ -3280,7 +3232,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
private void updateDozingVisibilities(boolean animate) {
|
private void updateDozingVisibilities(boolean animate) {
|
||||||
mKeyguardBottomArea.setDozing(mDozing, animate);
|
mKeyguardBottomArea.setDozing(mDozing, animate);
|
||||||
if (!mDozing && animate) {
|
if (!mDozing && animate) {
|
||||||
animateKeyguardStatusBarIn(StackStateAnimator.ANIMATION_DURATION_STANDARD);
|
mKeyguardStatusBarViewController.animateKeyguardStatusBarIn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3367,7 +3319,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
|
|
||||||
private void setKeyguardHeadsUpShowingAmount(float amount) {
|
private void setKeyguardHeadsUpShowingAmount(float amount) {
|
||||||
mKeyguardHeadsUpShowingAmount = amount;
|
mKeyguardHeadsUpShowingAmount = amount;
|
||||||
updateHeaderKeyguardAlpha();
|
mKeyguardStatusBarViewController.updateViewState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getKeyguardHeadsUpShowingAmount() {
|
private float getKeyguardHeadsUpShowingAmount() {
|
||||||
@@ -4463,11 +4415,22 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
|
|
||||||
if (oldState == KEYGUARD && (goingToFullShade
|
if (oldState == KEYGUARD && (goingToFullShade
|
||||||
|| statusBarState == StatusBarState.SHADE_LOCKED)) {
|
|| statusBarState == StatusBarState.SHADE_LOCKED)) {
|
||||||
animateKeyguardStatusBarOut();
|
|
||||||
|
long startDelay;
|
||||||
|
long duration;
|
||||||
|
if (mKeyguardStateController.isKeyguardFadingAway()) {
|
||||||
|
startDelay = mKeyguardStateController.getKeyguardFadingAwayDelay();
|
||||||
|
duration = mKeyguardStateController.getShortenedFadingAwayDuration();
|
||||||
|
} else {
|
||||||
|
startDelay = 0;
|
||||||
|
duration = StackStateAnimator.ANIMATION_DURATION_STANDARD;
|
||||||
|
}
|
||||||
|
mKeyguardStatusBarViewController.animateKeyguardStatusBarOut(startDelay, duration);
|
||||||
updateQSMinHeight();
|
updateQSMinHeight();
|
||||||
} else if (oldState == StatusBarState.SHADE_LOCKED
|
} else if (oldState == StatusBarState.SHADE_LOCKED
|
||||||
&& statusBarState == KEYGUARD) {
|
&& statusBarState == KEYGUARD) {
|
||||||
animateKeyguardStatusBarIn(StackStateAnimator.ANIMATION_DURATION_STANDARD);
|
mKeyguardStatusBarViewController.animateKeyguardStatusBarIn();
|
||||||
|
|
||||||
mNotificationStackScrollLayoutController.resetScrollPosition();
|
mNotificationStackScrollLayoutController.resetScrollPosition();
|
||||||
// Only animate header if the header is visible. If not, it will partially
|
// Only animate header if the header is visible. If not, it will partially
|
||||||
// animate out
|
// animate out
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase {
|
|||||||
private FeatureFlags mFeatureFlags;
|
private FeatureFlags mFeatureFlags;
|
||||||
@Mock
|
@Mock
|
||||||
private BatteryMeterViewController mBatteryMeterViewController;
|
private BatteryMeterViewController mBatteryMeterViewController;
|
||||||
|
@Mock
|
||||||
|
private KeyguardStatusBarViewController.ViewStateProvider mViewStateProvider;
|
||||||
|
|
||||||
private KeyguardStatusBarView mKeyguardStatusBarView;
|
private KeyguardStatusBarView mKeyguardStatusBarView;
|
||||||
private KeyguardStatusBarViewController mController;
|
private KeyguardStatusBarViewController mController;
|
||||||
@@ -89,7 +91,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase {
|
|||||||
mUserInfoController,
|
mUserInfoController,
|
||||||
mStatusBarIconController,
|
mStatusBarIconController,
|
||||||
new StatusBarIconController.TintedIconManager.Factory(mFeatureFlags),
|
new StatusBarIconController.TintedIconManager.Factory(mFeatureFlags),
|
||||||
mBatteryMeterViewController
|
mBatteryMeterViewController,
|
||||||
|
mViewStateProvider
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
.thenReturn(mKeyguardClockSwitchController);
|
.thenReturn(mKeyguardClockSwitchController);
|
||||||
when(mKeyguardStatusViewComponent.getKeyguardStatusViewController())
|
when(mKeyguardStatusViewComponent.getKeyguardStatusViewController())
|
||||||
.thenReturn(mKeyguardStatusViewController);
|
.thenReturn(mKeyguardStatusViewController);
|
||||||
when(mKeyguardStatusBarViewComponentFactory.build(any()))
|
when(mKeyguardStatusBarViewComponentFactory.build(any(), any()))
|
||||||
.thenReturn(mKeyguardStatusBarViewComponent);
|
.thenReturn(mKeyguardStatusBarViewComponent);
|
||||||
when(mKeyguardStatusBarViewComponent.getKeyguardStatusBarViewController())
|
when(mKeyguardStatusBarViewComponent.getKeyguardStatusBarViewController())
|
||||||
.thenReturn(mKeyguardStatusBarViewController);
|
.thenReturn(mKeyguardStatusBarViewController);
|
||||||
|
|||||||
Reference in New Issue
Block a user