Commit Graph

88 Commits

Author SHA1 Message Date
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
Tony Wickham
82d5a0681d Revert to overview coming from the side instead of bottom
Test: Visually checking all of these. As appropriate, repeat in 0, 2, 3
button modes, landscape/portrait/fake landscape, and 3P launcher
- Quick switch from home
- Home to overview
- Overview to home (swipe up)
- Overview to home (tap outside)
- Overview to home (back invocation)
- Quick switch from app
- Swipe up and hold from app
- Dismiss an app
- Empty recents
- Split select state to home
- Modal state to home
Fixes: 185411781

Change-Id: If00a22fee35c832a259bfc62808efbac5990ce2e
2021-05-14 16:06:44 -07:00
Tracy Zhou
f20a4bd9a9 Finish the recents animation when the phone goes to sleep
Fixes: 169988381
Test: manual
Change-Id: I62527ef46009a1417e67637c512b3a2fc005bcd6
2021-05-10 10:20:43 -07:00
Vinit Nayak
b2993d65b7 Merge changes from topics "taskbar3Button", "taskbarIME" into sc-dev
* changes:
  Add IME switcher/hide button bar when IME showing
  Initial commit of 3 button work
2021-05-06 20:47:41 +00:00
Tony Wickham
e8b22d5e60 When overview appears from motion pause, come up from bottom
- Add vertical offset calculations to RecentsView (in addition to
  the existing horizontal offset which has been renamed accordingly).
- LauncherState#getOverviewScaleAndOffset() now supports both
  horizontal and vertical offsets and is specified such that overview
  appears and disappears from the bottom of the screen rather than the
  side.
- Quick switch still uses horizontal offset to come from the side.
- No longer need to scroll to page 0 when translating offscreen.
- Update interpolators for overview to home transition.
- Align 2 button mode transition with 0 button mode.

Test: Visually checking all of these. As appropriate, repeat in 0, 2, 3
button modes, landscape/portrait/fake landscape, and 3P launcher
- Quick switch from home
- Home to overview
- Overview to home (swipe up)
- Overview to home (tap outside)
- Overview to home (back invocation)
- Quick switch from app
- Swipe up and hold from app
- Dismiss an app
- Empty recents
- Split select state to home
- Modal state to home

Bug: 185411781
Change-Id: Ic59b877ccc0050afd7cd478778e9eeb60e2e47f7
2021-05-05 21:08:49 -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
Sunny Goyal
19ff728b92 Adding support for determining split layout for launcher.
> Simulating the windo wmanager API to get available device
  profiles until final API
> When a device has multiple internal displays, and with both
  tablet and phone possibilities, it uses a split workspace layout

Bug: 186160341
Bug: 175782275
Test: Manual
Change-Id: Ieff2329acac7cdd6b9abe6f96cd459cd45bd0efe
2021-05-03 14:48:28 -07:00
Cyrus Boadway
92af1bfe5b Merge "Create return-to-home app widget animation" into sc-dev 2021-05-03 17:51:45 +00:00
Cyrus Boadway
3bdfc3cd2d Create return-to-home app widget animation
If an app has been most recently launched from an app widget, when
swiped away, the app animates to the widget's position.

This is done by attributing the app launch to the widget through
the ActivityOptions's launch cookies, and using a FloatingWidgetView
throughout the animation.

Bug: 169042867
Test: manual
Change-Id: I24c2623b5b3407504a4768b076849c47f73cbae0
2021-04-30 09:37:53 +00:00
Winson Chung
3c192b3f72 Fix a couple issues with tracking launch cookies
- Fix NPE when there is no running task
- Fix issue where we were defaulting to a prediction icon when
  there was no launch cookie
- Don't use a launch cookie when we are launching from a non-workspace
  item, just fallback to the package name matching in that case

Fixes: 186653036
Fixes: 186593373
Test: Swipe up from various apps launched from predictions, also
      launch an app from all apps and swipe up and ensure it
      doesn't match a prediction
Change-Id: Ie8f5da010c140a5056045ac268d082c80271ab68
2021-04-29 04:23:40 +00:00
Alex Chau
fd6d942220 Pass WindowContext to DisplayInfoChangeListener
- WindowContext (or updated DisplayContext for Pre-S) contains updated Resources to be used for the listener

Fixes: 181215299
Fixes: 176656141
Test: Swap between large/small screen, large sreen UI is seen
Test: Swap between font size, launcher icon text is updated
Test: Start secondary home
Test: Repeat the above tests with Utilities.ATLEAST_S hardcoded to false
Change-Id: Ib33025ac0276c84fe2b3213e9946721e5988e3da
2021-04-23 19:14:20 +01:00
Winson Chung
2b093941e1 Add support for swiping back to the shortcut that launched the activity
Bug: 129067201
Test: Open a shortcut on the workspace, go home

Change-Id: If5d3c3e8e93f09af50aa4994094657347890ef45
Signed-off-by: Winson Chung <winsonc@google.com>
2021-04-22 17:00:47 -07:00
Sunny Goyal
35c7b19fa8 Using WindowContext for listening to configuration changes
Pre-S: Continue to use config-changed broadcast for configuration changes
and display-changed event for rotation changes
S+: Use WindowContext#componentCallbacks for config and rotation changes, and
continue to use display listener for frame-rate changes

Bug: 179308296
Test: Manual and presubmit
Change-Id: I533e69068b5fa6c052a02759ef309dd075ee6a4b
2021-04-22 00:23:02 -07:00
Tony Wickham
5df03e1585 Merge changes from topic "taskbar-hotseat" into sc-dev
* changes:
  Update taskbar to add extra hotseat items instead of recent apps
  Add support for having more hotseat icons in the DB than we show
2021-04-13 18:41:47 +00: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
Vinit Nayak
b1bbc0f78d Changes to use new startTasks API
When shell transitions is enabled, this will use the
newer multi-task-launch api and control the animation.

There is no actual animation yet, this just adds the
infrastructure.

Bug: 182002789
Test: enable developer option and enter split via recents
Change-Id: If5be104a86e7b5f743f85efed20b0d2bf1b8bfd1
2021-04-09 12:09:28 -07:00
Vinit Nayak
e3f7d0d1b4 Add split placeholder view above OverviewScrim
Only show single split option for landscape and
seascape overview menu options.

Bug: 181705607
Change-Id: I577fbaed41b5debd007c953851ec2056988057d9
2021-04-05 12:41:06 -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
Sunny Goyal
a8bbcb9c04 Fixing ActivityInit getting called before the full launcher components are initialized
Bug: 182575999
Test: Presubmit
Change-Id: Iea6986624b70caf2d502c1b21318b57a8b2fde03
2021-03-18 15:49:00 -07:00
Vinit Nayak
d987a828e8 Initial commit of new split screen work.
TODO:
* Extract out common elements in TaskShortcutFactory.MultiWindowFactory
for commonalities between new and old way of
invoking split screen
* Integrate with WM APIs (b/182002789)
* Write tests for SplitSelectStateController

Bug: 181704764

Change-Id: Ice35adb4ea82897f5e2433dc9b93a549f3d511b5
2021-03-15 15:42:32 -07:00
Winson Chung
d7d65aa697 Merge "Limit existing usages of nav bar button alpha to two button mode" into sc-dev 2021-03-14 03:53:25 +00: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
Winson Chung
0acb2807df Limit existing usages of nav bar button alpha to two button mode
Bug: 181206743
Test: Manual
Change-Id: Id63131e9aae36bb143d6a4807ef37f96dfa05be9
2021-03-11 21:47:58 -08: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
462384dbed Merge "Create a new DragOptions for every drag operation" into sc-dev 2021-03-10 21:35:06 +00:00
Sunny Goyal
b5181c8c39 Revert "Revert "Removing insets controller animation as part of ..."
Revert "Revert "Moving insets animation to StateHandler so that ..."

Revert submission 13823490-revert-13810332-insetcontroller-CLXXLCZAUM

Reason for revert: Fixed original error in ag/13823726
Reverted Changes:
Ie19a3fd90:Revert "Moving insets animation to StateHandler so...
I4eb33772a:Revert "Removing insets controller animation as pa...

Change-Id: I7fb395c51ea99081913bc99515257e98c0a32754
2021-03-10 07:39:12 +00:00
Pasty Chang
13358f65ab Revert "Removing insets controller animation as part of all-apps..."
Revert "Moving insets animation to StateHandler so that it can b..."

Revert submission 13810332-insetcontroller

Reason for revert: QsbLayout#getEditText() return object is changed, but extended class HotseatQsbWidget wasn't updated.

https://android-build.googleplex.com/builds/submitted/7197042/aosp_crosshatch-userdebug/latest/view/logs/build_error.log

Reverted Changes:
If6a088d14:Removing insets controller animation as part of al...
I296415604:Moving insets animation to StateHandler so that it...

Change-Id: I4eb33772acd887d6e1d92a9ecde41cf1e0687896
2021-03-10 06:58:51 +00:00
Tony Wickham
90351c208e Create a new DragOptions for every drag operation
Previously we were reusing the same DragOptions which led to some
bad states.

Test: Drag items around, ensure nothing disappears from Workspace
Bug: 182079330
Change-Id: I8d6027bc984db8c770841bb560735604689ad0ff
2021-03-09 18:52:44 +00:00
Sunny Goyal
0724113b3d Removing insets controller animation as part of all-apps opening
Adding support for easier extension of StateHandlers

Bug: 180143210
Test: Verified on device
Change-Id: If6a088d1482c9b268b21786c4694f6e0927be0c3
2021-03-08 18:38:25 -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
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
Sunny Goyal
b245c552d4 Updating predictions if hotseat items get removed/added as a result of model callback
Bug: 179284787
Test: Verified on device
Change-Id: Iecfc7f291f54aacccc6d2afe674ccd2f20e2035d
2021-02-03 12:57:03 -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
Jorim Jaggi
6478fa649a Migrate FrameTracker to use ST Jank information (2/2)
Test: FrameTrackerTest
Test: Systrace, perform CUJ
Bug: 174755489
Change-Id: I6abecbd9b244f443c9df389938d82427f9584037
2021-01-13 09:17:18 -08:00
Sunny Goyal
9b1e77377b Removing shelf from 2-button gesture mode
Test: Manual
Bug: 175137718
Change-Id: Ifb64b4dcac53252aefa8ee0bd6434f90f1d868b7
2021-01-05 19:07:21 +00:00
Sunny Goyal
fee1b25fee Fixing PendingArgs not cleared when going home
Bug: 174781600
Test: manual
Change-Id: I2f192b0f60d843b49b290fa70b76f562fca81e36
2020-12-14 12:30:47 -08:00
Sunny Goyal
986ea0da60 Fixing Robolectic model tests
Some tests were broken because of refactoring in LauncherModel.

Change-Id: I55aa32d75a4d16338796a1b1765717fd72ba4b33
2020-11-12 01:01:55 +00:00
Sunny Goyal
8cadc1281f Using UI_HELPER_THREAD for various activity manager interactions
Bug: 170648272
Change-Id: Iec36389be5d747c5dc4d2bb2a8138758d48efa53
2020-11-04 14:29:59 -08:00
Riddle Hsu
979da64d82 Add app start source info of apps launched from launcher
Bug: 166614700
Test: Enable statsd log: "adb shell cmd stats print-logs"
      adb logcat | grep statsd | grep "(48)"
      The line may contain 0x100000->1[I] 0x110000->10[I]
      that means 1=from launcher and 10=latency 10ms.
Change-Id: Iddaff7066b66e241ba58ec87129ddbe2c531dc7e
(cherry picked from commit 7bdf3574a3)
2020-10-09 17:21:38 +00:00
vadimt
b8a30ef68a Adding jank tracing for some CUJs
Test: checking traces

Bug: 169220800
Bug: 169220955
Bug: 169221267
Bug: 169220924
Bug: 169220843
Change-Id: Ia32635764c78139f7e9a616c9fe70ae1a507c1b2
2020-09-28 20:59:14 +00:00
Sunny Goyal
0fc3d1275a Moving hotseat predictions to ModelDelegate
Bug: 160748731

Change-Id: I8db7856a17e0b6ca45b4d5ec3513f788f22db11a
2020-08-17 08:43:07 -07:00