summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Schneider <michschn@google.com>2023-04-03 12:05:58 +0200
committerMike Schneider <michschn@google.com>2023-04-06 05:08:28 +0000
commit975fa6926073bce3d1bb53ac82345c85be079e69 (patch)
tree0780d47a78e33a27c91e73d73e51415d303cfcfe
parent65ac592f4001aa2231b28d54e7196ad606179913 (diff)
downloadLauncher3-975fa6926073bce3d1bb53ac82345c85be079e69.tar.gz
Fade out navbar on lockscreen -> homescreen transition
Introduces a new SYSUI_STATE_STATUS_BAR_KEYGUARD_GOING_AWAY QuickStepContract flag, to get an early signal when the keyguard is going away Bug: 275319714 Test: transitions manual (http://shortn/_ySNBaPFHRZ), existing tapl tests Change-Id: Ie0044ea8e934afa793ca56a4eacc2b776edbdf0e
-rw-r--r--quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java29
1 files changed, 25 insertions, 4 deletions
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 5f117402fb..f675b57267 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -36,6 +36,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_I
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_GOING_AWAY;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -43,6 +44,7 @@ import android.animation.AnimatorSet;
import android.app.RemoteAction;
import android.content.SharedPreferences;
import android.graphics.drawable.Icon;
+import android.os.SystemClock;
import android.util.Log;
import android.view.InsetsController;
import android.view.View;
@@ -187,6 +189,10 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
// Auto stashes when user has not interacted with the Taskbar after X ms.
private static final long NO_TOUCH_TIMEOUT_TO_STASH_MS = 5000;
+ // Duration for which an unlock event is considered "current", as other events are received
+ // asynchronously.
+ private static final long UNLOCK_TRANSITION_MEMOIZATION_MS = 200;
+
/**
* The default stash animation, morphing the taskbar into the navbar.
*/
@@ -951,7 +957,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
updateStateForFlag(FLAG_STASHED_SYSUI,
hasAnyFlag(systemUiStateFlags, SYSUI_STATE_SCREEN_PINNING));
- boolean isLocked = hasAnyFlag(systemUiStateFlags, MASK_ANY_SYSUI_LOCKED);
+ boolean isLocked = hasAnyFlag(systemUiStateFlags, MASK_ANY_SYSUI_LOCKED)
+ && !hasAnyFlag(systemUiStateFlags, SYSUI_STATE_STATUS_BAR_KEYGUARD_GOING_AWAY);
updateStateForFlag(FLAG_STASHED_DEVICE_LOCKED, isLocked);
// Only update FLAG_STASHED_IN_APP_IME when system gesture is not in progress.
@@ -1169,6 +1176,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
private @StashAnimation int mLastStartedTransitionType = TRANSITION_DEFAULT;
private int mPrevFlags;
+ private long mLastUnlockTransitionTimeout = 0;
+
StatePropertyHolder(IntPredicate stashCondition) {
mStashCondition = stashCondition;
}
@@ -1186,7 +1195,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
if (DEBUG) {
String stateString = formatFlagChange(flags, mPrevFlags,
- TaskbarStashController::getStateString);
+ TaskbarStashController::getStateString);
Log.d(TAG, "createSetStateAnimator: flags: " + stateString
+ ", duration: " + duration
+ ", isStashed: " + isStashed
@@ -1199,6 +1208,17 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
mPrevFlags = flags;
}
+ boolean isUnlockTransition = hasAnyFlag(changedFlags, FLAG_STASHED_DEVICE_LOCKED)
+ && !hasAnyFlag(FLAG_STASHED_DEVICE_LOCKED);
+ if (isUnlockTransition) {
+ // the launcher might not be resumed at the time the device is considered
+ // unlocked (when the keyguard goes away), but possibly shortly afterwards.
+ // To play the unlock transition at the time the unstash animation actually happens,
+ // this memoizes the state transition for UNLOCK_TRANSITION_MEMOIZATION_MS.
+ mLastUnlockTransitionTimeout =
+ SystemClock.elapsedRealtime() + UNLOCK_TRANSITION_MEMOIZATION_MS;
+ }
+
@StashAnimation int animationType = computeTransitionType(changedFlags);
// Allow re-starting animation if upgrading from default animation type, otherwise
@@ -1229,6 +1249,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
}
private @StashAnimation int computeTransitionType(int changedFlags) {
+
boolean hotseatHiddenDuringAppLaunch =
!mControllers.uiController.isHotseatIconOnTopWhenAligned()
&& hasAnyFlag(changedFlags, FLAG_IN_APP);
@@ -1240,8 +1261,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
return TRANSITION_HANDLE_FADE;
}
- boolean isUnlockTransition = hasAnyFlag(changedFlags, FLAG_STASHED_DEVICE_LOCKED)
- && !hasAnyFlag(FLAG_STASHED_DEVICE_LOCKED);
+ boolean isUnlockTransition =
+ SystemClock.elapsedRealtime() < mLastUnlockTransitionTimeout;
if (isUnlockTransition) {
// When transitioning to unlocked device, the hotseat will already be visible on
// the homescreen, thus do not play an un-stash animation.