Commit Graph

21 Commits

Author SHA1 Message Date
Brandon Dayauon
77374930a7 Fix fastscroller not resetting when switching tabs.
Whenever fastscroller is binded, reset the scroll position so its at the top.

bug: 335520751
Test video manually:
before:https://drive.google.com/file/d/1MOE0LOL8G5pmhJYf61y9jw2nDVXIvaAs/view?usp=sharing
after: https://drive.google.com/file/d/14Yi6JRMvDhDZKNwusv75DtfeGk1A4W23/view?usp=sharing
Flag: NONE bugfix

Change-Id: I7aea9a7fe5582fbb61e979f375191980c8a7e0ad
2024-09-18 10:01:22 -07:00
Brandon Dayauon
1f8f88696b Create an alpha letter scroller
- The function used is a raised cosine function to determine the sections to animate.

Tested flag: adb shell device_config put launcher com.android.launcher3.letter_fast_scroller true
Based on recent figmaspec, size of selected letter is 28dp and regular is 20dp. That means scaling should be 28/20.
Colors are:
onSurface for letter
surfaceContainer for background.
Figma shows selected colors are materialColorOnSecondary

bug:358673724
Test manually: https://drive.google.com/file/d/1gvJd5KoK8X_Sv8jXg1cZ65R4AuqHuvcd/view?usp=sharing
Flag: com.android.launcher3.letter_fast_scroller

Change-Id: Ia86eb0e8c41bc043fda3c44aeaf59e204429f337
2024-08-26 11:21:26 -07:00
Anushree Ganjam
5c4ea5b0ca Remove debug logs
Bug: 339737008
Test: Manual
Flag: TEST_ONLY
Change-Id: I8177fc721f330267bc20abf6e7d587289e45477b
2024-08-07 14:08:10 -07:00
Anushree Ganjam
f828683fa8 Add debug logs to print stack trace for Private space flaky test.
From the failure test videos, it looks like scrollToTop gets called https://b.corp.google.com/issues/339737008#comment15.

Bug: 339737008
Test: Manual
Flag: TEST_ONLY
Change-Id: I61a95ff45fa4409f8f1b243ac435002556a16677
2024-07-10 13:44:11 -07:00
Brandon Dayauon
a1af2cee1c Instead of popup to show letters, show private space icon on fast scrolling
Use spannableString to show the icon instead of regular letters for the private space icons.

bug:304752744
Test manual: https://drive.google.com/file/d/1LFy4-bu69Kuo8eV4erjJOsbkiQJs09kC/view?usp=sharing
Flag: None

Change-Id: I149d7aba6b0a4fdafacd2684e56827c7e1b9d724
2024-04-17 12:37:38 -07:00
Brandon Dayauon
08b06523a5 Collapse private space container and animate header.
- Just opposite of how it will expand.
- RecyclerView.SmoothScroller is needed to scroll the container.

- Need to separate the lock button because this way I can use animateLayout changes and it itself was its own drawable. Separated into icon and textView in a viewGroup.
- Give the background the 10padding on the left and right so that when in animation, the icon can adjust the padding/margins there.
- Using propertySetter to set animation
- Animates the alpha of the settings alpha

- updated test to account for the nested child views the test needs to inspect

bug: 299294792
test: manual:
Expand + Collapse Video: https://drive.google.com/file/d/1Og66eqmXv3THn0wO4_x6Tfp2AbwFWUwZ/view?usp=sharing
Flag: ACONFIG com.android.launcher3.Flags.private_space_animation TEAMFOOD

Change-Id: I96f1d172a481522d23b4cee996ddec65961fce78
2024-02-16 21:23:51 -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
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 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
Jagrut Desai
311d519292 Fix TaplTestsNexus#testSearchForApp
This cl is 1/2 part change

We are currently getting StaleObjectException when running this test.
We want to implment a synchoronized event beetween test and launcher,
so we know that search result adapter is done updating and page will
get no more updates of search results.

Test: Presubmit
Bug: 232008758
Flag: not needed
Change-Id: I40cf9b83d231a2487220aabc8f8e8c3ca71f255c
2023-09-13 11:09:05 -07:00
Sunny Goyal
4d18ad4825 Simplifying some scrollbar binding logic in all-apps
Bug: 256684299
Test: Manual
Change-Id: I1cee6cb783f0f805d9a0f0a4b2b668a709cacf1a
2023-02-17 12:28:46 -08:00
Federico Baron
4b1a38bb7d Implement two pane widget picker
The widget picker design is currently not optimized for large screen form factor devices.
We resolve that by adding a two pane widget picker like that of the design in go/widget-picker-2023.

Bug: 256684299
Test: Make sure to be on a tablet in landscape mode.
        1.Turn on flag LARGE_SCREEN_WIDGET_PICKER.
        2. Press and hold on an empty spot in workspace until the popup menu appears.
        3. Click widgets.
        4. Notice the new two pane layout
Change-Id: Ia3ea17dc320f72f9bc5dea52399ff51d9161602b
2023-02-09 16:36:45 -08:00
Andy Wickham
03fdeb7684 Move search bar background protection on top of scrollbar.
This way the search bar looks more connected to the keyboard
without the scrollbar showing next to it.

Note: Here the search bar is added on top of all other views
(previously it was inserted above only the header), and the
protection is always added just behind the search bar.

Also adjusts the height of the scrollbar to end above the search
bar when floating search bar is enabled.

Screenshots:
Scrollbar behind search bar: https://drive.google.com/file/d/10ZJ-q5nA9ZBjr7gjoauTDDAbQRUNk7S7/view?usp=share_link&resourcekey=0-pF6eOcuKz2_sCA_eZpa1Sw
New scrollbar height with floating search: https://drive.google.com/file/d/1fVIJjiG7RMme5fBXiSJmxNfOhHJ__Gwj/view?usp=share_link&resourcekey=0-b9RsB7f55U_rIZBu4IhVGQ

Fix: 265478433
Test: With and without floating search and always-on keyboard and
work profile.

Change-Id: I4f7ae0d376dae215c0cbd8deaee3e4a409d21ae4
2023-01-25 13:42:35 -08:00
Sunny Goyal
f34811d3a3 Revert "Revert "Updating the scroll calculation from recyclerView to avoid view inflation""
Test: ABTD
https://android-build.googleplex.com/builds/abtd/run/L52600000956969786

This reverts commit cee6ddf3de.

Reason for revert: Fixed in ag/20239136

Change-Id: I0e8446e66d9a86a94b40fcbd6de14da07abe8e5c
2022-10-22 15:37:47 +00:00
Hui Kang
cee6ddf3de Revert "Updating the scroll calculation from recyclerView to avoid view inflation"
This reverts commit 20bbe95ddb.

Reason for revert: Causing flake in Ironwood test: b/248295569

Test: ABTD
Before: Flaky, 14/50 PASSED
https://android-build.googleplex.com/builds/abtd/run/L33900000956890639

Revert: 50/50 PASSED
https://android-build.googleplex.com/builds/abtd/run/L49200000956887317

Change-Id: I41f4428c74e581323f90c716a7852b5e553ae27d
2022-10-17 20:37:49 +00:00
Sunny Goyal
20bbe95ddb Updating the scroll calculation from recyclerView to avoid view inflation
> Updating the LayoutManager's scroll calculation instead of a separate
  implementation to better support recyclerView's calculations
> Caching the view sizes during layout to avoid view-inflation for
  unknown types
> Fixing scrollbar jump during scroll when widget list is expanded
> Fixing scrollbar never reaching end when onboarding card is displayed
  in work tab

Bug: 240343082
Test: Verified on device that new views are not inflated
Change-Id: Ied11ccf65b053691c5c126c4bf8de306ec24786d
2022-09-12 12:24:34 -07:00
Andy Wickham
87a9bf7c15 Only bind fast scrollbar when attached if not already bound.
This was overriding the previously bound RecyclerView if multiple
were attached simultaneously. Instead, the appropriate container
(All Apps / Widgets) should bind the active RecyclerView whenever
it changes, with the onAttach serving as a fallback to ensure
the scrollbar has an initial RV to avoid NPEs.

Fix: 234591523
Bug: 235476489
Test: Manually checked All Apps from Launcher and Taskbar, as well
as Widget bottom sheet. Also ran relevant Tapl tests.

Change-Id: I06e27d2f66f9778087711a566817b6806ec7218b
2022-07-27 21:02:34 +00:00
Sunny Goyal
bbad97e273 Unifying scroll calculation logic for both widgets and apps recycler view
Also using itemType instead of item object for widget size cache

Bug: 234008165
Test: Verified on device
Change-Id: Ia4b4a00a11627c0c454e4a699570e8ab1667a390
2022-06-16 16:03:37 -07:00
Andy Wickham
2ba7797edb Moves Search results into a separate RV (take 2).
Bug: 206905515
Test: Manually verified b/230648542 did not resurface. Tested
on phone and tablet with and without work profile.

Change-Id: If724f635286b9dff2c64255f9ece3568a5cb4ea9
2022-05-24 17:10:24 -07:00
Anushree Ganjam
5cc7ff0990 Revert "Refactors Search results into separate RV for Toast."
This reverts commit 6729f0b950.

Reason for revert: This change caused b/230648542.

Please see https://b.corp.google.com/issues/230648542#comment5 for the video after reverting this change.

Bug: 206905515
Bug: 230648542

Change-Id: I85f063c56cad137c05b810204244bba7e8f94ee7
2022-04-28 01:37:49 +00:00
Andy Wickham
6729f0b950 Refactors Search results into separate RV for Toast.
This will help enable transitions between A-Z apps lists and
search results because both can be seen simultaneously and
manipulated independently.

Some high level items of the refactor:
 - SearchRecyclerView is added; logic that populated the main
   (personal) tab with search results was simply redirected to
   this RV instead.
 - BaseAllAppsContainerView added isSearching() method. Returns
   false, and ActivityAllAppsContainerView overrides (as search
   is handled there).
 - Renamed BaseRecyclerView to FastScrollRecyclerView to better
   describe what it does. SearchRecyclerView extends this, but
   returns false for supportsFastScrolling().
 - AlphabeticalAppsList#mAllAppsStore is now optional, so the
   Search RV doesn't need to store/listen to apps. Note this
   doesn't affect the predicted app row which is still updated
   if one of the predicted apps is uninstalled (I tested this).

Future work:
 - Determine why dispatchRestoreInstanceState is not called for
   BaseAllAppsContainerView. Save is called, e.g. on rotation.
   Effect of restore not called: rotating while searching goes
   back to A-Z list.
 - Keep suggested apps in Header while searching. Currently they
   are rendered in the SearchRV above search results, as before.
 - Potentially extract Personal/Work tabs to move independently of
   header.
 - AlphabeticalAppsList is a misleading name because it can also
   contains search results. However, things are pretty intertwined
   between that and BaseAllAppsAdapter (effectively a circular
   dependency), so I figured cleaning all that up was out of the
   immediate scope of this refactor, which is mainly meant to
   unblock transition work.

Bug: 206905515
Test: Manually checked for regressions, ran tests.
Change-Id: I4d3757c8a8f9b774956ca6be541dd4fcdad1de13
2022-04-24 17:36:48 -07:00