mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
[reset] Remove redundant calls in resetAndScrollToPrivateSpaceHeader.
1. When a user clicks a PS tile, fast scrolling is already end. 2. When a user clicks a PS tile, it should be in the search RV, so no need to handle header. 3. We need the `animateToSearchState` with 0 time because the one inside `resetSearch` with 300ms delay will conflict with the following scrolling to bottom. When `resetSearch` is called after `animateToSearchState(0)` finishes, the inside `animateToSearchState(300)` is just a no-op and return early, so we won't have redundant call. Bug: 328505782 Test: manual Flag: aconfig com.google.android.apps.nexuslauncher.enable_inject_private_space_tile nextfood Change-Id: Ied9f96c276c8f7707c672425bebe81e72e0d3bae
This commit is contained in:
@@ -499,18 +499,15 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
* Exits search and returns to A-Z apps list. Scroll to the private space header.
|
||||
*/
|
||||
public void resetAndScrollToPrivateSpaceHeader() {
|
||||
if (mTouchHandler != null) {
|
||||
mTouchHandler.endFastScrolling();
|
||||
}
|
||||
|
||||
// Reset the base recycler view after transitioning home.
|
||||
updateHeaderScroll(0);
|
||||
|
||||
// Animate to A-Z with 0 time to reset the animation with proper state management.
|
||||
// We can't rely on `animateToSearchState` with delay inside `resetSearch` because that will
|
||||
// conflict with following scrolling to bottom, so we need it with 0 time here.
|
||||
animateToSearchState(false, 0);
|
||||
|
||||
MAIN_EXECUTOR.getHandler().post(() -> {
|
||||
// Reset the search bar after transitioning home.
|
||||
// When `resetSearch` is called after `animateToSearchState` is finished, the inside
|
||||
// `animateToSearchState` with delay is a just no-op and return early.
|
||||
mSearchUiManager.resetSearch();
|
||||
// Switch to the main tab
|
||||
switchToTab(ActivityAllAppsContainerView.AdapterHolder.MAIN);
|
||||
|
||||
Reference in New Issue
Block a user