Desktop Mode Taskbar Recreate Animation
This Cl includes
- addition of entry/exit callback methods in DesktopVisibilityController.
- taskbar manager now listens to desktop mode changes.
- TaskbarBackrgroundRedererer can now individually animation backgrounds for transient and persistent taskbars
- new channel for taskbar icon alpha added to TaskbarViewController
- new animated float to handle background alpha while we are recreating taskbar with animation.
Solution:
we use the callabck we get from DekstopVisibilty for entry/exit to first change logic of when we are considered inDesktopMode. Upon entry/exit we notify display controller for info change.
we also at notify taskbar manager who is now a listener to the desktop mode change and start the recreate process. TaskbarManager first animates existing taskbar out of user view and then follows the original recreate flow.
Test: Presubmit
Bug: 343882478
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: Ib827564cacd194f499e7d9b1965e2bb13e3548ab
This commit is contained in:
1 parent
332c329276
commit
8b2e5eff9b
19 files changed
+458
-86
No files matched your search
@@ -99,10 +99,11 @@ public class DisplayController implements ComponentCallbacks,
|
||||
public static final int CHANGE_NAVIGATION_MODE = 1 << 4;
|
||||
public static final int CHANGE_TASKBAR_PINNING = 1 << 5;
|
||||
public static final int CHANGE_DESKTOP_MODE = 1 << 6;
|
||||
public static final int CHANGE_SHOW_LOCKED_TASKBAR = 1 << 7;
|
||||
|
||||
public static final int CHANGE_ALL = CHANGE_ACTIVE_SCREEN | CHANGE_ROTATION
|
||||
| CHANGE_DENSITY | CHANGE_SUPPORTED_BOUNDS | CHANGE_NAVIGATION_MODE
|
||||
| CHANGE_TASKBAR_PINNING | CHANGE_DESKTOP_MODE;
|
||||
| CHANGE_TASKBAR_PINNING | CHANGE_DESKTOP_MODE | CHANGE_SHOW_LOCKED_TASKBAR;
|
||||
|
||||
private static final String ACTION_OVERLAY_CHANGED = "android.intent.action.OVERLAY_CHANGED";
|
||||
private static final String TARGET_OVERLAY_PACKAGE = "android";
|
||||
@@ -211,6 +212,13 @@ public class DisplayController implements ComponentCallbacks,
|
||||
return INSTANCE.get(context).getInfo().isPinnedTaskbar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the taskbar is pinned in gesture navigation mode.
|
||||
*/
|
||||
public static boolean isInDesktopMode(Context context) {
|
||||
return INSTANCE.get(context).getInfo().isInDesktopMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the taskbar is forced to be pinned when home is visible.
|
||||
*/
|
||||
@@ -335,6 +343,9 @@ public class DisplayController implements ComponentCallbacks,
|
||||
if (newInfo.mIsInDesktopMode != oldInfo.mIsInDesktopMode) {
|
||||
change |= CHANGE_DESKTOP_MODE;
|
||||
}
|
||||
if (newInfo.mShowLockedTaskbarOnHome != oldInfo.mShowLockedTaskbarOnHome) {
|
||||
change |= CHANGE_SHOW_LOCKED_TASKBAR;
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "handleInfoChange - change: " + getChangeFlagsString(change));
|
||||
@@ -493,6 +504,13 @@ public class DisplayController implements ComponentCallbacks,
|
||||
return navigationMode == NavigationMode.NO_BUTTON && !isTransientTaskbar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the taskbar is in desktop mode.
|
||||
*/
|
||||
public boolean isInDesktopMode() {
|
||||
return mIsInDesktopMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the bounds represent a tablet.
|
||||
*/
|
||||
@@ -575,6 +593,7 @@ public class DisplayController implements ComponentCallbacks,
|
||||
appendFlag(result, change, CHANGE_NAVIGATION_MODE, "CHANGE_NAVIGATION_MODE");
|
||||
appendFlag(result, change, CHANGE_TASKBAR_PINNING, "CHANGE_TASKBAR_VARIANT");
|
||||
appendFlag(result, change, CHANGE_DESKTOP_MODE, "CHANGE_DESKTOP_MODE");
|
||||
appendFlag(result, change, CHANGE_SHOW_LOCKED_TASKBAR, "CHANGE_SHOW_LOCKED_TASKBAR");
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@@ -592,6 +611,7 @@ public class DisplayController implements ComponentCallbacks,
|
||||
pw.println(" isTaskbarPinned=" + info.mIsTaskbarPinned);
|
||||
pw.println(" isTaskbarPinnedInDesktopMode=" + info.mIsTaskbarPinnedInDesktopMode);
|
||||
pw.println(" isInDesktopMode=" + info.mIsInDesktopMode);
|
||||
pw.println(" showLockedTaskbarOnHome=" + info.showLockedTaskbarOnHome());
|
||||
pw.println(" currentSize=" + info.currentSize);
|
||||
info.mPerDisplayBounds.forEach((key, value) -> pw.println(
|
||||
" perDisplayBounds - " + key + ": " + value));
|
||||
|
||||
Reference in new issue
Block a user