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
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
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
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
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
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
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
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
This will be called when transition animation to search is completed.
Bug: 285166099
Flag: NA
Test: Manual
Change-Id: I69e594cbf3564a866d258654fc23a00410e7deab
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
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
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
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)
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
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
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
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
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
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
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