Commit Graph

38 Commits

Author SHA1 Message Date
Sunny Goyal
d5500548dc Revert^2 "Moving taskbar lifecycle to TouchInteractionService"
430465a3d5
Bug: 187353581
Change-Id: I7b2280d16adfafd3e85ffc1d22e32d0c00d12b67
2021-05-21 07:05:02 +00:00
Kholoud Mohamed
430465a3d5 Revert "Moving taskbar lifecycle to TouchInteractionService"
This reverts commit e215fb730b.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/view?invocationId=I13700009003387451&testResultId=TR89423459137251402, bug https://buganizer.corp.google.com/issues/188755902

Bug: 188755902
Change-Id: I4650136975b60f311499ee6ff5b27ab9a32d23d6
2021-05-20 13:32:05 +01:00
Kholoud Mohamed
bb6f6e5dae Revert "Renaming TaskbarController to LauncherTaskbarUIController"
This reverts commit 40a7421619.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/view?invocationId=I13700009003387451&testResultId=TR89423459137251402, bug https://buganizer.corp.google.com/issues/188755902

Bug: 188755902
Change-Id: Icd1ddd43e62d392f6b68b0150a1075f73106391a
2021-05-20 13:31:34 +01:00
Sunny Goyal
40a7421619 Renaming TaskbarController to LauncherTaskbarUIController
Bug: 187353581
Test: N/A
Change-Id: I44aac42c4df134fd7e6fc0c3609fdb3007cf52e3
2021-05-18 11:43:28 -07:00
Sunny Goyal
e215fb730b Moving taskbar lifecycle to TouchInteractionService
> Inflating taskbar views with a non-launcher window context
> Removing separate taskbar view in Launcher
> Handling taskbar icon clicks directly instead of going via launcher
> Fixing some relayouts during show/hide animation

Bug: 187353581
Test: Manual
Change-Id: Ia7d44acbb770bf0345922234b3daa5cc040a5843
2021-05-17 21:47:08 -07:00
Vinit Nayak
673faf59ee Add IME switcher/hide button bar when IME showing
Bug: 180046394
Change-Id: Ic2bd919ab3d27e0a430b081c771ea8dc5827be81
2021-05-05 12:50:39 -07:00
Vinit Nayak
16fd85629d Initial commit of 3 button work
Home, Back and Recents basic functionality working

Fixes: 180046394
Change-Id: Ifc5c767e35e88183500d14d14736eb40df436369
2021-05-05 11:25:36 -07:00
Tony Wickham
81f8175ab1 Move taskbar to be closer to QSB
- Offset taskbar to be halfway between QSB and bottom of the screen.
- Add taskbar translationY state property to animate when going
  between launcher and an app.
- Draw the taskbar background in TaskbarContainerView instead of
  TaskbarView so it stays pinned to the bottom as TaskbarView
  translates up. If we want to have a background behind the
  taskbar on home, this should move back to TaskbarView so that
  the drawing can be shared by mTaskbarViewOnHome.

Test: visually on home screen, translates when entering and
exiting an app

Bug: 182981881
Bug: 171917176
Change-Id: I44f8b2c770074f7f015dcccbc2befd3453811193
2021-04-13 10:10:54 -07:00
Tony Wickham
be282e9bc8 Update taskbar to add extra hotseat items instead of recent apps
Removes recents-related code including the divider between it and
hotseat.

Test: manually on device

Fixes: 184366189
Bug: 184789479
Bug: 171917176
Change-Id: I7776c98659ded70f53a49befddcd23c8353c6440
2021-04-12 16:20:18 -07:00
Tony Wickham
fc3bc6098f Merge "Explicitly set which taskbar view is visible at each caller" into sc-dev 2021-04-06 19:37:18 +00:00
Tony Wickham
e13a4a4475 Cleanup taskbar touchableInsets
- Remove obsolete visibleInsets hack and isDraggingItem() check
- Have TaskbarController determine whether taskbar is touchable,
  rather than TaskbarContainerView.
- Disallow touches during transition to home (can potentially
  improve this later)

Test: Swupe home, tap taskbar folder during transition, ensure
don't end up in broken state with the uninteractable folder open
Bug: 182512211

Change-Id: Id625ce8b9b876a8a1b450b7d6fb771540e23bc08
2021-04-05 17:33:44 -07:00
Tony Wickham
6a74e65953 Explicitly set which taskbar view is visible at each caller
This makes it more clear which taskbar view is expected for particular
code flows. Also makes it easier to set it to null in cleanup().

Test: call cleanup() while taskbarOnHome is invisible, ensure hotseat
icons go back to being visible
Bug: 182512211
Fixes: 183633496

Change-Id: I680a15582c8034a049b20e035b4d54f5ea5aee04
2021-04-05 16:42:17 -07:00
Tony Wickham
02e9f1e12f Slightly improve Taskbar animations to launcher
- Move Taskbar scale to LauncherState
- Rename TaskbarVisibilityController to TaskbarAnimationController and
  add mTaskbarScaleForLauncherState to TaskbarAnimationController
- Set OverviewState#getTaskbarScale() = 1f so Taskbar doesn't scale
  up when going from an app to Overview
- Increase home animation duration so Taskbar animation aligns better

Test: Taskbar scales up when going home, doesn't scale up when going
to overview
Bug: 182512211

Change-Id: I6f448e76de98d7ff337ae93234d4bb7ce6254d50
2021-03-24 10:31:12 -07:00
Tony Wickham
e63bd38a55 Remove dead taskbar code
Test: Works as before
Bug: 182512211
Change-Id: Id4c979f2924f9ae6881a9bed18bcc52fbd80c05b
2021-03-23 11:42:50 -07:00
Tony Wickham
9ce3b25ef6 Add TaskbarView as a child of Hotseat
Instead of keeping the Taskbar window showing above the home screen,
we now integrate a copy of TaskbarView directly into Launcher's view
hierarchy. Most TaskbarController calls apply to both TaskbarViews
(mTaskbarViewInApp and mTaskbarViewOnHome), except for calls related
to Hotseat, which only apply to mTasbkarViewInApp given the real
Hotseat will be showing with mTaskbarViewOnHome.

More cleanup will follow this change.

Test: All taskbar interactions (e.g. drag and drop) continue to work
Bug: 182512211
Bug: 171917176
Change-Id: I0f0b124f652daa85f866e1df8f9e2981540331a0
2021-03-22 15:26:01 -07:00
Tony Wickham
b31d8fc379 Use taskbarSize as bottom inset when taskbar is present.
This was done in ag/13841736 but not included in ag/13821586

Test: QSB in correct position when taskbar present and not present
Bug: 171917176
Change-Id: I6aa220559afebe8710b5f01cdec9c2baa9f4c926
2021-03-18 13:57:20 -07:00
Sunny Goyal
c373e1c642 Adding an optional QSB in hotseat
Removing sections in all-apps during transition and treating
it as a single unit

Bug: 175137718
Test: Manual
Change-Id: I55a501d80b5903f1a9d92a26b3784784fd9e50fd
2021-03-17 12:21:44 -07:00
Tony Wickham
e5695f9196 Hide taskbar when certain floating views are open
Test: Open widgets, ensure taskbar hides
Bug: 171917176
Change-Id: Ib78182fe0ca1ea5ffbd28ab42f49ab8f0e535a18
2021-03-16 11:28:35 -07:00
Tony Wickham
e2ed4b37cc Merge "Replace taskbar hotseat with real hotseat when folder is open" into sc-dev 2021-03-13 02:17:49 +00:00
Tony Wickham
ae72b46b2c Replace taskbar hotseat with real hotseat when folder is open
- Seamlessly show real hotseat and hide taskbar hotseat, while
  keeping rest of taskbar visible
- Update MultiValueAlpha to allow for taking max alpha instead
  of blending, and use that for Hotseat
- Fix folder open bounds on home screen when taskbar is present

Test: Open folder from taskbar on home, can drag out items
Bug: 182079330
Bug: 171917176
Change-Id: I7c1983e3219b1341cf233260f0ccac9051c4dc14
2021-03-12 11:05:43 -08:00
Sunny Goyal
da2ecb3095 Merge "Adding support for listening for app launch animation completion" into sc-dev 2021-03-11 21:36:43 +00:00
Sunny Goyal
b65d766d88 Adding support for listening for app launch animation completion
Bug: 181165935
Bug: 179065491
Test: Verified on device
Change-Id: Ifa6a91560cb31b4dfb72a0f582607e873d8a002d
2021-03-10 15:53:21 -08:00
Tony Wickham
2e9de09383 End Taskbar animator before other cleanup
This ensures it doesn't try to set properties that have already
been cleaned up.

Test: Swipe home from an app, remove taskbar during transition
Fixes: 182163822
Change-Id: Ia8779f044beeabd99e087288c3ae7f4f72c72d39
2021-03-10 09:33:11 -08:00
TreeHugger Robot
43e516227e Merge "End any running taskbar animation in cleanup()" into sc-dev 2021-03-09 22:58:39 +00:00
Tony Wickham
51b2453e30 End any running taskbar animation in cleanup()
Test: Open an app, swipe to home and remove taskbar during animation,
ensure no crash
Fixes: 182163822

Change-Id: Ie92b4fdf03a23c8a205d1d7327a304cf1d996383
2021-03-08 10:14:10 -08:00
Tony Wickham
39938cbc94 Initiate Hotseat drag from long pressing corresponding Taskbar item
When you long press on the taskbar hotseat item, the following happens:
- We start a system drag and drop with an invisible drag shadow
- We create a new DragOptions with the simulatedDndStartPoint set to the
  drag down position, and tell Launcher to use that for the next drag
- We perform a long click on the equivalent Hotseat item in Launcher
- We pass the drag events of that operation to Launcher's DragController

This allows Launcher to handle the entire drag operation, including the
pre-drag (with popup), and taskbar already hides when the drag starts.

Test: Long press items in taskbar hotseat, able to drag them to workspace

Bug: 179886115
Bug: 171917176
Change-Id: I576b80cb1bd0225cdc91cf7689fdee0481265109
2021-03-06 03:39:54 +00:00
Tony Wickham
64edc22c8b Space out empty taskbar hotseat views when on home screen
This ensures the taskbar hotseat aligns with the home screen
hotseat, as the latter supports empty cells. When in apps,
the taskbar still collapses the empty cells.

Test: Turn off hotseat predictions, remove some hotseat items,
and ensure the taskbar hotseat spreads out when on home.

Bug: 179886115
Bug: 171917176
Change-Id: I6047c3c5691685edcd8b3519e0305812b1295550
2021-03-04 23:54:34 +00:00
Tony Wickham
a29a046d83 Align real hotseat with taskbar hotseat during drag and drop
Remove hotseat space from workspace in DeviceProfile if
taskbar is present, and instantly swap between taskbar and
hotseat when entering SpringLoadedMode. To allow for an exact
handoff, we also scale up the TaskbarView such that its icons
match the hotseat icon size when on the home screen.

Note that this CL only supports dragging to the taskbar, not
out of it (which still triggers system drag and drop instead).

Test: In RTL and LTR, drag a workspace item and ensure hotseat
seamlessly swaps with the taskbar hotseat and allows drops.

Bug: 179886115
Bug: 171917176

Change-Id: Id6462075b9b0b66b06d51a78c9c0b3e11e83e84d
2021-03-03 11:16:42 -08:00
Tony Wickham
786dd93f2b Fix a couple of crashes when taskbar isn't yet attached
- Handle back to back addTaskbarIfNecessary(). Specifically, handle
  cleanup() before the previous add was attached. This is already
  handled on WM side, just had to remove isAttachedToWindow() check.
- Add isAttachedToWindow() check to isViewInTaskbar()

Test: call addTaskbarIfNecessary() three times back to back, ensure no crash.

Fixes: 180509238
Bug: 171917176
Change-Id: Id68b6c376029eb5c651f47afa56666391c516aef
2021-02-18 15:40:33 -08:00
Tony Wickham
15883891ea Subtract taskbar size from DeviceProfile#availableHeight
Normally availableHeight excludes system insets, but taskbar is added
after availableHeight is calculated. This discrepency causes some bad
calculations such as TaskView size.

Test: touch nav bar when in an app with taskbar present, ensure the
task doesn't jump due to incorrect calculation

Fixes: 179478728
Bug: 171917176
Change-Id: I16d39d3e1d9708e2a64c81b1ac24466f9567d1b9
2021-02-18 11:39:10 -08:00
Tony Wickham
7ba547cd2d Folder support in Taskbar
- Add TaskbarActivityContext which allows shared Launcher elements to
  "just work" using existing generic ActivityContext.
- TaskbarContainerView extends BaseDragLayer<TaskbarActivityContext>.
- Inflate FolderIcon and Folder using TaskbarActivityContext to be
  shown in TaskbarContainerView.
- Use TaskbarActivityContext's DeviceProfile to determine icon size
  instead of overriding in styles. This also ensures that normal
  BubbleTextView icons have the same size as FolderIcons.

Test: Place a folder in home screen hotseat, ensure it shows up in
taskbar and can be opened, and that apps inside it can be launched
or dragged.
Bug: 171917176

Change-Id: Ic25d2f84bcd7e3399c88989305ea565497c030d9
2021-02-16 15:07:01 -08:00
Tony Wickham
734be0b5ae Add OnComputeInsetsListener to TaskbarContainerView
Instead of updating visibility of TaskbarContainerView, keep it
VISIBLE but with alpha 0, and update touchableInsets to allow
touches to pass through. This avoids sending insets changed
when Taskbar is hidden.

Test: Swipe to Overview, no jumping/jank due to insets change;
also tap where Taskbar would be and ensure it doesn't launch

Bug: 171917176
Change-Id: I9ccb4335e0301f34eec459657f3bbaf88b0d8a52
2021-02-05 08:51:42 -08:00
Tony Wickham
63fc59b801 Use SYSTEM_APPLICATION_OVERLAY instead of SYSTEM_ALERT_WINDOW for Taskbar
Test: Taskbar still shows up and works, can't hide it from Settings
Bug: 169054709
Change-Id: I0d2f9be8a0af2242472d8406bbc31a6aecaa9285
2021-02-04 10:07:59 -08:00
Tony Wickham
aaa42bd0e8 Add recent tasks to Taskbar
- Also adds a divider between Hotseat and Recents
- Dedupes Recents from Hotseat

Test: Open some recent tasks, ensure they are deduped
from Hotseat and also handle < 2 tasks.

Bug: 171917176
Change-Id: Ia782c6ccbcda94cfd844aad04dc3d25a3f072c2b
2021-02-03 18:54:58 -08:00
Tony Wickham
e747278ee8 Support drag and drop from Taskbar
- Long clicking a BubbleTextView in Taskbar will start a system drag
  and drop operation, setting the original view invisible meanwhile.
- Defer gesture navigation when starting over a Taskbar item, and
  cancel any started gesture if a Taskbar drag and drop starts.

Bug: 171917176
Change-Id: If5049071fbf1755f545ee937daa4edabd869f00d
2021-02-01 18:29:06 -08:00
Tony Wickham
794fe4f58e Add Hotseat items to Taskbar
- Currently supports WorkspaceItemInfo (e.g. normal app icons
  including hotseat predictions and pinned deep shortcuts).
- Currently doesn't support Folders, Notification dots, or
  long press.

Some technical details:
- Always allow HotseatPredictionController updates given the
  Hotseat is always showing even when Launcher is stopped.
- Represent Taskbar Hotseat items as BubbleTextViews, to
  allow for normal click handling etc. When the hotseat is
  updated, we reuse the same BubbleTextViews that were
  initially inflated, and just reapply the new info.
- Add new BubbleTextView iconDisplay for Taskbar, to allow
  for different treatment such as icon size.

Bug: 171917176
Change-Id: I325eb39051f2dc69228b39b5c40ed0cbdad8e200
2021-02-01 18:29:06 -08:00
Tony Wickham
d683d98b34 Animate taskbar background alpha and visibility alpha
Setup codepath to animate the Taskbar when going to and from Launcher,
primarily by listening for pause/resume signals but also hints from
gesture nav and AppToOverviewAnimationProvider.

Additionally, add TaskbarStateHandler to listen for Launcher state
changes if Taskbar is enabled. Combined, the end behavior is:

- Background alpha is 0 when Launcher is resumed, and 1 when Launcher
  is paused (we can make this animation more interesting later).
- Taskbar is always visible when Launcher is paused, otherwise its
  visibility is determined by multiple factors: LauncherState and
  whether the IME is showing.

Bug: 171917176
Change-Id: I7856fc979931c9d12d714dee11d179fd1b5a6968
2021-01-29 21:22:00 +00:00
Tony Wickham
f26e90aa35 Add empty Taskbar views and initial TaskbarController
Guarded by a FeatureFlag.

Bug: 171917176
Change-Id: I7145c7ae68282bf53552502798fe758c8c0e285d
2021-01-22 15:39:46 -08:00