Support Desktop unminimize animations, and move app-state logic
- Support Desktop unminimize animations through
1. keyboard alt-tab shortcut
2. taskbar hotseat icon click (TaskItemInfo)
3. taskbar running-app icon click (GroupTask)
- move taskbar running-app state logic from TaskbarViewController to
TaskbarRecentAppsController.
Test: manual - ensure the transitions above cause unminimize animations
Bug: 369966334
Flag: com.android.window.flags.enable_desktop_app_launch_alttab_transitions
Change-Id: I20322bdf58bc69cff360bf26e533e0732d5297b9
This commit is contained in:
@@ -623,12 +623,10 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
|
||||
* Updates which icons are marked as running or minimized given the Sets of currently running
|
||||
* and minimized tasks.
|
||||
*/
|
||||
public void updateIconViewsRunningStates(Set<Integer> runningTaskIds,
|
||||
Set<Integer> minimizedTaskIds) {
|
||||
public void updateIconViewsRunningStates() {
|
||||
for (View iconView : getIconViews()) {
|
||||
if (iconView instanceof BubbleTextView btv) {
|
||||
btv.updateRunningState(
|
||||
getRunningAppState(btv, runningTaskIds, minimizedTaskIds));
|
||||
btv.updateRunningState(getRunningAppState(btv));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -651,26 +649,15 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
|
||||
return pinnedAppsWithTasks;
|
||||
}
|
||||
|
||||
private BubbleTextView.RunningAppState getRunningAppState(
|
||||
BubbleTextView btv,
|
||||
Set<Integer> runningTaskIds,
|
||||
Set<Integer> minimizedTaskIds) {
|
||||
private BubbleTextView.RunningAppState getRunningAppState(BubbleTextView btv) {
|
||||
Object tag = btv.getTag();
|
||||
if (tag instanceof TaskItemInfo itemInfo) {
|
||||
if (minimizedTaskIds.contains(itemInfo.getTaskId())) {
|
||||
return BubbleTextView.RunningAppState.MINIMIZED;
|
||||
}
|
||||
if (runningTaskIds.contains(itemInfo.getTaskId())) {
|
||||
return BubbleTextView.RunningAppState.RUNNING;
|
||||
}
|
||||
return mControllers.taskbarRecentAppsController.getRunningAppState(
|
||||
itemInfo.getTaskId());
|
||||
}
|
||||
if (tag instanceof GroupTask groupTask && !groupTask.hasMultipleTasks()) {
|
||||
if (minimizedTaskIds.contains(groupTask.task1.key.id)) {
|
||||
return BubbleTextView.RunningAppState.MINIMIZED;
|
||||
}
|
||||
if (runningTaskIds.contains(groupTask.task1.key.id)) {
|
||||
return BubbleTextView.RunningAppState.RUNNING;
|
||||
}
|
||||
return mControllers.taskbarRecentAppsController.getRunningAppState(
|
||||
groupTask.task1.key.id);
|
||||
}
|
||||
return BubbleTextView.RunningAppState.NOT_RUNNING;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user