Commit Graph

118 Commits

Author SHA1 Message Date
Hyunyoung Song
d0eb878d90 Merge "Add 16dp between nav bar and container by setting extra padding to the recyclerView." into main 2024-04-04 18:33:52 +00:00
Fengjiang Li
01cc273537 Add LAUNCHER_ALL_APPS_SEARCH_BACK jank instrumentation
Bug: 330405993
Test: prefetto trace TBD
Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TEAMFOOD
Change-Id: I1fb2876fb29bc360cbb8dc8c1605215f28383c3c
2024-04-01 11:12:50 -07:00
Brandon Dayauon
136f9d6f8a Move adding views logic to privateProfileManager
- Have the animation happen according to the state of private space.
- Have the transition happen only once by setting the current transition to null at the end of transition and by ensuring
where the transitions are allowed.
- Removing controller class.

- The onClick controls the enablement of the profile. On reset (when getting the transition) is what controls the animation
during expand.

tldr- In the collapse case:  execute() is called -> animation happens  -> addPsHeader
tldr- Expand case: post() is called -> addPsHeader -> animation happens.

Collapse:
onClick() -> AACV.onAppsUpdated() that resets & apply/RUNS runnable because EXECUTE
-> AAList.onAppsUpdated() (which is called at the same time animating happens which we should cancel and do at end callback)
-> AAList.onAppsUpdated() gets called again

Expand:
onCLick() -> AACV.onAppsUpdated() that resets & apply runnable
-> AAList.onAppsUpdated() (no animation running)
-> AAList.onAppsUpdated() (no animation running)
-> addPrivateSpaceHeader
-> then unlockAction() runnable because its posted at this point

bug: 326206132
bug: 330444548
bug: 299294792
Test: manually locally and presubmit: https://screenshot.googleplex.com/9wavvwKQ8hY6oUw & https://screenshot.googleplex.com/BiqmidLFjPwS28j
video: https://drive.google.com/file/d/1XGhmTncdUFtJj188_l7alGyyNz_fhXNw/view?usp=sharing

Scrolling fix before: https://drive.google.com/file/d/1XykDm4UELoCvcwZdj8ZlJ6TszptB8W0W/view?usp=sharing
scrolling fix after when not a lot of apps: https://drive.google.com/file/d/1Y4VY1eX7WE8ShSLXRrT56ieBdAuJo_zn/view?usp=sharing
scrolling fix after with a lot of apps: https://drive.google.com/file/d/1Y58c-Z9xnU1GILp0Ih-oLORXYkMB-jWn/view?usp=sharing
Flag: ACONFIG com.android.launcher3.Flags.private_space_animation

Change-Id: I8d03ae60e2c9fe0ec145c4b0a2e9604b9e6e9017
2024-03-28 17:39:42 -07:00
Brandon Dayauon
bdb5836ada Add 16dp between nav bar and container by setting extra padding to the recyclerView.
bug:298593161
Test: manual:
(Adjusting bottom padding of recyclerView):
3button nav after closed: https://drive.google.com/file/d/1xTXtzOC-n3_vGXs34FjL_52jiY60piAA/view?usp=sharing
3button nav after opened: https://drive.google.com/file/d/1xS4Wu41-4ogYzVRh1UxDW39DZW214vSz/view?usp=sharing
gesture nav after closed: https://drive.google.com/file/d/1xQGL-Qi5sGwWqQsOLQAsvxpNlJGklBSg/view?usp=sharing
gesture nav after opened: https://drive.google.com/file/d/1xQ9YNUv89RsT9Tsa85BlEt64twDHk-l6/view?usp=sharing

(USING DIVIDER METHOD):
3button nav after closed: https://drive.google.com/file/d/1YG1pFmU4023-wO2okC_wkwsW5L8IUTkl/view?usp=sharing
3button nav after opened: https://drive.google.com/file/d/1YCBIqzFkxNH9fNuE0o2YTz_221ZRAmSA/view?usp=sharing
gesture nav after closed: https://drive.google.com/file/d/1YIBRglQk6SsSe7_nbggcQZBE7aERGT74/view?usp=sharing
gesture nav after opened: https://drive.google.com/file/d/1YGzbgQPRFKhuSZ95BF6fx_8NfPyocCxN/view?usp=sharing
Flag: ACONFIG com.android.launcher3.Flags.enable_private_space

Change-Id: Ibfd4896c1477b3e498389d6451ca458a01d98952
2024-03-27 11:01:22 -07:00
Brandon Dayauon
a7bd5cf6ee Merge changes I209e3ec7,If70df129 into main
* changes:
  Change collapse to use adapterItems instead of getting the childCount()
  Upon expanding, expand just enough so the header shows.
2024-03-13 22:49:02 +00:00
Brandon Dayauon
d0bec45d37 Upon expanding, expand just enough so the header shows.
This issue only happens when there is a lot of private space apps that scrolling to the bottom
will not sure the private space header.

Formula to calculate how many rows to scroll to =
	(appListHeight - privateHeaderHeight - headerProtectionHeight) / cellHeight.

bug: 299294792
Test:
manually - https://screenshot.googleplex.com/76UJPT2Jnpnp2Ab
before: it just scrolls all the way to the bottom
after: https://drive.google.com/file/d/1AbprxFm1RWTQKvpt7M4khbUfc1o6-XGF/view?usp=sharing
after PHONE WITH TABS:
2x2- https://drive.google.com/file/d/1SLPsWPHenCuZuisiS7HeEy5JwtNPeONs/view?usp=sharing
3x3- https://drive.google.com/file/d/1SK82jeNZMzFJK2odIuHnfTNLYfppne83/view?usp=sharing
4x4- https://drive.google.com/file/d/1T7EhFRq2tDv2zYIvs_FMsTKcFZXwGUaD/view?usp=sharing
4x5- https://drive.google.com/file/d/1SMUPuKjO1Yg36U6P6cDOb6dTkHn6Bh7D/view?usp=sharing
5x5- https://drive.google.com/file/d/1SJCQn1O_Yq5P7C__VUfZHc5I67CEdIpb/view?usp=sharing

AFTER PHONE NO TABS:
2x2: https://drive.google.com/file/d/1THU2xrAIt0hTmN5_GwBrgN9Lqj-W4Kfr/view?usp=sharing
3x3: https://drive.google.com/file/d/1TPTUx7PcHW3GsVwVAg_L5rCcn0QYoiY2/view?usp=sharing
4x4: https://drive.google.com/file/d/1TWVWpAX6bZp_JfFKtmXYO0askl4e5qKO/view?usp=sharing
4x5: https://drive.google.com/file/d/1TDJK-swmY3Y3C4ARH_2eljqUkBGEnD3e/view?usp=sharing
5x5- https://drive.google.com/file/d/1TBJtAynwvZrGyOc-29f637wyrJZpMXBJ/view?usp=sharing

Tablet:
landscape: https://drive.google.com/file/d/1SfyPdoUnCV7e7BWLnpxXWN2HiBOQkRo2/view?usp=sharing
portrait: https://drive.google.com/file/d/1SgZq0iE9WMvIFtc8mBb577nYlS9jBa_g/view?usp=sharing
Flag: ACONFIG com.android.launcher3.Flags.private_space_animation TRUNKFOOD

Change-Id: If70df1299572f8f2edc6376dd2a6df5d74287264
2024-03-06 18:04:09 -08:00
Fengjiang Li
cad1f13d27 [Predictive Back] Fix predictive back swipe on task bar all apps [1/n]
For taskbar all apps, the background scrim is child view of AbstractSlideInView, thus scaling AbstracSlideInView during PB swipe will scale down background scrim. There is no need to re-apply scale effect on background scrim separately.

Bug: 327490078
Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TEAMFOOD
Test: manual
Change-Id: I125670d14bc788664a1371008589e4106496ae2e
2024-03-05 14:02:45 -08:00
helencheuk
bbd54b3e32 Draw focus outline in search app result
Before:
https://screenshot.googleplex.com/9qoPoBNZkDY94gy
https://screenshot.googleplex.com/7XVFxwj8d6UqLUs
https://screenshot.googleplex.com/4KtQcma26eSdBnb

After:
https://screenshot.googleplex.com/BxfNAJGqXhyGBbJ
https://screenshot.googleplex.com/8EMKUQW4ubXHdDd
https://screenshot.googleplex.com/32KBfdj4preL8H6

Bug: 319454774
Test: Manual, open all apps, type some word and press enter to search. Navigate to the search result below and outline should appear
Test: will add screenshot test in b/318360469
Flag: ACONFIG com.android.launcher3.enable_focus_outline Development
Change-Id: I8caef8dd9e590d43e05baa78cebee73d21b84acf
2024-02-07 15:07:43 +00:00
Andy Wickham
36e4d966a7 Re-apply all apps insets when unfolding.
Previously, if insets had been applied while folded ("phone"),
they would stick around when unfolding ("tablet").

This applies the intended 0 left/right margins when in "tablet"
mode regardless of the insets.

Fix: 321159393
Test: Open all apps in phone landscape, unfold
Flag: NA
Change-Id: Ida1f20711a2a2b9b54f6b2c18abf5abf4fd2b175
2024-01-29 15:53:12 -08:00
Brandon Dayauon
aa9005612b Change expand animation for private space container.
Only scroll to bottom. Don't use the animation.

bug: 299294792
test: manual:
video: https://drive.google.com/file/d/134Mq0MX0xauRfkNv8LGXOZgweRjqrmTa/view?usp=sharing
Flag: ACONFIG com.android.launcher3.Flags.private_space_animation TEAMFOOD
Change-Id: Ie6666638a53e334bddb1700674c2c49eb5788a06
2024-01-23 11:47:27 -08:00
Himanshu Gupta
ce495f13e3 Adding suport for Private Space QsTile fulfillment.
Adding logic to unlock private space and
scroll to the container after unlock event
is received by Launcher.

This change also moves pieces of Private Space
Animation to different classes, in order to make
it more robust.

Bug: 289024009
Test: atest PrivateProfileManagerTest
Flag: ACONFIG com.google.android.apps.nexuslauncher.inject_private_space_tile TEAMFOOD
Change-Id: Ica2fbc00ff3516ed5aca7fbbfc0bd2aa036a4cee
2024-01-15 18:43:27 +05:30
Anna Zhuravleva
29a3139815 Add shortcut to install an app to Private space
Introduce long-press shortcut to install a copy
of the main user app to private space.

Test: manual, installed apps in different stores
and tried shortcut
https://screenshot.googleplex.com/6oAVamTytiYmvPC.png
Bug: 316118005
Flag: ACONFIG com.android.launcher3.Flags.enable_private_space_install_shortcut DEVELOPMENT

Change-Id: I702cd2a27388e3cc6e9e126308d5479836ba6655
2024-01-11 12:40:28 +00:00
Andy Wickham
99d7d4f2cb Better handling of insets for All Apps.
Changes:
 - For tablet, always center All Apps without applying additional
   insets for things like cutouts.
 - For tablet, allow the panel to span the full height of the
   screen (minus system bars), rather than 5.5 app rows. This also
   ensures the panel fully closes even if there are cutouts.
 - Remove additional padding for vertical bar mode (landscape on
   phones). This was double counting the cutout insets, but only
   for some views, so things were not aligned. Now the apps line
   up with the search bar, and the scroll bar still makes room for
   any side insets.

Before and after examples:
https://drive.google.com/drive/folders/1k0vSzisf4ZuGyp-qR-IF0QwM-IcHBFrZ?resourcekey=0-uxjzuVQ1KA3WwOQ4v6Dh2w&usp=drive_link

Bug: 299923399
Bug: 259617884
Fix: 300761324
Test: Manual
Flag: NA
Change-Id: I136d516260a1343b1198693c73fa389fe0e11cc9
2024-01-03 19:21:01 +00:00
Brandon Dayauon
763e40d747 Move UnionDecorationHandler to Launcher
- Create base SectionDecorationInfo.java and RecyclerViewAnimationController.java
- SearchTransitionController now inherits from RecyclerViewAnimationController where RecyclerViewAnimationController will control
animation for private space

Bug: 299294792
Test: Verified SearchTransitionController didn't regress by turning off BACKGROUND_DRAWABLES flag.
- Verified QL highlight still works
- video: https://drive.google.com/file/d/15yjBWofebn6m7VgEnLK6kEYqhC_adJQ3/view?usp=sharing

Flag: None
Change-Id: If34f4bb199be0e113485279931d2927cb9fad397
2023-12-11 11:27:25 -08:00
Holly Sun
454590d7ea [PS] Add emphasized interpolators when clicking the PS tile to scroll to bottom.
UX spec: https://carbon.googleplex.com/google-material-3/pages/easing-and-duration/tokens-specs/bd8df608-11ee-48f9-b93d-90d74e3d35c8#5fa37127-0934-4c47-804e-cb2fbf47f73d. Use the first column "Emphasized" one.
Duration: 500ms

video: https://drive.google.com/file/d/1EYlkWVgiYFy0IB5WnQRVoQ9b_sbEkLj7/view?usp=sharing

Bug: 309522136
Test: manual
Flag: ACONFIG com.google.android.apps.nexuslauncher.inject_private_space_tile DEVELOPMENT
Change-Id: I178c075ebf5db8338f476d0607caabec7b8c7fde
2023-11-27 16:42:33 -08:00
Holly Jiuyu Sun
1459fd831c Merge "[ps] Add helper function to scroll a recycler view to bottom and resetAndScrollToPrivateSpace." into main 2023-11-17 21:33:46 +00:00
Holly Sun
d670f3032f [ps] Add helper function to scroll a recycler view to bottom and resetAndScrollToPrivateSpace.
Bug: 309522136
Test: manual
Flag: ACONFIG com.google.android.apps.nexuslauncher.inject_private_space_tile DEVELOPMENT
Change-Id: I96a1eed97dd1e4626ddc5ad42c029d94eb174f00
2023-11-15 10:33:22 -08:00
Himanshu Gupta
739b3c9f22 Enabling Private Space Container in Launcher.
This CL adds the following:
1. Adds filtering and addition of Private Profile apps in main user
all apps recycler view
2. Enables decoration of Private Profile apps
3. Enables hiding Private Space container based upon a settings entry.

Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Bug: 289223923
Test: Ran Launcher3 tests
Change-Id: I33dc55a3a39e75d3fc336ca6a488b282e2dd322c
2023-11-15 15:08:59 +00:00
Himanshu Gupta
08badb3f6f Adding Private Space views to Launcher.
This CL adds the following:
* Static View Elements to be added to AllApps recycler View
* View Controller to load the above elements dynamically
* Private Space Section Decorator
* PrivateProfile Manager containing the logic related to Private Space
* Abstract UserProfileManager as the super class of Work/Private
ProfileManager

Private Space Views Figma
[link](https://www.figma.com/file/K6bIIcG882EiJNjxvSWsFT/V%E2%80%A2-Private-Space?type=design&node-id=14535-111985&mode=design&t=JLz9W0O551TpzQYH-0)

Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Bug: 289223923
Test: Ran Launcher3 tests
Change-Id: I8aa4247c78064a551e5e0d0b46d3fc033873f99d
2023-11-14 11:58:16 +00:00
Pat Manning
da5baa981a Merge "Fix focus nav of AllApps when Searching." into main 2023-11-10 18:20:01 +00:00
Pat Manning
e7cb65009e Fix focus nav of AllApps when Searching.
- Do not focus the Icon in Small Icon Result Rows
- Use FocusIndicatorHelper when focusing search result icons

Flag: NONE
Bug: 296844600
Fix: 310173226
Test: Test: TaplKeyboardFocusTest
Change-Id: Icfc82ae41ffc8ef7c7ad42950f98f3d2dc805795
2023-11-10 16:48:21 +00:00
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
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
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