Add animations to Manage Windows menu in Taskbar
This change switches to using animations to open and close the Manage
Windows view is the multi instance menu of Taskbar. Previously the view
would just appear and disappear, but this makes it smoother.
Fix: 380921297
Bug: 315989246
Test: Open and close the Manage Windows view and observe the motion
Flag: com.android.launcher3.enable_multi_instance_menu_taskbar
Change-Id: I9fb85d4a3ee437bed53991aac7a240d536478f4b
diff --git a/quickstep/src/com/android/launcher3/taskbar/ManageWindowsTaskbarShortcut.kt b/quickstep/src/com/android/launcher3/taskbar/ManageWindowsTaskbarShortcut.kt
index c0c2a02..8727131 100644
--- a/quickstep/src/com/android/launcher3/taskbar/ManageWindowsTaskbarShortcut.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/ManageWindowsTaskbarShortcut.kt
@@ -113,13 +113,13 @@
private fun createAndPositionTaskbarShortcut(taskList: ArrayList<Pair<Int, Bitmap?>>) {
val onIconClickListener =
({ taskId: Int? ->
- taskbarShortcutAllWindowsView.removeFromContainer()
+ taskbarShortcutAllWindowsView.animateClose()
if (taskId != null) {
SystemUiProxy.INSTANCE.get(target).showDesktopApp(taskId, null)
}
})
- val onOutsideClickListener = { taskbarShortcutAllWindowsView.removeFromContainer() }
+ val onOutsideClickListener = { taskbarShortcutAllWindowsView.animateClose() }
taskbarShortcutAllWindowsView =
TaskbarShortcutManageWindowsView(
@@ -156,6 +156,7 @@
init {
createAndShowMenuView(snapshotList, onIconClickListener, onOutsideClickListener)
taskbarOverlayContext.dragLayer.addTouchController(this)
+ animateOpen()
}
/** Adds the carousel menu to the taskbar overlay drag layer */
@@ -230,7 +231,7 @@
ev.action == MotionEvent.ACTION_DOWN &&
!taskbarOverlayContext.dragLayer.isEventOverView(menuView.rootView, ev)
) {
- removeFromContainer()
+ animateClose()
}
}
return false