Merge "Fix focus nav of AllApps when Searching." into main

This commit is contained in:
Pat Manning
2023-11-10 18:20:01 +00:00
committed by Android (Google) Code Review
2 changed files with 45 additions and 1 deletions

View File

@@ -1046,6 +1046,11 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
return getActiveAppsRecyclerView();
}
/** The current focus change listener in the search container. */
public OnFocusChangeListener getSearchFocusChangeListener() {
return mAH.get(AdapterHolder.SEARCH).mOnFocusChangeListener;
}
/** The current apps recycler view in the container. */
private AllAppsRecyclerView getActiveAppsRecyclerView() {
if (!mUsingTabs || isPersonalTab()) {
@@ -1442,6 +1447,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
final AlphabeticalAppsList<T> mAppsList;
final Rect mPadding = new Rect();
AllAppsRecyclerView mRecyclerView;
private OnFocusChangeListener mOnFocusChangeListener;
AdapterHolder(int type, AlphabeticalAppsList<T> appsList) {
mType = type;
@@ -1465,7 +1471,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
onInitializeRecyclerView(mRecyclerView);
FocusedItemDecorator focusedItemDecorator = new FocusedItemDecorator(mRecyclerView);
mRecyclerView.addItemDecoration(focusedItemDecorator);
mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener());
mOnFocusChangeListener = focusedItemDecorator.getFocusListener();
mAdapter.setIconFocusListener(mOnFocusChangeListener);
applyPadding();
}