Commit Graph

45 Commits

Author SHA1 Message Date
Alex Chau
84ba9fb5fe Revert "Revert "Add debug logs for hotseat disapperaed bug""
This reverts commit f4269f01d7.

Reason for revert: bug re-opened
Bug: 260135164

Change-Id: I818cc3f66c55148a4fbd19714adb25d7d4a0d39e
2023-01-30 19:29:45 +00:00
Alex Chau
f4269f01d7 Revert "Add debug logs for hotseat disapperaed bug"
This reverts commit 04658bcd42.

Reason for revert: root cause found
Bug: 260135164

Change-Id: I809662780d042923de015ff4cb810b3da5169f83
2023-01-12 22:21:07 +00:00
Alex Chau
04658bcd42 Add debug logs for hotseat disapperaed bug
Bug: 260135164
Test: manual
Change-Id: Ic911ba0353b742feb753024543ca19930f11b47d
2023-01-09 12:43:16 +00:00
Federico Baron
47d81686e6 Move AnimatedFloat from quickstep to launcher
We are moving AnimatedFloat to launcher to be able to use this in class in launcher. Having it in launcher will allow us to do restore icon treatment animations to do with scaling the icon size

Bug: 254858049
Test: verified that the device still works
Change-Id: I1c4c47ab436c389a94abf7c910c1a44724efc955
2022-12-08 13:58:07 -08:00
Alex Chau
cd76ac24b6 Fade in/out taskbar when launching apps from or back to AllApps/-1
- Added isHotseatIconTopWhenAligned to control both iconAlignment and stash animation to just fade in if hotseat icon isn't on top of the screen in the aligned state

Fix: 257355864
Fix: 213455090
Test: Launch apps from/back to home, taskbar animate from/to hotseat
Test: Launch apps from/back to AllApps/-1, taskbar fade in/out
Test: Repeat aboth with transient or persistent taskbar
Change-Id: I6bdae615ff9e199d23cbfe2d26c8d46a08fbc436
2022-12-01 18:56:30 +00:00
Brian Isganitis
9390b500a9 Only allow one TaskbarRecentsAnimationsListener at a time.
If another animation is created while one is occurring, we should clean
up the previous one.

Test: Manual
Fix: 233868461
Change-Id: Idf0e33ae95cbf19741ee943e450d478b1e18716b
2022-11-18 00:02:53 +00:00
Vinit Nayak
eae4c99434 Prevent dropping a drag from TaskbarAllApps in Overview
* Don't close TaskbarAllApps once drag starts
(see comment in code regarding needing multiple shared drag
layers)
* Hide app menu split options for taskbar in overview
* One TODO is that the animation needs to be tweaked
because the scale of the icon when it's returned is too large.
* I think maybe we have to change the
TaskbarDragController#mDragIconSize since that gets directly
set from a resource. Unclear.

Test: Dragged in TaskbarAllApps in overivew and in split
select, app returned to original position and not taskbar
Bug: 251747761

Change-Id: I785f34b0bdb0b0abfc440450494074f8dfe7c31a
2022-11-10 16:17:26 -08:00
Alex Chau
68e7fe6b7d Change taskbar corner roundness when entering overview
- Roundness will be 0 in Launcher, and 1 in an app

Bug: 250645563
Test: With and without taskbar in overview, switch between home/overview/app and observe the round corners above taskbar
Test: Ensure corner above taskbar is correct in overview and in app when chat bubble is active
Change-Id: I1f4911626c8e79fce8d81a76a9bd0d0670d111da
2022-11-07 12:58:47 +00:00
Sunny Goyal
774dcd06ae Relying on the controller state instead of animator state for
icon alignment

Bug: 246644619
Test: Presubmit
Change-Id: Iaa4ddd94a6d85acb9f8501263665ea78394815de
2022-11-03 13:42:09 -07:00
Vinit Nayak
406bc6f247 Disable Drag from Taskbar in Overview
* Still need to disable drag from all apps in overview
* Disallow any taskbar icon long click when in split select

Bug: 251747761
Test: Drag from hotseat and predicted icons in overview,
snaps back to position

Change-Id: Ib9b068e4914b9197614c8e8f49b7899bb964f92b
2022-11-01 16:29:28 -07:00
Sunny Goyal
d859060860 Merging MultiValueAlpha with MultiPropertyFactory
Bug: 246644619
Test: Presubmi
Change-Id: Id5abc5f3169544656f1139ae17ca59e34ac65dac
2022-10-24 14:38:18 -07:00
Alex Chau
58bc281142 Refactor TaskbarLauncherStateController to use a single AnimatedFLoat
- Use a single iconAlignment animation
- Introduced isInLauncher/goingToLauncher/FLAGS_LAUNCHER as combined FLAG_RESUMED|FLAG_RECENTS_ANIMATION_RUNNING
- iconAlignment is now centralized in onStateChangeApplied with single source of truth

Bug: 245320601
Test: Home<->Overview, Home<->App, App<->Overview, Home->Overview->App->Home, Home->App->Overview->Home, Overview->Home->App->Overview, Overview->App->Home->Overview, App->Overview->Home->App, App->Home->Overview->App
Test: Go to AllApps, call KEYCODE_HOME, go to app and taskbar should be there
Test: App->Overview->Select->Home->App
Test: QuickSwitch -> App
Test: Repeat above with taskbarStashed on/off
Test: Repeat above with gesture and 3-button
Change-Id: Ie51b602394c155aca060a84585eb0e677e23425c
2022-10-03 11:24:00 +01:00
Brian Isganitis
dc643f9bea Add doc clarifying Taskabr icon alpha consumer purpose.
The motivation ternary `alpha > 0 ? 0 : 1` was not immediately clear, so adding some clarification for future readers.

Test: No
Change-Id: I558e86153e68572a519317dba7fbba180cb5678e
Fix: 239074423
2022-08-27 20:46:49 +00:00
Sunny Goyal
d6801af69a Inlining BaseQuickstepLauncher to QuickstepLauncher
Bug: 243022799
Test: Presubmit
Change-Id: I3706fc1f10d88ea73bd873c7e94c3e78795791eb
2022-08-24 12:51:21 -07:00
Alex Chau
e5829075ab Update hotseat QSB alpha after isQsbInline changes
Fix: 238578584
Test: Repeat steps in bug for portrait/landscape
Change-Id: I1bb9724f3e32bfc148ac75df3d1211c71c99875c
2022-08-05 17:29:22 +01:00
Schneider Victor-tulias
3f6c473164 Fade out the taskbar icons when animating to overview in 3 button nav.
Bug: 231213105
Test: from home, opened recents, then went back home, then went back to recents, resumed an app, then went back to recents and resumed the same app (both in 3-button and gesture nav)

Change-Id: I83b1b33cafb95353f36a126b93fcaf3b536d3bf4
2022-07-19 11:35:37 -07:00
Schneider Victor-tulias
6c71fe71bd Merge "Fix taskbar unstash animation delay when launching a split task." into tm-qpr-dev 2022-06-21 19:38:46 +00:00
Schneider Victor-tulias
e164995f9e Fix taskbar unstash animation delay when launching a split task.
Fixes: 232033354
Test: switched between split and unsplit tasks using 3 button nav and gesture nav
Change-Id: I9a4e2eb08e9970540093e3dc60b64a372be2052f
2022-06-15 14:55:37 -07:00
Alex Chau
c1d26448c5 Animate inline QSB between home and apps
- Added a QSB to taskbar to be animated between inline QSB and taskbar
- Passed endValue of taskbar animator to TaskbarController to have aniamtion variation between home -> app and app -> home
- Tuned duartion of taskbar animation and also stagger animation when taskbar is present
- Disabled scaling down of taskbar and inline QSB for home -> app
- Disabled stagger animation of taskbar and inline QSB for app -> home

Bug: 220733187
Test: manual
Change-Id: I4aac0bbc343b992a0472298595770e2bf2a55990
2022-06-15 22:12:29 +01:00
Alex Chau
51da219869 Fix taskbar icon flicker and jump when transforming to hotseat
- Apply additional translation on TaskbarView to account for difference between taskbar icon to bottom spacing compared to hotseat icon to bottom spacing
- Call updateIconAlignment outside of synchronizeNextDraw's then block, which get run after the synchronization

Bug: 204850744
Test: manual
Change-Id: Id65842f506eb342105082649446eb694cd5c33a4
2022-05-23 14:33:34 +01:00
Vinit Nayak
46d95995aa Merge "Extend recents button hitbox on tablet" into tm-dev 2022-05-09 18:46:01 +00:00
Vinit Nayak
b1436b0ae7 Extend recents button hitbox on tablet
* Extends hitbox when recents is tapped
when going from taskbar to overview.
* Extended region lasts for 400ms after
the animation ends.

Fixes: 225885714
Test: Manual, added unit test
Change-Id: I8766279c1a5bf6867f8d69ddd3af2aa3565deec2
2022-05-06 17:04:47 -07:00
Alex Chau
78357f7979 Finish mIconAlignmentForLauncherState animation before animating to new value
Fix: 230630665
Test: Launch app and return home, taskbar animation should be smooth
Change-Id: Ie6c7daac7f185a51476a9d076dde628d57ff77eb
2022-05-06 17:34:07 +01:00
Schneider Victor-tulias
c0b30dc266 Fix taskbar 3-button truncation on rotate
- Fixed truncation issue in overview and home on rotation
- Fixed 3 buttons translating incorrectly when switching to/from overview

Fixes: 205057824
Fixes: 215482458
Test: Manual
Change-Id: I0b89010a2b6ed03a34c3443fc6e1edc81f8d9f20
Merged-In: I0b89010a2b6ed03a34c3443fc6e1edc81f8d9f20
(cherry picked from commit 8aa99c72b1)
2022-05-02 18:12:00 +00:00
Tracy Zhou
b5d7744c1b Merge "Play icon alignment animation in live tile mode" into tm-dev 2022-04-12 00:05:34 +00:00
Tracy Zhou
d4ed2f7717 Update task bar icon alignment logic when launcher is paused and resumed in Overview
If launcher is paused and resumed in overview, goingToUnstashedLauncherStateChanged doesn't change, so we should not use goingToUnstashedLauncherState as a signal for the end value of mIconAlignmentForResumedState anim

Bug: 223109070
Test: go to overview, use the share functionality, share to drive, and make sure task bar ends up in stashed state. Making sure that it never unstashes is out of scope for this change
Change-Id: I5684be6b58279a9b41e257dd72591f7d692c2fbc
2022-04-11 23:12:49 +00:00
Tracy Zhou
42e30963c3 Play icon alignment animation in live tile mode
aka launcher is not resumed but recents animation is running

Fixes: 210047102
Test: Go to overview in live tile mode, tap on somewhere outside any task in overview, and make sure icon alignment animation is played.
Change-Id: Ic300ee296049b6fdcdf6d2595916cc84c09d95fa
2022-04-11 16:11:28 -07:00
Tracy Zhou
b34b442032 Merge "Set finishedToApp = false when rotating in Overview" into tm-dev 2022-04-08 16:05:21 +00:00
Tracy Zhou
655627f70b Set finishedToApp = false when rotating in Overview
The issue is that we always assume finishedToApp = true when recents animation is cancelled and use that to set FLAG_IN_APP. However, we don't return to app in overview after the device is rotated. Ideally we want to get signal from onRecentsAnimationCancelled, but at this point in the release it's probably ok to use launcher state to determine it.

Fixes: 227565959
Test: manual
Change-Id: I6be800aff8108b382ca3947cd1d0a45c9e9571eb
2022-04-07 20:34:00 +00:00
Jon Miranda
27f9559203 Revert "Revert "Sync hotseat/taskbar handoff""
This reverts commit efca5c8655.

Reason for revert: ANR no longer happening

Bug: 223789074
Bug: 223443781
Bug: 202507555
Change-Id: I03bfe8642ef4ed0f9e8fbd543141d39c66375604
2022-04-06 17:29:09 +00:00
Jon Miranda
efca5c8655 Revert "Sync hotseat/taskbar handoff"
This reverts commit ede8718e63.

Reason for revert: causing ANR b/223789074

Bug: 223789074
Bug: 223443781
Bug: 202507555

Change-Id: Ibd76939a345f54e8945cdd97e652f5e06e40edcb
2022-03-10 18:27:36 +00:00
Jon Miranda
ede8718e63 Sync hotseat/taskbar handoff
+ Do not allow sync during tests

Bug: 223443781
Bug: 202507555
Test: open/close apps in hotseat/taskbar
Change-Id: I2f434d440a26999219e785b8671768e27d0dcad3
2022-03-09 10:06:47 -08:00
Tracy Zhou
3007a91b5e Merge "Delay showing task bar until the user releases their finger dragging from all apps to normal" 2022-01-25 21:44:48 +00:00
Tony Wickham
5fa2ed27bf Update taskbar resume alignment anim if launcher state changes in the middle
One way to reproduce this issue is to run `adb shell input keyevent KEYCODE_HOME`, which happens to pause and immediately resume launcher. For example, let's say we run this while in All Apps. Because the isResumed=true comes before the state transition to Normal, we behave as if we are still going to All Apps, specifically goingToUnstashedState = false (since we stash in All Apps). To fix this, we now listen to state changes while the resume alignment animation is playing, and update it if necessary.

Also did the same correction for the gesture alignment animation, though I don't have a specific repo for that.

Finally, because there are now more triggers for alignment animations to play, we add a check to only play them if it's not animating to the same value it's already animating towards. One notable experience this improves is swiping down from All Apps to home; if you do it quick enough, the state animation ends before the taskbar unstash animation, and thus the unstash animation would cancel and start again with the full duration, making it look laggy/disjointed (this behavior existed before this change as well).

Test: TaplTestsQuickstep
Test: Go to All Apps, run `adb shell input keyevent KEYCODE_HOME`, open an app and ensure taskbar icons are visible
Test: Quick switch from home when taskbar is present in apps, but instead go to overview; ensure no jump when taskbar stashes
Test: Swipe down quickly from All Apps, ensure taskbar unstashing doesn't slow down when reaching the end of the state transition
Fixes: 214562370
Change-Id: Ie0c6140e14186e41c7e4748dc745f87349b084fe
2022-01-19 16:39:34 +00:00
Schneider Victor-tulias
291d88460b Make Taskbar focusable when a popup is open.
- Added ArrowPopup#OnPopupClosedCallback to automatically remove Taskbar focus when the popup closes.

Fixes: 209917078
Test: opened popup in taskbar and closed it with switch access, touching anywhere on the screen and using the back gesture. went home to check if focus was removed.
Change-Id: Ie7aafc9cf0f03fadaa44e77818508e9e1d8db610
2022-01-14 12:52:53 -08:00
Tracy Zhou
bec00acf28 Delay showing task bar until the user releases their finger dragging from all apps to normal
Fixes: 208802276
Test: drag from all apps to normal, and the task bar doesn't stash until the user releases their finger
Change-Id: I53133cc80749bdc62e77d858b5714ae32facbd1d
2021-12-15 06:35:41 +08:00
Winson Chung
7f5e4ca06c Ensure some taskbar states are initialized correctly
- Update FLAG_IN_APP to account for setup state to ensure that the
  stashed state is correct. This needs to be done in the stash
  controller since SUW is the home activity on startup and the
  launcher state controller will not be initialized until after
  SUW finishes
- Initialize the launcher state and resumed flags in case Launcher
  restarts while another app is resumed

Bug: 204384193
Test: Run through SUW, ensure the background is not visible
Change-Id: I5ce061ad16e79226c8428339ccd0b5ac55c07205
2021-12-14 19:08:55 +00:00
Tony Wickham
0606773905 Fix taskbar being empty
We set mIconAlignmentForResumedState in endGestureStateOverride(), but then we call applyState() which might aniamte mIAFRS to a different value. To avoid this, set it after applyState() instead.

Specific repro:
1. Open Calculator
2. Go to Overview
3. Dismiss Calculator
  3a. This calls endGestureStateOverride() because the running tile ends
  3b. Previously, we called mIAFRS.updateValue(1) but then applyState() animated it to 0 because we're still in Overview which is an unstashed state. Now the animation to 0 is before setting explicitly to 1.
4. Go home (this sets mIconAlignmentForLauncherState = 1)
5. Open Calculator again. Previously, mIAFRS was already 0 so animating to 0 was ignored. Now, mIAFRS starts at 1 (which is right since launcher is resumed).

Test: see above
Fixes: 210109500
Change-Id: I13f40908f8636291d63ef4b885ac9d08bbf4d393
2021-12-10 18:20:13 +00:00
Tony Wickham
24675d36b7 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
2021-12-07 13:13:48 -08:00
Tony Wickham
9566290e13 Cleanup some taskbar/hotseat handoff issues
- Clearly distinguish Home <-> App icon alignment (ForResumedState and ForGestureState) from Home <-> Home states (ForLauncherState) by renaming onIconAlignmentRatioChanged() to onIconAlignmentRatioChangedForAppAndHomeTransition (for the former)
- Make sure initial state is properly applied by treating all flags as changed
- onIconAlignmentRatioChangedForStateTransition only runs when launcher is resumed (fixes 208648294)
- Animate taskbar background alpha when going between home and app, separate from icon alignment (bug: 204657916)
- Only copy hotseat's alpha to taskbar when hotseat is originally visible (also bug: 204657916)

Test: Open an app on small screen, open large screen and ensure taskbar stays at the bottom instead of aligning with non-present hotseat (bug: 208648294)
Test: Swipe up and down on home scren, ensure taskbar background never appears and there's no jump between taskbar and hotseat
Change-Id: Iea59965118f2bdbd8ce49279f76fb01fbd61f60b
2021-12-06 17:16:19 -08:00
Tony Wickham
f1951ce1f7 Fix taskbar stash misalignment when going from app to overview
Keep taskbar unaligned with hotseat if we're stashing anyway

Test: Swipe up from app with taskbar present to overview, check frame by frame to ensure icons morph directly into the handle instead of above it
Fixes: 208697792
Change-Id: If3238286b3383e75eb71fbd3b97d34bb3b44340b
2021-12-06 15:15:34 -08:00
Tony Wickham
e59a723af3 Fix taskbar jumping when going home
- Set resumed state immediately when finishing recents controller to launcher, otherwise there's a race where we start animating gesture state to 0 before animating resumed state to 1, which causes the jump in the bug

Test: Swipe from app to home 10 times, no jump
Fixes: 203725820
Change-Id: Ie8a1add29902a9961ba4d7861ba5424ab656f1c8
2021-12-02 12:19:32 -08:00
Tony Wickham
488bca7934 Remove TaskbarLauncherStateController#setIconAlpha()
Instead use setTaskbarViewVisible directly. Now that we stash when going to overview, we shouldn't have any launcher state where we need to fade out TaskbarView icons

Test: quick switch from home (follow up CL)
Bug: 194728611
Change-Id: I03e1fa4037b7e8a08494f6b7e065d144c4bc4e1b
2021-12-01 15:27:44 -08:00
Tracy Zhou
1fdea66f16 Fix memory leak in TaskbarLauncherStateController
mIconAlphaForHome.setConsumer(null) in onDestroy()

Test: Run BinderTests#testSwitchToOverview locally
Bug: 206633573
Change-Id: I912cd66097b113ee84197f23a5862e333d7e63f2
2021-11-16 11:31:15 -08:00
Tracy Zhou
e89a83b65d Track LauncherState, RecentsAnimation, resumed state for task bar in one place
TODO:
- Consider delaying animating task bar to stashed towards all apps state until user releasing their finger (tho in this change heuristic is applied for stashing and unstashing respectively)
- Further consolidate some animation logic

Bug: 204220602
Test: manual

Change-Id: I58b4d035fcf65a9f5c68e69c129eae95b89b1c4a
2021-11-09 23:46:03 -08:00