Commit Graph

149 Commits

Author SHA1 Message Date
Thales Lima
a25cd90b5e Center AllApps on the screen
AllApps used workspace paddings which are unbalanced in verticalBar. This changes it to always be centered. In dynamic grid AllApps now uses the whole width for the layout. In responsive grid it keeps the cell width and center the layout.

Note that this is centered on the screen but nothing could be done regarding the camera inset at this time, as it would need a refactor of how AllApps QSB is layout as well.

Bug: 269632571
Test: NexusLauncherTest
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Change-Id: I326d041bcef211d398d1a5c3210958b689414d49
2023-11-08 14:39:52 +00:00
Himanshu Gupta
9aab4d4603 Adding Prework for Private Space integration in Launcher
This Cl adds the following:
1. Fixes for Quite Mode check maintained by Launcher
2. Addition of new Quite Mode broadcasts
3. Fixes for determining work profile user correctly.

Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Bug: 289223923
Test: Ran Launcher3 tests
Change-Id: I5f6158b213723339e70ff99e66c5f439f5879e12
2023-11-05 12:31:10 +00:00
Thales Lima
b433c9c312 Change AllApps padding to use a Rect
AllApps uses different values for left and right padding in some places (e.g. ActivityAllAppsContainerView uses workspacePadding.left/right), and this change is the first step into moving those values into DeviceProfile.

Bug: 269632571
Test: NexusLauncherTest
Flag: NONE
Change-Id: I14c4edf55ca74f256b1aaa336fff246a0c78e25d
2023-10-31 16:19:40 +00:00
MrSluffy
19bf26dd5a Merge branch 'aosp-13' into 13-wip 2023-10-21 09:52:01 +08:00
Fengjiang Li
25eac1381f Double pre-inflate counts if work profile is enabled
When work profile is enabled, we will show 2 all apps recycler views, thus we should double the pre-inflated BubbleTextView count to make sure scrolling both personal and work all apps is smooth.

Traces are attached in bug.

Fix: 287462835
Test: Grab perfetto traces and compare scrolling all apps on phone with work profile enabled vs disabled
Change-Id: Iaa68ddacad0abcca0f260dd7fa21c92d2feabb03
2023-10-05 14:53:30 -07:00
Brandon Dayauon
c8af851e99 Fix gray work apps when WorkPausedCard shoul've shown
The reason is because WorkManager doesn't reset when user searches (which is why the apps gray out when you go to toast, turn off work profile then back gesture to all apps)

Added test for ActivityAllAppsContainerView that test onAppsUpdated() and check for if there are work apps.
From the test environment, onAppsUpdated() needs to be public because the method is outside the package. However, I've wrapped onAppsUpdated package private so I can test it with a boolean parameter.

bug: 298492729
test: video:
before: https://drive.google.com/file/d/1D0VlGeJEI5lGbYgP5Tnu5UO_Dv61X8Dv/view?usp=sharing
after: https://drive.google.com/file/d/1D0qsq7sX_kAp2t92xser7YI4ADBhQfHY/view?usp=sharing
Change-Id: I4eb7cf21e273e29171fcd62a4762e8bb1778e720
2023-09-22 17:18:10 +00:00
Anushree Ganjam
8a6b74e51b Move aconfig files to aconfig folder
- Set packageName as com.android.launcher3
- Follow folder structure as per go/sysui-aconfig-structure

Bug: 294913042

Test: adb shell device_config put launcher com.android.launcher3.enable_all_apps_rv_preinflation true

Flag: enable_all_apps_rv_preinflation

Change-Id: Ib45a24d9100b657e7776c6120bdf9625533e9ed7
2023-08-28 18:27:11 -07:00
Anushree Ganjam
d1a28fe08d Add Launcher aconfig.
Use `enable_expanding_pause_work_button` as an example.

See go/trunk-stable-launcher for implementation details

Bug: 294913042

Test: adb shell device_config put launcher com.google.android.platform.launcher.aconfig.flags.enable_expanding_pause_work_button true

Flag: enable_expanding_pause_work_button
Change-Id: I732722c8b219c023adf5bf31f132ce9da72fc4d5
2023-08-24 11:11:02 -07:00
Holly Sun
19f6525546 Refresh mNumAppsPerRowAllApps when device profile changes.
The return value of SrollableLayoutManager#getItemsHeight is wrong, which is caused by the return value of `incrementTotalHeight` (https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:packages/apps/Launcher3/src/com/android/launcher3/util/ScrollableLayoutManager.java;l=151-163). In AllAppsGridAdapter#incrementTotalHeight (https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:packages/apps/Launcher3/src/com/android/launcher3/allapps/AllAppsGridAdapter.java;l=172), `item.rowAppIndex` is still the staled value after app grid change / device fold & unfold. This value is calculated in AlphabeticalAppsList (https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:packages/apps/Launcher3/src/com/android/launcher3/allapps/AlphabeticalAppsList.java;l=276-280). The mod `mNumAppsPerRowAllApps` is staled. So add an setter in `AlphabeticalAppsList` to update `mNumAppsPerRowAllApps`.

Bug: 262003765
Bug: 284940820
Test: manual
Flag: N/A
Change-Id: I74a99a3dc58ee45f066bcefb3e9c56be02b62f82
2023-08-03 09:39:18 -07:00
Fengjiang Li
068df4c1ca Merge "Make AllAppsRecyclerViewContainer GONE when hidden" into udc-qpr-dev 2023-07-31 20:27:21 +00:00
Fengjiang Li
df59c2e535 Make AllAppsRecyclerViewContainer GONE when hidden
Test: N/A
Flags: ALL_APPS_GONE_VISIBILITY
Bug: 264341825
Change-Id: I28933c08e80b95bcd5031da9869b37f34f6408b2
2023-07-31 10:41:58 -07:00
Anushree Ganjam
135eee0410 Post the mSearchUiManager.resetSearch() to next frame.
SearchBox gets cleared in the current frame even before we read the
input entered by the user. So clear the searchbox in next frame after
onAllAppsTransitionEnd is completed.

See ag/22266746 where this change was introduced and I want to move the resetSearch() call to next frame.

Bug: 287693114
Test: Manual . Tested with both Floating search box on and off.
Flag: NA

Change-Id: I11509cf652f96847ad3c54f20a76f2a728775fe3
2023-07-25 22:34:54 +00:00
Fengjiang Li
82ddd8ac97 Merge "Fix bug where all apps rv preinfaltion is not enabled when work profile is disabled" into udc-qpr-dev 2023-07-19 20:03:48 +00:00
Fengjiang Li
bafbdfbfd6 Fix bug where all apps rv preinfaltion is not enabled when work profile is disabled
When work profile is disabled, we should also let main RV use AllAppsStore's recycler view pool.

Test: Turn off work profile, kill launcher process, swipe up all apps, start record perfetto trace, scroll down all apps, then stop record, verify no BubbleTextView inflation after change
Bug: 287523421
Flags: ENABLE_ALL_APPS_RV_PREINFLATION
Change-Id: Idd5f8193e85fc2a250877affc3b2e4ab4a704797
2023-07-18 14:05:36 -07:00
Anushree Ganjam
660679f91f Introduce onAnimateToSearchStateCompleted() in SearchUiDelegate.
This will be called when transition animation to search is completed.

Bug: 285166099
Flag: NA
Test: Manual
Change-Id: I69e594cbf3564a866d258654fc23a00410e7deab
2023-07-18 02:16:42 +00:00
Becky Qiu
ca4e39d402 Fix the issue that on tablet/unfold, the allapps background color is wrong.
As the new spec, it should use materialColorSurfaceDim for all devices.

Bug: 288493929
Test: manual, before: https://screenshot.googleplex.com/7YxpFGekwm6Gz6N, after: https://screenshot.googleplex.com/44Gr2dBfWSct7FK
Flag: no flag needed.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:aa6612d3731a3e98f716747b0ede473e3bbca161)
Merged-In: Ic33d9a758fe9fbaa0f735c874a545df711a18e2f
Change-Id: Ic33d9a758fe9fbaa0f735c874a545df711a18e2f
2023-07-14 01:59:24 +00:00
Becky Qiu
5bcd1ca3d6 Fix the issue that on tablet/unfold, the allapps background color is wrong. am: aa6612d373 am: 64746f8a29
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/24030571

Change-Id: I9f00b40302eba3683f2260f5efa5e5dbc3566f38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-13 20:09:01 +00:00
Becky Qiu
64746f8a29 Fix the issue that on tablet/unfold, the allapps background color is wrong. am: aa6612d373
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/24030571

Change-Id: I513daa1fdeb8d5582bd0cec9b8b2eb4d043f2543
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-13 19:02:27 +00:00
Becky Qiu
aa6612d373 Fix the issue that on tablet/unfold, the allapps background color is wrong.
As the new spec, it should use materialColorSurfaceDim for all devices.

Bug: 288493929
Test: manual, before: https://screenshot.googleplex.com/7YxpFGekwm6Gz6N, after: https://screenshot.googleplex.com/44Gr2dBfWSct7FK
Flag: no flag needed.
Change-Id: Ic33d9a758fe9fbaa0f735c874a545df711a18e2f
2023-07-12 00:25:58 +00:00
Brian Isganitis
e9eacb38fa Cleanup raw usage of AllAppsStore.
Test: Compiles
Bug: 287523421
Flag: No
Change-Id: I35cdb1b281f251b74305129b583f29cdb29e15a6
2023-07-11 18:41:45 -04:00
Brian Isganitis
f54c6fa4b4 Revert "Revert "Provide AllApps item OnLongClickListener through ActivityContext.""
This reverts commit 853a5b9e0c.

Fixes SecondaryDisplayLauncher class by using lambda instead of method
reference for #getAllAppsItemLongClickListener. This change is necessary
because mDragLayer is late-init.

Test: Home Settings > Developer Options > Launch Secondary Display
Bug: 289261756
Flag: No
Change-Id: I7b83f81651dde360edea6ee7bea6cc82441e6bef
2023-07-11 13:21:47 -04:00
David Saff
853a5b9e0c Revert "Provide AllApps item OnLongClickListener through ActivityContext."
This reverts commit 0acab2532d.

Reason for revert: b/290403189

Change-Id: Ie3f67f78a8ffce8c2d5a92f65a7e74d788c82a81
2023-07-11 10:45:33 +00:00
Brian Isganitis
0acab2532d Provide AllApps item OnLongClickListener through ActivityContext.
This cleans up how alternative AllApps implementations such as Taskbar
and SecondaryDisplay override the default INSTANCE_ALL_APPS listener.
This change will also be helpful for Toast in Taskbar drag-n-drop.

Test: Manual
Bug: 289261756
Flag: n/a
Change-Id: I55eb881bcd1e210852d435a3ea2a6686ce0a9838
2023-07-06 22:12:20 +00:00
Vinit Nayak
f6f192853d Cleanup WorkProfileTest logs
Fixes: 243688989
Change-Id: Ic3f143062c1a1383d1e79959dae59c45743547e9
2023-07-05 16:27:11 -07:00
Fengjiang Li
1519c168da Pre-inflate BubbleTextViews into Launcher/TaskBar All Apps RV
This CL ensures no inflation of BubbleTextView happens while binding applications, and reduces jank on slow device.

1. Let active/inactive all apps RVs share the same AllAppsRecyclerViewPool
2. Use worker thread to pre-inflate BubbleTextViews and add them to shared view pool on main thread

Bug: 287523421
Test: See before/after screenshot/video/trace attached in bug
Change-Id: I00213407be2c7c2d329997552785d0aa56c4d057
2023-07-05 13:07:26 -07:00
Brandon Dayauon
dba7359d23 Fix custom buttons with translated string
The reason why the buttons aren't being updated with the translated string is because the cache the views get the string from is not updated/loaded with the new language.
Rather, the update happens after the view has been inflated. With this change, when the string cache updates in bindStringCache(), we update the UI right then.

bug: 280958663
bug: 288442609
test: Manual
Change-Id: I7a49ee401d5a5f3268cfaef1abee8153e913a8ce
(cherry picked from commit 076dcdfd54)
2023-06-28 21:49:25 +00:00
Brandon Dayauon
383cc17a6f Merge "Fix custom buttons with translated string" into udc-qpr-dev 2023-06-14 16:13:48 +00:00
Treehugger Robot
74a27fb3de Merge "Making UserCache the source of truth for all user events" into udc-qpr-dev 2023-06-13 21:55:40 +00:00
Andy Wickham
bd9a180fbc Allow LauncherState to define floating search side margins.
This lets home screen align to workspace icons while All Apps
aligns with those icons. In addition, on tablets where the QSB
is inlined with the hotseat, floating search bar can also move
horizontally accordingly.

Bug: 275635606
Bug: 259619990
Test: Manual on tablet as well as foldable.
Flag: ENABLE_FLOATING_SEARCH_BAR

Change-Id: I67745c66390736cdf39d969ef7767096ae13c671
2023-06-13 00:28:59 +00:00
Andy Wickham
64896f3098 Put the "floating" in ENABLE_FLOATING_SEARCH_BAR.
This means adding the search view to the drag layer, so it can
persist and animate across Launcher states (i.e. Home, All Apps,
Overview, Overview from App).

Some high level things:
 - LauncherState now has a flag indicating if the floating
   search bar should be visible, as well as a method indicating
   how high it should rest when the keyboard is not showing. By
   default the height is set negative if the flag is not present,
   so the search bar will rest off screen in that state.
 - LauncherState also has a new method indicating if the search
   bar should show as a pill when not focused. Currently this is
   done in phone portrait mode in all apps and overview.
 - SearchUiManager now has a method for gestures to hint that
   the search bar will be focused or unfocused soon, e.g. for
   the app -> overview case, we hint that it will be focused
   when crossing the threshold, and unfocused if retracting.
   This allows the search bar to animate during the gesture
   and take or release focus after the state change completes.
 - AllAppsTransitionController lets the apps panel translate in
   from the bottom of the screen, for example when coming from
   an app and we don't want to pop it in halfway up the screen.
   Instead it can slide in gracefully from behind the keyboard
   and floating search bar.
 - KeyboardInsetAnimationCallback can now notify listeners of
   keyboard alpha changes during controlled animations. And
   StateAnimationConfig has a new animation type to control
   the keyboard alpha during the all apps transition.
 - This new ANIM_ALL_APPS_KEYBOARD_FADE is used to pop the
   keyboard in at the threshold for going from an app to all apps.
   Note that its position moves linearly before this, so the
   search bar starts moving up accordingly before the keyboard
   alpha is non-0.

Fix: 266761289
Fix: 268845147
Fix: 267683921
Fix: 265849321
Fix: 266446733
Fix: 269301440
Bug: 275635606
Bug: 259619990
Bug: 261866704
Test: Manual with all the state transitions on phone and tablet
(also folding/unfolding foldable).
Flag: ENABLE_FLOATING_SEARCH_BAR, ENABLE_ALL_APPS_FROM_OVERVIEW
(latter just for the background app interpolator changes).

Change-Id: I6f06552e95747348a62260279626cf407bf145b0
2023-06-12 21:55:24 +00:00
Brandon Dayauon
076dcdfd54 Fix custom buttons with translated string
The reason why the buttons aren't being updated with the translated string is because the cache the views get the string from is not updated/loaded with the new language.
Rather, the update happens after the view has been inflated. With this change, when the string cache updates in bindStringCache(), we update the UI right then.

bug: 280958663
test: Manual
Change-Id: I7a49ee401d5a5f3268cfaef1abee8153e913a8ce
2023-06-12 14:33:08 -07:00
Sunny Goyal
c80e60dc7a Making UserCache the source of truth for all user events
Bug: 243688989
Test: Presubmit
Flag: N/A
Change-Id: I0e6b853d965eff1abaeb3b26dd6b94424e5212df
2023-06-07 20:43:36 -07:00
Brian Isganitis
1fb10991d0 Add All Apps search delegate for inflating search box.
Test: Manual
Bug: 216683257
Flag: not needed
Change-Id: I2e1d9b0abf6d370d7ff6d6af2bab002b87330d86
2023-06-02 15:40:36 +00:00
Brandon Dayauon
6a14189b07 Fix "Pause work apps" button in strange location
The issue why the button sticks up is because of the translation not resetting when closing
All apps.
- This CL resets ime insets and the position of the button to the original location.

bug: 278722407
test: manual - before:https://drive.google.com/file/d/1_L4ICHrt582KcVcpvQDK9HciC_n5eiEy/view?usp=sharing
after: https://drive.google.com/file/d/1_G8-Jd_wdUKjy7vFj6iQ1QmCx_7Qrogn/view?usp=sharing
Change-Id: Ib32b8ef950d03aa812f30c2393e3cad3201c08da
2023-05-31 20:23:26 +00:00
Brian Isganitis
64ee67c6b5 Merge "Add header protection for Taskbar All Apps search bar." into udc-dev 2023-05-04 22:20:46 +00:00
Andy Wickham
830e4b7ce0 Add long swipe from app to overview gesture (with flag).
High level:
 - As you swipe up from an app (OtherActivityInputConsumer),
   a state transition animation to All Apps is created in
   AnimatorControllerWithResistance. The animation is played
   alongside the Recents resistance animation (i.e. past the
   settling point of Overview, which is at mCurrentShift 1).
 - The actual state transition to All Apps only happens if you
   release your finger in the "all apps region." This is set to
   mCurrentShift 2, so double the distance that Overview rests.
 - A haptic plays whenever you enter or exit this region, and
   the all apps animation is set to 0 until the region is
   active. This is so it's clear that something different is
   happening.
 - The panel that was previously used for tablets is now used
   for phones during this transition. It comes in at full
   opacity when you enter the region, and the contents (apps
   and search suggestions) fade in as you continue swiping.
 - The only gesture that is recognized in the all apps region
   is a fling downwards, which will return you to the previous
   app. Otherwise a left/right/up fling or slow release will
   finish the all apps transition.
 - The threshold is ignored if the flag is disabled (default)
   or if FallbackActivityInterface is active.

Flag:
The threshold is ignored if ENABLE_ALL_APPS_FROM_OVERVIEW is
disabled (default).

Bug: 259619990
Bug: 275132633
Test: Manual with and without the flag enabled
Change-Id: Ie311b77252416d97677b2c56fad61dfd392b6fe8
2023-04-26 10:52:04 -07:00
Holly Jiuyu Sun
7c836923b9 Merge "Override INTERPOLATOR_WITHIN_ALL_APPS when app restarts." into udc-dev 2023-04-21 17:13:03 +00:00
Brian Isganitis
bd114c2241 Add header protection for Taskbar All Apps search bar.
Works similar to ActivityAllAppsContainerView<->ScrimView
implementation, except utilizes AbstractSlideInView's builtin scrim.

Test: Manual
Flag: ENABLE_ALL_APPS_SEARCH_IN_TASKBAR=false
Bug: 216683257
Change-Id: Ide41ac47ecffc232fffac34c6bfdda67c1da549d
2023-04-21 16:16:55 +00:00
Brian Isganitis
93f20cc2d5 Merge "Make navbar scrim taskbar background if taskbar is enabled." into udc-dev 2023-04-05 23:58:01 +00:00
Andy Wickham
764c21b207 Don't return early if searching during rebindAdapters().
This was a rare case (made less rare by rocket gesture) which was
not actually updating the UI correctly.

Expected flow:
 1. All Apps is inflated with a single recyclerview for apps (as
    defined in xml).
 2. Later, rebindAdapters() is called, and if there are work apps,
    the recyclerview is removed and replaced by a viewpager with 2
    children recyclerviews (one for personal and one for work).
 3. At any point if you start searching, the app rv or viewpager
    is hidden and the search rv is shown.

Actual flow in the error case:
 - Same as above, but if you were searching when 2 happens, we
   returned early, so we never replaced the app rv with the
   viewpager, so all the apps were dumped in the single rv, and
   the header with tabs showed above it.

Fix: 272575605
Test: Manually force first rebind ta happen while searching, and
verify this bug was hit before the fix but not after.

Change-Id: I25b8991564645368840a390733aa893dee4cd10e
2023-04-04 14:46:26 -07:00
Holly Sun
7877060d68 Override INTERPOLATOR_WITHIN_ALL_APPS when app restarts.
Bug: 225185551
Test: manual. See video https://drive.google.com/corp/drive/u/0/folders/1g-YlbzdHh49SH0f4xLli4BmVqPCP6K49
Flag: the flash issue is only for QS Tile under ENABLE_QS_TILES(OFF)
Change-Id: Ib282148bc0a4943c91b5ebd3c78b7128d5d66c9d
2023-04-03 13:12:04 -07:00
Andy Wickham
ce6aeca494 Merge "Don't move down all apps container when touching near scroll bar." into tm-qpr-dev am: 30c2bdda52 am: c5f8dff8e2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22342811

Change-Id: Idbd08d300cb38d13b0b1a44507fe2d0f8356ecf8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-31 23:57:59 +00:00
Andy Wickham
30c2bdda52 Merge "Don't move down all apps container when touching near scroll bar." into tm-qpr-dev 2023-03-31 23:01:25 +00:00
Brian Isganitis
13e672aa76 Make navbar scrim taskbar background if taskbar is enabled.
This ensures the navbar buttons are visible on large screens where All
Apps or Widgets picker are bottom sheets.

Test: Scrim is taskbar background color on devices with taskbar.
Bug: 264463659
Change-Id: I37890c0f542db625f9aeae7648bbaed064c4d240
2023-03-31 16:40:49 -04:00
Andy Wickham
23f7d82831 Don't move down all apps container when touching near scroll bar.
Previously we were using any touch outside of the panel to move
the container, but we want to check this last, after checking if
the touch is near the scrollbar (in which case it should intercept
instead).

Test: Manual
Flag: N/A
Fix: 236661990
Change-Id: I518c546356d1f6c6cedf4b31fa621295dd090175
2023-03-29 22:04:11 +00:00
Brian Isganitis
d43d7c3702 Clean up device profile change listeners for AllApps.
Test: https://b.corp.google.com/issues/260177372#comment1
Bug: 260177372
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d17261029af89ef03b860686d1d3c6651e7c8e13)
Merged-In: Ic7417980e8280bf2fcb110e5de74ea2ae59d9b74
Change-Id: Ic7417980e8280bf2fcb110e5de74ea2ae59d9b74
2023-03-29 18:46:47 +00:00
Brian Isganitis
d17261029a Clean up device profile change listeners for AllApps.
Test: https://b.corp.google.com/issues/260177372#comment1
Bug: 260177372
Change-Id: Ic7417980e8280bf2fcb110e5de74ea2ae59d9b74
2023-03-29 14:18:14 -04:00
Fengjiang Li
751d1475be Merge "[Predictive Back] Add extra bottom space in taskbar all apps to home" into udc-dev 2023-03-16 00:46:42 +00:00
Fengjiang Li
11f873da0b [Predictive Back] Add extra bottom space in taskbar all apps to home
Bug: 272797556
Test: manual
Change-Id: Ie84117d4211c382544c9ed8e1226bf70b2bd382d
2023-03-15 10:14:48 -07:00
Vinit Nayak
7a68378fe4 Add debug logs for WorkTabExists test
Bug: 243688989
Change-Id: Iafec4cae86f1527acac9a25fceb501609ca308f6
2023-03-13 14:27:55 -07:00