mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Merge "[reset] Clean up ActivityAllAppsContainerView#reset." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
6b85675657
@@ -18,6 +18,7 @@ package com.android.launcher3.allapps;
|
||||
import static com.android.launcher3.Flags.enableExpandingPauseWorkButton;
|
||||
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.MAIN;
|
||||
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.SEARCH;
|
||||
import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.WORK;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_PRIVATE_SPACE_HEADER;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_WORK_DISABLED_CARD;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_WORK_EDU_CARD;
|
||||
@@ -470,8 +471,9 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
* @param exitSearch Whether to force exit the search state and return to A-Z apps list.
|
||||
*/
|
||||
public void reset(boolean animate, boolean exitSearch) {
|
||||
// Scroll Main and Work RV to top. Search RV is done in `resetSearch`.
|
||||
for (int i = 0; i < mAH.size(); i++) {
|
||||
if (mAH.get(i).mRecyclerView != null) {
|
||||
if (i != SEARCH && mAH.get(i).mRecyclerView != null) {
|
||||
mAH.get(i).mRecyclerView.scrollToTop();
|
||||
}
|
||||
}
|
||||
@@ -485,10 +487,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
// Reset the base recycler view after transitioning home.
|
||||
updateHeaderScroll(0);
|
||||
if (exitSearch) {
|
||||
// Reset the search bar after transitioning home.
|
||||
// Reset the search bar and search RV after transitioning home.
|
||||
MAIN_EXECUTOR.getHandler().post(mSearchUiManager::resetSearch);
|
||||
// Animate to A-Z with 0 time to reset the animation with proper state management.
|
||||
animateToSearchState(false, 0);
|
||||
}
|
||||
if (isSearching()) {
|
||||
mWorkManager.reset();
|
||||
|
||||
Reference in New Issue
Block a user