Commit Graph

72 Commits

Author SHA1 Message Date
Jon Miranda
5945226515 Fix spring not springing when unstashing.
The spring animation was getting cancelled by the reset
animation.

Added a check to avoid creating a new reset animation if we
are already animating to the final value.

Bug: 273961611
Change-Id: I3afb62b89b5f6fbe920906499db2497ef8e94069
Flag: ENABLE_TRANSIENT_TASKBAR
Test: stash transient taskbar
2023-03-22 11:53:58 -07:00
Mike Schneider
94f46e14f4 Do not play unstash animation when unlocking the device
The unstash is ignored by TaskbarStashController, while the TaskbarLauncherStateController positions the hotseat on the launcher correctly without animation.

Since the TaskbarStashController is used even with 3p launchers, both of these actors keep track of whether the device is locked independently, based on the SysUI flags.

Bug: 270139677, 266890635, 274084408
Test: manually, Tapl
Change-Id: Iae94522b5d57cc89c9a4d219ad1254b150a3400d
2023-03-22 09:10:03 +01:00
Mike Schneider
308b7849db Do not perform invisible transitions while the screen is off.
This change caches whether launcher was active at the time of the screen
off, and assumes this last state when the screen is actually off.

While trying to understand the code, I renamed a couple class-internal
methods and flags, plus added comments. If they are not accurate, its
due to a misunderstanding on my part, and I will gladly revisit and
check whether all the assumptions I made still hold.

Bug: 261418621
Test: manually

Change-Id: I2ad25caf478100781a063c356c5fd2d20d3e1917
Merged-In: I2ad25caf478100781a063c356c5fd2d20d3e1917
2023-03-21 21:02:55 +00:00
Jon Miranda
f0e14ac7da Taskbar motion polish to keep icons within taskbar bg bounds.
Instead of making the icons themselves move faster, we change
the startDelay/duration of the taskbar bg alpha animation
so that the taskbar is only visible when the icons are within
the taskbar bounds.

This is still an approximation. For U+, we should support taskbar
width change to fit the icons when they are in the 'hotseat'
alignment.

Bug: 273961611
Test: home <-> overview
      home <-> app
      stash <-> unstash
      foldable/tablet
      RTL
Change-Id: I39bedafac4afd641d250f7c97abf1e2de070d646
2023-03-20 07:12:53 -07:00
Jon Miranda
4b5f6913ef Fix QSB flicker when returning home.
We only set qsb alpha if isQsbInline = true, since that is when
we draw/animate the qsb in the taskbar.

Fixes: 269164187
Test: isQsbInline = true / false
Change-Id: I92022135e74f734a8e50c606dc9c605df39a9f97
2023-03-17 13:38:39 -07:00
Brian Isganitis
c762ef68d4 Log when taskbar is in task switcher container.
Test: wwdebug & wwlogcat
Bug: 261177876
Change-Id: Id4eda7ee7e4e2c1aa60e07d5b65410b3847d9ac6
2023-03-07 03:29:21 +00:00
TreeHugger Robot
3dd1440520 Merge "Translate taskbar to hotseat without jump when swiping up from overview" into tm-qpr-dev 2023-03-04 00:18:16 +00:00
Brian Isganitis
d2d2913812 Merge changes from topic "running-in-test-camel" into tm-qpr-dev
* changes:
  Expose IS_RUNNING_IN_TEST_HARNESS as static method.
  Make isTooltipEnabled a getter due to its mutable dependencies.
2023-03-03 23:15:38 +00:00
Brian Isganitis
fdd044e16e Expose IS_RUNNING_IN_TEST_HARNESS as static method.
This variable is now mutable, making the uppercase format misleading.
For instance, users might assume they can use this value in other
immutable properties, when they really should be accessing the latest
value every time they need it.

Context: https://source.android.com/docs/setup/contribute/code-style#follow-field-naming-conventions

Test: Manual
Bug: 271160958
Change-Id: Iaaa51d9153cb8a7d686c72e1210b1948029dcfd5
2023-03-03 00:17:33 +00:00
Tony Wickham
10c78b94f5 Translate taskbar to hotseat without jump when swiping up from overview
Also use this code path to reset translation when going from an app to
launcher.

Test: swipe up from overview, goes home without hotseat jumping
Fixes: 262826748
Change-Id: If8a4278a61e3786cfe16c388eabefacc63e8f327
2023-03-01 19:20:57 +00:00
Alex Chau
7fee161cd5 Skip updateIconAlphaForHome if Taskbar is already destroyed
Bug: 269409332
Test: Switch display with and without Tasxkbar at home and in-app, Taskbar and Hotseat visibility are correct
Change-Id: I598f618c336067bf795b77ccdf3b03f420634047
2023-02-28 12:46:50 +00:00
Winson Chung
d30ef72606 Merge "Fix issue with global drag from taskbar being disabled" into tm-qpr-dev 2023-02-21 22:50:31 +00:00
TreeHugger Robot
9769b2844c Merge "Translate the taskbar icons to match nav handle shape." into tm-qpr-dev 2023-02-21 03:24:41 +00:00
Winson Chung
3bce15d2a2 Fix issue with global drag from taskbar being disabled
- BackgroundAppState extends OverviewState, so in some cases we will
  transition to background app, which inadvertently triggers global
  drag and drop from being enabled

Bug: 269819279
Test: Enter split, cycle the screen and try to drag an app from the
      transient bar
Change-Id: I0e8c5e8bbaa0220fc870d2db866152864253010f
2023-02-18 06:34:08 +00:00
Jon Miranda
13e9b9f889 Translate the taskbar icons to match nav handle shape.
- We need to reset icon alignment whenever icon layout bound
  changes. This fixes the issue where we build an icon
  alignment animator before any of the views are laid out.
- Separated animation logic between.
  createTransientAnimToIsStashed and createAnimToIsStashed
* The values still require a bit more tuning but this gets us
  a lot closer to spec for many of the motion polish.

Bug: 267806083
Bug: 246634367
Bug: 246635237
Test: manual
Change-Id: Id122134b22ef4e418ce632e4a8137239dc8bb313
2023-02-17 10:56:59 -08:00
Alex Chau
9a647d53cb Log stackstrace if updateIconAlphaForHome is called after Taskbar is destroyed
Bug: 269409332
Test: manual
Change-Id: I0ff4be33b1e621b0e1a837f8211eb70c27368be1
2023-02-16 18:56:13 +00:00
Vinit Nayak
f4e7e5aaf4 Add overview taskbar split support for 3P launcher
* Created b/268120202 to track other states of split
selection that are unhandled on 3P launchers

Test: Able to initiate split in overview with 3P launcher
Fixes: 264576761
Change-Id: I0311fe83380bf914fa79956b2565b61cc5eab916
2023-02-15 11:26:06 -08:00
Vinit Nayak
05dbd1aab8 Merge "Rename LauncherState QUICK_SWITCH to QUICK_SWITCH_FROM_HOME" into tm-qpr-dev 2023-02-06 18:59:47 +00:00
Vinit Nayak
82b8aa561a Rename LauncherState QUICK_SWITCH to QUICK_SWITCH_FROM_HOME
Test: compiles
Bug: 265734073
Change-Id: I38e23c62b1eeae6a26db9c388655a8ffceb025b6
2023-02-03 10:38:21 -08:00
Tony Wickham
632e9a84c4 Merge "Don't applyState if taskbar is already destroyed" into tm-qpr-dev 2023-02-03 17:55:30 +00:00
Tony Wickham
9fb8883017 Don't applyState if taskbar is already destroyed
Test: Open overview while unfolded, then fold; ensure hotseat remains
visible
Fixes: 260135164

Change-Id: I788a9a682a7d5fabbea7c478231fc7abe92e95b9
2023-02-03 01:00:21 +00:00
TreeHugger Robot
ba73400fe1 Merge "Revert "Revert "Add debug logs for hotseat disapperaed bug""" into tm-qpr-dev 2023-01-30 22:41:41 +00:00
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
Vinit Nayak
49dc6d2712 Launch initial split from taskbar in overview app menu
* Consolidated init calls in SplitSelectStateController
* Also add support to launch from taskbar all apps
* Add logic in SplitSelectStateController to know whether
or not we need to dismiss existing TaskView vs relying
on mSplitHiddenTaskView null check
* Default click handling for SplitShortcut is to start
split selection mode

Bug: 251747761
Test: Initiated split from smart actions, thumbnail app
icon, home, taskbar in overview, all apps. Saw it choose
the latest thumbnail

Change-Id: Ib4f64e619c97615af458a19a9c0efd86c92979d9
2023-01-27 16:46:14 -08:00
TreeHugger Robot
7c323889aa Merge "Close Taskbar AllApps when going from overview to home" into tm-qpr-dev 2023-01-18 20:54:43 +00:00
Sunny Goyal
ff5697302b Merge "Updating TaskbarStashController API" into tm-qpr-dev 2023-01-18 16:53:55 +00:00
Alex Chau
835ccc58e0 Close Taskbar AllApps when going from overview to home
- Also trigger closeAllOpenViews when changing state to NORMAL

Fix: 265689318
Test: manual
Change-Id: I109c0f3a3c741844c8747bd76a6c38bf301ec737
2023-01-16 18:20:27 +00:00
Sunny Goyal
a34521e434 Updating TaskbarStashController API
> Making the state animator nonNull to avoid null checks at caller
> Updating the methods names to explicitely indication animation
  being started or not

Bug: 265352919
Test: Verified on device
Change-Id: I1f5b47921f831ed0b202aced10825c8e1d39a4dc
2023-01-14 08:07:44 -08: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