Commit Graph

55 Commits

Author SHA1 Message Date
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
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
Tony Wickham
d844fe758c Remove ENABLE_OVERVIEW_ACTIONS flag, defaulting to true
We no longer support the "peeking" model where the shelf would
peek on motion pause from an app and overview would peek on motion
pause from home. Thus, removed/inlined the following:
- FlingAndHoldTouchController (merged into its sole subclass
  NoButtonNavbarToOverviewTouchController)
- ShelfPeekAnim
- OverviewPeekState

Change-Id: I066a3ad2636fde4786089c922b896bf1e03361fd
2020-08-14 15:58:29 -07:00
Sunny Goyal
30ac97d938 Adding home animation support for non-system Launcher
When user swipes up to home, Launcher will receive a onNewIntent
callwith a bundle-extra gesture_nav_contract_v1. It will contain
the componentName & UserHandle of the closing app & a callback.
Launcher can use the callback to return the final position where
the app should animate to and an optional surface to be used for
crossFade animation. The surface cleanup can be handled in
onEnterAnimationComplete.

Change-Id: I76fdd810fdcb80b71f7d7588ccac8976d9dfe278
2020-07-21 11:43:21 -07:00
Pinyao Ting
9d51e49cec Fixes the issue Launcher state propagation is slower than onDeferredResume.
There's currently a bug prevents Launcher release drag lock for two step
widgets. Supposedly, onDeferredResume should release the drag lock; However,
in 3-button navigation mode, the transition from Overview -> Normal is
triggered in Launcher#onNewIntent, which happens after onDeferredResume.

This issue is not reproducible with gesture navigation because its
transition from Overview -> Normal is handled in NavBarToHomeTouchController

Test: manual verified with following steps
1. Enable 3-button navigation
2. Long press in WorkSpace -> Widgets
3. Drag Settings Widget to WorkSpace
4. When the config activity is shown, press "recents" button to see Overview
5. press "home" button to go back to workspace
6. repeat 2 and 3, verify the widget can be dragged
Bug: 149659788

Change-Id: I396ffa8a7db44bf3872a10de4208340a99a7efe8
(cherry picked from commit 3bf889a02f)
2020-07-13 21:46:05 +00:00
Jon Miranda
36d1015997 Add depth animation when multiwindow mode changes.
This is a workaround until we can support app transitions when starting
an activity in mw mode.

Bug: 158613217
Change-Id: I843d6669722c543728ab532e1c4fbd4643f6f135
2020-06-19 16:36:57 -07:00
Samuel Fufa
5b2da14e72 Show discovery tip for hybrid hotseat
Doc: go/hybrid-hotseat-tips

Issue 157683315: for fully populated hotseat, count returns to home screen and show discovery tip if Tip action was not tapped.
Issue 158301717: Don't use cached items if client has predicted items.

Test: Manual
Change-Id: I4747a1148caa62a6262fb6592d5185bdf216ede6
2020-06-10 15:12:55 -07:00
Becky Qiu
70ff0c1144 Revert "Revert "[Overview Actions] UI update for Landscape.""
This reverts commit 4dfcbec512.

Reason for revert: Fix the margin issue by handling the bottom
insets ourselves.

Change-Id: Ic01cadbbe847e419af8bb444ad57764e719152c3
2020-06-08 21:18:18 +00:00
Becky Qiu
4dfcbec512 Revert "[Overview Actions] UI update for Landscape."
This reverts commit 160ca4b8a2.

Reason for revert: Got issues like b/158318606 when switch nav modes, also the margin seems not set properly. And this doesn't work for 3 button mode too. Would switch to just use task menu for all.

Change-Id: I645f2a2a9032ae99799c75bcc6c983c1bbfd8df8
2020-06-06 00:04:47 +00:00
Becky Qiu
160ca4b8a2 [Overview Actions] UI update for Landscape.
1. When home screen rotation is allowed, we still have action buttons for landscape, but remove bottom margin to shrink the UI.
2. When home screen rotation is not allowed, we do in-place rotation for overview, where we won't show action buttons.

Test: see demo video: https://drive.google.com/file/d/1G6ihv_DOykx1MLpFAQf3VJHq3D1HotnX/view?usp=sharing
Bug: 153736749

Change-Id: Ia1c7ef8c245ac13bf50adf32ee5114f23e491e75
2020-06-03 14:21:08 -07:00
Winson Chung
034ce6fd94 Update shelf offset earlier when in gesture nav
- Provide a hint to Launcher to indicate it will be resumed when
  swiping home, which allows us to notify sysui before any potential
  pip invocation, reducing the likelyhood of two conflicting animations
  when entering pip

Bug: 156637223
Change-Id: Iae773e1aac88bbea6f74e1d1332417b448126471
2020-05-14 10:55:14 -07:00
Sunny Goyal
35e7d38681 Abstracting out state handler logic into base classes so that it can
also be used in different activity

Change-Id: Ic5e60b21e1429c71f1cd4e7041e70bf4fc9761b7
2020-05-11 16:38:26 -07:00
Becky Qiu
7d12134240 [Overview Actions] Change actions view UI based on different nav modes.
1. Change the overview actions container to 66dp height.
2. For 3 button mode, container will have 8dp bottom margin.
3. For gesture mode, container will have 16dp bottom margin.
4. Action buttons and close button will always be in the center vertically.

Spec: https://docs.google.com/presentation/d/1gXWNdCRXvXuEhgDmE0TX2KYqCxIQBXVtWKdl4pKrno8/edit#slide=id.g840c32b190_3_6

Demo:
- 3 button: https://screenshot.googleplex.com/2Y3uMaJMi9E
- gesture: https://screenshot.googleplex.com/XzaKHpp5ke9
Test: tested for both modes and when switch between.
Bug: 155444592

Change-Id: If66d369df0218b7ee2abab8a3f345488bf223b16
2020-05-11 10:46:21 -07:00
Winson Chung
2a00f81327 Account for various launcher states when setting back button alpha
- Previously we only check for the flag which is always true in the
  normal launcher state, so if the animation starts, we could end up
  writing the back alpha value without accounting for window focus or
  any other states that launcher is in that affects back button
  visibility

Bug: 155129739
Test: Open -1 article and hit back
Change-Id: I42d27a192b23f394f8565a6893ce092603e31654
2020-04-30 23:03:52 -07:00
Sunny Goyal
8f96546e79 Generalizing LauncherState definition so that it can be used in RecentsActivity
> Removing 'Launcher' as parameter from state methods called by StateManager
> Converting state properties to methods for easier abstraction
> Moving state handling drom state definition to activity class

Change-Id: I997627df606a7e0bb3bf32688d045a942a47fc94
2020-04-30 01:01:51 -07:00
Becky Qiu
72c53af896 [Overview Actions] Update the navigation mode immediately when switch.
This would fix the issue that overview actions UI visibility was not set correctly.

Test: local
Bug: 152047880
Change-Id: Ia335c5c8947b39e580403090f461f87e78645af1
2020-04-22 15:57:34 -07:00
Sunny Goyal
f2393f1d20 Adding TaskViewSimulator for simulating taskView layout on a remote target
1. Tanslating contents of RecentsView instead of recentsView itself. When
   translating, we keep the current TaskView from moving. This allows
   the remoteTarget to follow an individual taskView.
2. Removing translationY in recentsView and setting the pivot instead
3. Using TaskViewSimulator for swipe handler. This allows using similar
   animation creation as Launcher window animation.

Change-Id: I0b7b16c367d9d8cd8dd0ed59061e46853e2f8c83
2020-04-21 11:16:21 -07:00
Sunny Goyal
01d8541f14 Fixing actions view getting visible sometimes
> Linking actions view to state flags
> Creating multiple visibility channels that can be controlled separately

Bug: 153906903
Change-Id: I33d20f5fdc8bcdf0520dae3aac986548eb7e0058
2020-04-20 09:59:13 -07:00
Tony Wickham
133cd54474 Refactor some onboarding-related shared prefs into a class
Bug: 151768994
Change-Id: I938e23af8c1874714e02fe34d0f9f82bb21d00a2
2020-04-10 21:06:08 -07:00
Sunny Goyal
512a2c1dbe Adding All Apps action even when launcher is not in foreground
> Also avoids additional binder call on resume/pause
> Removes a system API which needs to be mocked for robo tests

Change-Id: I23d0cba62c17f7659121c53d1804df40f5069005
2020-04-09 02:48:40 -07:00
Sunny Goyal
c4d3201538 Removing support for fake landscape
Bug: 111068105
Change-Id: If31d2f700ddee1d21541735de3a8006ee2a53c5c
2020-04-03 17:11:35 -07:00
Sunny Goyal
514dfa2deb Changing actions button visibility to match clear-all button
> Removing translation when animating actions button

Change-Id: I6875e03f9c55f00232c605743348175ea132cb15
2020-03-30 16:46:06 -07:00
Sunny Goyal
284a6cfdd7 Removing base no-op implementation of depth controller
Change-Id: Ibf46c0a147d2772033ad469b803e606376978cd7
2020-03-24 16:11:06 -07:00
Lucas Dupin
4918ed38d2 Add wallpaper zoom to areas that have blur
Whenever blurring, the wallpaper should also zoom out. This is the
mental model of our Depth System.

Test: manual
Bug: 149792636
Change-Id: I1783eb87fefeb6f917f0ba64f2c6ec8f1f2004fa
2020-03-18 13:29:58 -07:00
vadimt
76205b06ed Fixing LauncherAnimationRunning referring a destroyed activity
Bug: 139137636
Change-Id: Id070a98103a7116179e7ee66fabeeb33fb19b1ff
2020-03-13 18:32:46 -07:00
TreeHugger Robot
590914cc5e Merge "Dismisses system overlays for Home intent." into ub-launcher3-master 2020-03-09 22:00:20 +00:00
Andy Wickham
65ced1b1d0 Dismisses system overlays for Home intent.
Test: Used Facebook chatheads (not system bubble).
Before the change, Home gesture didn't work. After
the change, it does work :)
Fixes: 146593239

Change-Id: Ib9c85de2f83f99d1ef53fb17fde5d0b3c514849a
2020-03-07 04:42:32 +00:00
Winson Chung
8687bc2131 Initial changes to support blur
- Add a new controller to update the background blur on either the
  launcher or app surfaces based on state or transition

Bug: 149792636

Change-Id: I6103cd3d53a00c8025558dd49bb73137e2980014
2020-03-06 14:45:20 -08:00
Riddle Hsu
7a7468fd39 Invalidate snapshot of home if its UI is changed
Snapshot may be enabled for home task when turning off
screen. If home UI has changed after screen off, the
snapshot should not be used to avoid ugly visual effect.

Bug: 140811348
Test: Lock/unlock device while home is on top with 4 cases:
      1. All apps is shown.
      2. Overview is shown.
      3. Options menu is shown.
      4. Quick search bar is active.
      The expected result should be no starting window
      when unlocking because the snapshot is dropped.

Change-Id: I4bd9926b6f9332ac16b1b3a25ffdd44706015a33
(cherry picked from commit 0ae61c8d29)
2020-03-05 01:39:18 +00:00
Winson Chung
67457275e0 Merge "Register/unregister all apps system action with accessibility" into ub-launcher3-master 2020-03-05 01:24:03 +00:00
Hongming Jin
d91cb6e75f Register/unregister all apps system action with accessibility
Bug: 136286274
Change-Id: Ia43d30b7cf078f56cc9887c8b3fb31924ad2b1b0
2020-03-04 16:24:05 -08:00
Sreyas
321bfae905 OverviewActions: Creating single view instance.
Makes use of there being a single instance of OverviewActionsView
rather than each Task having it's own.

Change-Id: I881121f84de99cade3cd8f07fa8510a557b28f57
2020-03-04 11:38:59 -08:00
Vinit Nayak
a406f727ad Add vertical layout support for Overview in portrait
WM is making changes which allows apps to maintain
their orientation independent of the orientation of
the foreground app. This allows recents to always start
in portrait even when the app currently running is in
landscape. This means we have to give the illusion of
a landscape oriented overview when user swipes up in
gesterual nav when launcher is started in portrait
configuration.

PagedOrientationHandler abstracts all coordinate specific
logic from Paged/RecentsView primarily, but also all
other dynamic calculations throughout launcher.
PagedViewOrientationState is the single point of exposure
to other classes that depend on those changes. The goal
is to also minimize holding state to allow for default
implementations of PagedOrientationHandler for all the
3p/Fallback classes. PagedViewOrientationState also
holds other data around rotation that isn't
specifically tied to view logic.

The fake landscape overview can be toggled with:
adb shell settings put global forced_rotation [0/1]

Fixes: 146176182
Change-Id: I65d8d4e9f92b93931cbe0053ccaf0cda8d2ffd6c
2020-03-02 18:02:35 -08:00
Sreyas
a241df66df OverviewActions: Creating parent view to house RecentsView and Overview Actions.
Creating RecentsViewHolder to be contain LauncherRecentsView in OverviewPanel so Overview Actions View can be created only once.

Change-Id: I111f88903d2ff80275cc2e07b761577260073c17
2020-02-21 16:14:51 -08:00
Samuel Fufa
13890c08f7 Reset launcher on shortcutconfig activity minimize
Bug: 145021068
Test: Manual
Change-Id: I4fe050c062e04cf195add685ac2e9ae9abcea7c6
2020-02-12 12:50:49 -08:00