commit | 98d6a4027ae62e2a4b9801f017f7f40ea98988de | [log] [tgz] |
---|---|---|
author | Holly Sun <jiuyu@google.com> | Wed Sep 14 14:56:47 2022 -0700 |
committer | Holly Sun <jiuyu@google.com> | Fri Sep 16 14:28:23 2022 -0700 |
tree | 4a90c1893414f98df8389797a219089385136cb5 | |
parent | 455c942fd29c8879b8624ee1c1b3e3e34285057f [diff] |
Clear the staled mFocusedView when toast surface is closed. Test: manual Bug: 224756660 Change-Id: Iadce94f9138ee375fa9b6e3ef8fb685847312045
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index aa9cfd1..c1eaa16 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -84,6 +84,7 @@ /** Invoke when the current search session is finished. */ public void onClearSearchResult() { + getMainAdapterProvider().clearHighlightedItem(); animateToSearchState(false); rebindAdapters(); } @@ -92,6 +93,7 @@ * Sets results list for search */ public void setSearchResults(ArrayList<AdapterItem> results) { + getMainAdapterProvider().clearHighlightedItem(); if (getSearchResultList().setSearchResults(results)) { getSearchRecyclerView().onSearchResultsChanged(); }
diff --git a/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java b/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java index a95bd51..4fb732d 100644 --- a/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java +++ b/src/com/android/launcher3/allapps/search/DefaultSearchAdapterProvider.java
@@ -84,4 +84,9 @@ public RecyclerView.ItemDecoration getDecorator() { return mDecoration; } + + @Override + public void clearHighlightedItem() { + mHighlightedView = null; + } }
diff --git a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java index bc52784..3890741 100644 --- a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java +++ b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
@@ -58,4 +58,9 @@ * Returns the item decorator. */ public abstract RecyclerView.ItemDecoration getDecorator(); + + /** + * Clear the highlighted view. + */ + public abstract void clearHighlightedItem(); }