Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e239309 authored by Shamali Patwa's avatar Shamali Patwa Committed by Android (Google) Code Review
Browse files

Merge "Fix issue that old search results list show up momentarily" into 24D1-dev

parents 40d01308 335fdf31
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -541,6 +541,14 @@ public class WidgetsFullSheet extends BaseWidgetSheet
    public void exitSearchMode() {
        if (!mIsInSearchMode) return;
        onSearchResults(new ArrayList<>());
        WidgetsRecyclerView searchRecyclerView = mAdapters.get(
                AdapterHolder.SEARCH).mWidgetsRecyclerView;
        // Remove all views when exiting the search mode; this prevents animating from stale results
        // to new ones the next time we enter search mode. By the time recycler view is hidden,
        // layout may not have happened to clear up existing results. So, instead of waiting for it
        // to happen, we clear the views here.
        searchRecyclerView.swapAdapter(
                searchRecyclerView.getAdapter(), /*removeAndRecycleExistingViews=*/ true);
        setViewVisibilityBasedOnSearch(/*isInSearchMode=*/ false);
        if (mHasWorkProfile) {
            mViewPager.snapToPage(AdapterHolder.PRIMARY);