Improve quick switch from home to taskbar
- Add LauncherState#isTaskbarAlignedWithHotseat() which defaults to !isTaskbarStashed(), but is always false for quick switch from home
- Replaced FLAG_TRANSITION_STATE_START_STASHED and FLAG_TRANSITION_STATE_COMMITTED_STASHED with FLAG_STATE_TRANSITION_RUNNING and a reference to mLauncherState. STATE_START is equivalent to TRANSITION_RUNNING changing to true, and STATE_COMMITTED is equivalent to TRANSITION_RUNNING changing to false. Then can get details from the state such as whether taskbar is stashed and icon alignment from mLauncherState
Test: quick switch from home, both with taskbar stashed in apps and not
Fixes: 194728611
Bug: 204657916
Change-Id: I6cf84ec73a4036e14cc7268667c6f62100884c27
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 15378e0..215b4ef 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -197,10 +197,16 @@
return (getVisibleElements(launcher) & elements) == elements;
}
- public boolean isTaskbarStashed() {
+ /** Returns whether taskbar is stashed and thus should replace hotseat with a handle */
+ public boolean isTaskbarStashed(Launcher launcher) {
return false;
}
+ /** Returns whether taskbar is aligned with the hotseat vs position inside apps */
+ public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
+ return !isTaskbarStashed(launcher);
+ }
+
/**
* Fraction shift in the vertical translation UI and related properties
*