Commit Graph

45 Commits

Author SHA1 Message Date
Fengjiang Li
56ebfc4900 Merge "[Predictive Back] Widget to home polish: show extra rows at bottom during animation" into tm-qpr-dev 2023-02-16 19:40:24 +00:00
Fengjiang Li
cb640da2bb [Predictive Back] Widget to home polish: show extra rows at bottom during animation
1. setClipChildren(false) for WidgetFullSheet and content view during animation
2. setClipToOutline(true) for WidgetsRecyclerView and provide ViewOutlineProvider to expand bottom by 5% of height
3. Override calculateExtraLayoutSpace() for ScrollableLayoutManager
4. Manually modify AbstractSlideInView#mContent's background drawable during scale animation

bug: b/260956481
Test: manual

Change-Id: Ic391639de887cf4a70bc4965dc0b1fd9bc12dd2c
2023-02-15 15:33:29 -08:00
Luca Zuccarini
190992e6fb Merge "[Toast] Disable decorator updates if background drawables are used." into tm-qpr-dev 2023-02-15 11:37:11 +00:00
Fengjiang Li
ab04ffb491 [Predictive Back] All apps to home on tablet
Scale down bottom sheet background during predictive back on tablet

Test: manual
Bug: b/267226579, b/267226556
Change-Id: Ie67689a05d631a480bcc2ae602b5caf4feaf8182
2023-02-10 00:53:12 +00:00
Luca Zuccarini
9395830195 [Toast] Disable decorator updates if background drawables are used.
These lines cause an NPE when using Toast after toggling the flag.

Bug: 268470113
Test: manual
Change-Id: I3b2b162cde37fe780580872e015672c0c9339e4f
2023-02-09 13:18:00 +00:00
TreeHugger Robot
3c86d903a6 Merge "[Predictive Back] Revert all apps scale when exiting from search" into tm-qpr-dev 2023-02-08 00:38:11 +00:00
TreeHugger Robot
4a2bf3b131 Merge "Update tests to support floating search." into tm-qpr-dev 2023-02-06 23:50:49 +00:00
Andy Wickham
8d004b0f49 Update tests to support floating search.
Tests need to be updated to account for the new placement of the
searchbar because it overlapped with touch events for scrolling:
 - Scroll back to top: Instead of scrolling from the top of the
   container which could overlap status bar in landscape, scroll
   from the bottom of the top-most visible app icon.
 - Scroll down: swipe up from bottom padding to top of top-most
   visible icon.
 - Close all apps: swipe down more quickly from top icon insetad
   of the search bar (more quickly helps it be detected as a
   fling on more cramped devices).

For Launcher3, the floating flag is not fully supported yet, so
there were some layout issues which are now resolved by ignoring
the flag if the searchbar is still at the top.

Fix: 268052768
Test: Ran tests, manual
Change-Id: If54717e2835c7cc4ed1368554bbc493193945c1d
Merged-In: I406fbcbe12acddb1dd4b862a380576a48cabbebc
2023-02-06 13:49:14 -08:00
Fengjiang Li
d080b98b76 [Predictive Back] Revert all apps scale when exiting from search
Bug: b/267522879
Test: manual, see before after videos in bug
Change-Id: I7b14739fee23a22920d71841fc1c3c12b34a3d0c
2023-02-03 10:28:46 -08:00
Fengjiang Li
0510c290a0 Merge "[Predictive Back] Hide inactive recycler view when work profile is enabled on tablet" into tm-qpr-dev 2023-02-03 18:01:24 +00:00
Fengjiang Li
a007740815 [Predictive Back] Hide inactive recycler view when work profile is enabled on tablet
This CL will make sure scale animation doesn't reveal the offscreen main/work recycler view on tablet in all apps to home transition

Bug: b/267226558
Test: manual, see before/after video in bug
Change-Id: I9a8add0ac2c902e3f4315de099939f9297f6604a
2023-02-01 10:18:52 -08:00
hyunyoungs
5654d6a63b Fix missing item decorator for the search recycler view
Bug: 267200724
Test: manual
Change-Id: Ibae6607cb4473d986f48b6aed3f2ef98c3857399
2023-01-31 00:56:17 -08:00
Andy Wickham
275b80e687 Merge "Move search bar background protection on top of scrollbar." into tm-qpr-dev 2023-01-28 01:35:24 +00:00
Sunny Goyal
150b7b0497 Merge "Removing unnecessary abstraction of AdapterProvider" into tm-qpr-dev 2023-01-27 21:40:27 +00:00
Sunny Goyal
49d153e4bf Removing unnecessary abstraction of AdapterProvider
Bug: 266605714
Test: Presubmit
Change-Id: Ib5ccecc33e66e61cb27d083591c8fb7c13a96698
Merged-In: Ib5ccecc33e66e61cb27d083591c8fb7c13a96698
2023-01-27 16:55:55 +00: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
Andy Wickham
62ef7ba819 Merge "Fix header padding when search not enabled." into tm-qpr-dev 2023-01-25 19:10:09 +00:00
Sunny Goyal
34c499dc84 Merging unnecessary subclass of ActivityAllAppsContainerView
Bug: 266605714
Test: Presubmit
Change-Id: I87272ee827055f58f91a4ad9fb25d5351d453cdb
2023-01-24 13:01:00 -08:00
Andy Wickham
ad753607d2 Fix header padding when search not enabled.
This was specifically affecting taskbar all apps with
floating search bar enabled. Header placement should not
be changed in that case.

Fix: 266440950
Test: Manual in taskbar and other all apps surfaces with and
without work profile, floating search flag on and off.

Change-Id: I2296a079cc15387a517c61e6b8a21fa0081cba23
2023-01-23 10:49:15 -08:00
Sunny Goyal
adb364a104 Unifying multiple all-apps implementations
> Using a single layout for the all-apps content
> Removing some unnecessary themes
> Fixing search chashes in SecondaryDisplayLauncher

Bug: 259733681
Test: Existing TAPL tests verify that Launcher/AllApps work properly
Change-Id: Icd5310316499cd421bc039cdbd4d398b813cd477
2022-12-14 11:27:12 -08:00
Andy Wickham
29b95b58ba Merge "Adds header protection on tablet all apps panel." into tm-qpr-dev 2022-12-12 19:08:37 +00:00
Sunny Goyal
54fa110bba Removing some unnecessary interfaces and merging them to ActivityContext
Bug: 259733681
Test: Everything compiles
Change-Id: If6b530f6e589a851cf8554f5de0849843bd66dd4
2022-12-08 10:15:55 -08:00
Andy Wickham
0adad24408 Adds header protection on tablet all apps panel.
Removes background and manually draws it while drawing scrim. Then
draws header protection on top as needed.

Currently this only applies to all apps from Launcher, as Taskbar
doesn't seem to use the same scrim flow. So taskbar adds the same
static background that was previously used.

Demo videos: https://drive.google.com/drive/folders/11PyFsrLV6-QhU_E-zD3s5bfzZK2nOU87?resourcekey=0-E41uw5TP9xuqTifLAs71yw&usp=sharing

Test: Manually on phone and tablet with dark/light mode, floating
search bar on/off, work profile present/absent, taskbar/home entry
Bug: 240670050

Change-Id: I81dcc956d9dbbc7552c8a227a49741bcf71eed71
2022-12-06 18:31:33 -08:00
Andy Wickham
493831af1a Fixes for floating search bar (e.g. background protection).
- Adds background protection for the search bar
 - Views animating based on keyboard now support manual swipes.

Bug: 213954333
Bug: 259004115
Bug: 251460671
Test: Manual
Change-Id: I055766126fb46a8e8b48907e442c9e54aaa4badf
2022-12-06 17:59:53 -08:00
Brian Isganitis
deac0d529a Reduce top padding of Taskbar's All Apps tray.
The top padding looks too high because the code is assuming we have a
search bar at the top of the bottom sheet. Until we implement search, we
should temporarily reduce padding for the taskbar implementation.

Before:
  - No tabs: https://screenshot.googleplex.com/AAPdR5nbwepWQ82.png
  - Tabs: https://screenshot.googleplex.com/3DnQp6PKhqXyRag.png

After:
  - No tabs: https://screenshot.googleplex.com/A8enwnSs8r78ccj.png
  - Tabs: https://screenshot.googleplex.com/A3fAy2bXgmSPrG9.png

Test: Manual
Bug: 216683257
Change-Id: Ie0837acc3aed162b9428a209962be2a102c515c8
2022-12-01 00:21:28 +00:00
Anushree Ganjam
6024013953 Add SearchResultCode to onSearchResult()
Bug: 204781396
Test: Manual
Change-Id: Ia776be0fdd42e1d5fa405911e28d9b0a12c1fdde
2022-11-11 18:26:58 +00:00
Hyunyoung Song
64d5e25ab7 Merge "Fix the case of the missing header." into tm-qpr-dev 2022-09-22 15:45:22 +00:00
Andy Wickham
30b87aad7d Fix the case of the missing header.
We should not override the tabs based on the search state now
that they are hidden (but still active) during the animation.

For an explanation of why this fixes the issue, please see
https://b.corp.google.com/issues/247615711#comment15.

Fix: 247615711
Test: Manually with predicted apps being updated every second
(part of the way I found to repro the bug).

Change-Id: I5ba45c42726c34f471a7743c06aecc05c89f6105
2022-09-21 17:04:48 -07:00
Holly Sun
98d6a4027a Clear the staled mFocusedView when toast surface is closed.
Test: manual
Bug: 224756660
Change-Id: Iadce94f9138ee375fa9b6e3ef8fb685847312045
2022-09-16 14:28:23 -07:00
Andy Wickham
94d5d3cb6c Support for animating A-Z <-> Search.
Demo videos (1/5 speed) and APK: https://drive.google.com/drive/folders/1qQNzcoibiFMzxYhvXc7UEHCaBhJg6SjN?resourcekey=0-OWD06iLXg3wf_eWce4rUPA&usp=sharing

Bug: 234882587
Bug: 243688989
Test: Manually tested a bunch of cases at 1/10 animation speed.
Such as work profile or not, suggested apps enabled/disabled,
typing during the animation, going back during the animation,
web results injected above apps, etc.

Change-Id: Id4f1a858d387bf3a7f9cf2d23564a276544abef1
2022-09-09 15:37:57 -07:00
Sunny Goyal
af95ddbadc Fixing search behavior in Launcher3
> Showing no-result found only when there are no results
> Removing unnecessary view inflation in RecyclerViewPool for
  various search vide types
> Removing unused market-search link and no-empty-result illustration

Bug: 240343082
Bug: 207573083
Test: Verified Launcher3
Change-Id: Ia44799cd2385ea5dc837ef25732ca237975abde7
2022-07-28 22:05:30 -07:00
Jon Miranda
f58db150af Play fallback animation if icon in All Apps is covered by header.
Bug: 230707341
Test: enter all apps
      scroll so icon is covered by header
      open app, swipe back to return to all apps
      confirm fallback animation plays

      repeat but scroll so icon is not covered by header
      confirm normal animation plays

Change-Id: I56cda07f3eccc11e8909f7fb28210f65cc6e0f1d
2022-06-02 16:06: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
Sunny Goyal
3c5a08ada1 Implementing support for item diffing instead of creating out the
complete UI on every update

Bug: 229860311
Test: Verified locally
Change-Id: I5712b5d76878a0ed72cc1392ede59b3778b7a1dc
2022-05-03 16:24:46 -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
Luca Zuccarini
0c3961c367 Refactor the floating header's positioning.
Maintains the existing behavior while simplifying the overall layout.

See go/all-apps-qsb-positioning for details.

Bug: 221418522
Test: manual
Change-Id: I25a737cdfa431e8eb3a00b639984caed70819252
2022-03-29 10:18:33 +00:00
Brian Isganitis
5eb66d8abb Refactor ActivityAllAppsContainerView to depend on ActivityContext.
All of the all apps search support is in this class which is also being
refactored to depend on ActivityContext. At the end of this refactor,
this class can be merged with BaseAllAppsContainerView.

Test: Manual
Bug: 216683257
Change-Id: I8cbf21c8d9ce97cc60e9846cfe8c2a7bcb800a01
2022-03-18 10:36:15 -07:00
Brian Isganitis
f477ec2032 Refactor allapps.search package to depend on ActivityContext.
Test: Manual
Bug: 216683257
Change-Id: I6230498b24380b37531f8a83db1dc768270e708a
2022-03-18 10:35:10 -07:00
Abhilasha Chahal
9c7096c8ac Revert "Revert "Extract out common adapter logic to support diff..."
Revert^2 "Fixing AdapterItem import"

1a27c278d6c6594b552b620b4d2b67e68bef23f2

Change-Id: Ia3bf9f0b3aaff0d1e2d102320e917462b38935b2
2022-03-09 17:45:45 +00:00
Sam Dubey
4f1a232cca Revert "Extract out common adapter logic to support different Al..."
Revert "Fixing AdapterItem import"

Revert submission 17044827-tm-dev-216150568

Reason for revert: Broke builds
Bug: 223609269
Reverted Changes:
I53eba3c8c:Fixing AdapterItem import
I1068e75d0:Extract out common adapter logic to support differ...
I24d8e54e8:Fix AdapterItem imports

Change-Id: I931c666db7dcb2c8eef1894b56b59ed688218def
2022-03-09 17:25:15 +00:00
Abhilasha Chahal
6badc405ad Extract out common adapter logic to support different AllApps layouts
Test: Manual tests. Refactoring, all existing tests should pass.
Bug: 216150568
Change-Id: I1068e75d0b4a33d402a7d68e237d2484ab3a1e01
2022-03-01 13:08:54 +00:00
Brian Isganitis
099945b075 Add predictions row to taskbar all apps.
- We need to listen to DeviceProfile changes in case the number of
  columns changes in the grid. I made an interface/mixin separate from
  ActivityContext to avoid polutting the latter with too many things. I
  also applied this change to existing taskbar A-Z grid.
- Added all apps visited count to onboarding preferences for only
  showing "All Apps" label in place of divider 20 times. Label is also
  tracked on taskbar side and should be kept in sync.

Test: Manual
Fix: 216843395
Bug: 174174514
Change-Id: I97aa91397c334123626caf18251f19e17c7104fb
2022-02-14 11:24:16 -08:00
Andy Wickham
cf462e879a Adds ENABLE_FLOATING_SEARCH_BOX flag for All Apps.
This defines how the All Apps screen should be laid out without
anchoring to the search bar at the top, as follows:
 - Header view aligns to the top instead of below search bar.
 - Same for A-Z list.
 - Scroller is aligned to the header view to receive the above
   adjustments automatically.
 - A-Z list is set above search bar to not peek from below.
 - Search bar is set to align parent bottom and translates up
   with the keyboard.
 - Button to disable work apps is raised above the search bar.

Bug: 213954333
Test: Manually with flag enabled/disabled, Always show keyboard
enabled/disabled, and work profile enabled/disabled.

Change-Id: If90bb39a890029fa7056367fe62bad0677f0b86e
2022-02-03 17:12:22 -08:00
Brian Isganitis
1664c9f418 Refactor all apps to depend on activity context.
The current AllAppsContainerView has been split into a base class and a
subclass for activities. The base class allows using all apps with an
activity context. A-Z and work profile tabs are supported, but search
and the hotseat still require an Activity.

Test: Manual. All apps should work the same.
Bug: 204696617
Change-Id: I3b146714bc11b3b3555d97623aab5d78ac836482
2022-01-24 20:24:20 -05:00