Commit Graph

80 Commits

Author SHA1 Message Date
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