Commit Graph

63 Commits

Author SHA1 Message Date
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 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
Sunny Goyal 936cd17a11 Merge "Simplifying some scrollbar binding logic in all-apps" into tm-qpr-dev 2023-02-22 18:09:32 +00:00
Andy Wickham 5969e0524a Merge "Reset fast scroller when All Apps resets." into tm-qpr-dev 2023-02-17 23:57:56 +00: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
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
Andy Wickham 82ab3fb3e3 Reset fast scroller when All Apps resets.
This ensures the scrollbar is not left in a bad state, in
particular if you close All Apps while still scrolling (e.g.
pressing the Home button while holding the scroll bar).

Fix: 267583704
Test: Manual
Change-Id: I0e159f8e5ed289bf1628f77eab1879743b5aea00
2023-02-13 13:32:09 -08: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