diff --git a/quickstep/res/layout/taskbar_all_apps.xml b/quickstep/res/layout/taskbar_all_apps.xml
index 34d4b231b1..d402469833 100644
--- a/quickstep/res/layout/taskbar_all_apps.xml
+++ b/quickstep/res/layout/taskbar_all_apps.xml
@@ -33,10 +33,6 @@
layout="@layout/all_apps_bottom_sheet_background"
android:visibility="gone" />
-
-
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
index 51fa4d9f3a..0ea2aa0647 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
@@ -44,10 +44,9 @@ public class TaskbarAllAppsContainerView extends
}
@Override
- protected BaseAllAppsAdapter createAdapter(
- AlphabeticalAppsList appsList,
+ protected BaseAllAppsAdapter getAdapter(AlphabeticalAppsList mAppsList,
BaseAdapterProvider[] adapterProviders) {
- return new AllAppsGridAdapter<>(mActivityContext, getLayoutInflater(), appsList,
+ return new AllAppsGridAdapter<>(mActivityContext, getLayoutInflater(), mAppsList,
adapterProviders);
}
}
diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml
index d0d82d48bd..2ac7e63a15 100644
--- a/res/layout/all_apps.xml
+++ b/res/layout/all_apps.xml
@@ -29,10 +29,6 @@
layout="@layout/all_apps_bottom_sheet_background"
android:visibility="gone" />
-
-
diff --git a/res/layout/search_results_rv_layout.xml b/res/layout/search_results_rv_layout.xml
deleted file mode 100644
index 567cb5f4fc..0000000000
--- a/res/layout/search_results_rv_layout.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml
index 635db141dd..0fe05ee721 100644
--- a/res/layout/secondary_launcher.xml
+++ b/res/layout/secondary_launcher.xml
@@ -59,10 +59,6 @@
layout="@layout/all_apps_bottom_sheet_background"
android:visibility="gone" />
-
-
diff --git a/src/com/android/launcher3/FastScrollRecyclerView.java b/src/com/android/launcher3/BaseRecyclerView.java
similarity index 95%
rename from src/com/android/launcher3/FastScrollRecyclerView.java
rename to src/com/android/launcher3/BaseRecyclerView.java
index a60d143c6e..9369bdc2fd 100644
--- a/src/com/android/launcher3/FastScrollRecyclerView.java
+++ b/src/com/android/launcher3/BaseRecyclerView.java
@@ -37,19 +37,19 @@ import com.android.launcher3.views.RecyclerViewFastScroller;
* Enable fast scroller.
*
*/
-public abstract class FastScrollRecyclerView extends RecyclerView {
+public abstract class BaseRecyclerView extends RecyclerView {
protected RecyclerViewFastScroller mScrollbar;
- public FastScrollRecyclerView(Context context) {
+ public BaseRecyclerView(Context context) {
this(context, null);
}
- public FastScrollRecyclerView(Context context, AttributeSet attrs) {
+ public BaseRecyclerView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
- public FastScrollRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
+ public BaseRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@@ -206,4 +206,4 @@ public abstract class FastScrollRecyclerView extends RecyclerView {
}
scrollToPosition(0);
}
-}
+}
\ No newline at end of file
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 463280b958..4b42ecbae0 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2750,7 +2750,7 @@ public class Launcher extends StatefulActivity
packageName);
if (supportsAllAppsState && isInState(LauncherState.ALL_APPS)) {
- return getFirstMatch(Collections.singletonList(mAppsView.getActiveAppsRecyclerView()),
+ return getFirstMatch(Collections.singletonList(mAppsView.getActiveRecyclerView()),
preferredItem, packageAndUserAndApp);
} else {
List containers = new ArrayList<>(mWorkspace.getPanelCount() + 1);
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index 16a2823c4e..e279f59aaf 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -80,7 +80,7 @@ public class ActivityAllAppsContainerView mActivityContext.startActivitySafely(v,
marketSearchIntent, null);
for (int i = 0; i < mAH.size(); i++) {
- mAH.get(i).mAdapter.setLastSearchQuery(query, marketSearchClickListener);
+ mAH.get(i).adapter.setLastSearchQuery(query, marketSearchClickListener);
}
mIsSearching = true;
rebindAdapters();
@@ -142,7 +142,7 @@ public class ActivityAllAppsContainerView mHeaderThreshold) {
bgVisible = false;
@@ -251,7 +242,7 @@ public class ActivityAllAppsContainerView createAdapter(AlphabeticalAppsList appsList,
+ protected BaseAllAppsAdapter getAdapter(AlphabeticalAppsList mAppsList,
BaseAdapterProvider[] adapterProviders) {
- return new AllAppsGridAdapter<>(mActivityContext, getLayoutInflater(), appsList,
+ return new AllAppsGridAdapter<>(mActivityContext, getLayoutInflater(), mAppsList,
adapterProviders);
}
}
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 18c6788397..7dbe711716 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -37,8 +37,8 @@ import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
+import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.FastScrollRecyclerView;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -53,13 +53,13 @@ import java.util.List;
/**
* A RecyclerView with custom fast scroll support for the all apps view.
*/
-public class AllAppsRecyclerView extends FastScrollRecyclerView {
- protected static final String TAG = "AllAppsRecyclerView";
+public class AllAppsRecyclerView extends BaseRecyclerView {
+ private static final String TAG = "AllAppsContainerView";
private static final boolean DEBUG = false;
private static final boolean DEBUG_LATENCY = Utilities.isPropertyEnabled(SEARCH_LOGGING);
- protected AlphabeticalAppsList> mApps;
- protected final int mNumAppsPerRow;
+ private AlphabeticalAppsList> mApps;
+ private final int mNumAppsPerRow;
// The specific view heights that we use to calculate scroll
private final SparseIntArray mViewHeights = new SparseIntArray();
@@ -74,8 +74,8 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
};
// The empty-search result background
- protected AllAppsBackgroundDrawable mEmptySearchBackground;
- protected int mEmptySearchBackgroundTopOffset;
+ private AllAppsBackgroundDrawable mEmptySearchBackground;
+ private int mEmptySearchBackgroundTopOffset;
private ArrayList mAutoSizedOverlays = new ArrayList<>();
@@ -112,7 +112,7 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
return mApps;
}
- protected void updatePoolSize() {
+ private void updatePoolSize() {
DeviceProfile grid = ActivityContext.lookupContext(getContext()).getDeviceProfile();
RecyclerView.RecycledViewPool pool = getRecycledViewPool();
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
@@ -137,8 +137,8 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
Log.d(TAG, "onDraw at = " + System.currentTimeMillis());
}
if (DEBUG_LATENCY) {
- Log.d(SEARCH_LOGGING, getClass().getSimpleName() + " onDraw; time stamp = "
- + System.currentTimeMillis());
+ Log.d(SEARCH_LOGGING,
+ "-- Recycle view onDraw, time stamp = " + System.currentTimeMillis());
}
super.onDraw(c);
}
@@ -223,7 +223,8 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
&& mEmptySearchBackground != null && mEmptySearchBackground.getAlpha() > 0) {
mEmptySearchBackground.setHotspot(e.getX(), e.getY());
}
- hideKeyboardAsync(ActivityContext.lookupContext(getContext()), getApplicationWindowToken());
+ hideKeyboardAsync(ActivityContext.lookupContext(getContext()),
+ getApplicationWindowToken());
return result;
}
@@ -358,6 +359,13 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
}
}
+ @Override
+ public boolean supportsFastScrolling() {
+ // Only allow fast scrolling when the user is not searching, since the results are not
+ // grouped in a meaningful order
+ return !mApps.hasFilter();
+ }
+
@Override
public int getCurrentScrollY() {
// Return early if there are no items or we haven't been measured
@@ -368,7 +376,7 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
// Calculate the y and offset for the item
View child = getChildAt(0);
- int position = getChildAdapterPosition(child);
+ int position = getChildPosition(child);
if (position == NO_POSITION) {
return -1;
}
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index 723bc65978..637a4189b8 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -84,8 +84,7 @@ public class AllAppsTransitionController
@Override
public Float get(AllAppsTransitionController controller) {
if (controller.mIsTablet) {
- return controller.mAppsView.getAppsRecyclerViewContainer()
- .getTranslationY();
+ return controller.mAppsView.getRecyclerViewContainer().getTranslationY();
} else {
return controller.getAppsViewPullbackTranslationY().get(
controller.mAppsView);
@@ -95,7 +94,7 @@ public class AllAppsTransitionController
@Override
public void setValue(AllAppsTransitionController controller, float translation) {
if (controller.mIsTablet) {
- controller.mAppsView.getAppsRecyclerViewContainer().setTranslationY(
+ controller.mAppsView.getRecyclerViewContainer().setTranslationY(
translation);
} else {
controller.getAppsViewPullbackTranslationY().set(controller.mAppsView,
@@ -110,7 +109,7 @@ public class AllAppsTransitionController
@Override
public Float get(AllAppsTransitionController controller) {
if (controller.mIsTablet) {
- return controller.mAppsView.getAppsRecyclerViewContainer().getAlpha();
+ return controller.mAppsView.getRecyclerViewContainer().getAlpha();
} else {
return controller.getAppsViewPullbackAlpha().getValue();
}
@@ -119,7 +118,7 @@ public class AllAppsTransitionController
@Override
public void setValue(AllAppsTransitionController controller, float alpha) {
if (controller.mIsTablet) {
- controller.mAppsView.getAppsRecyclerViewContainer().setAlpha(alpha);
+ controller.mAppsView.getRecyclerViewContainer().setAlpha(alpha);
} else {
controller.getAppsViewPullbackAlpha().setValue(alpha);
}
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 42374b894f..7687fea85d 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -18,8 +18,6 @@ package com.android.launcher3.allapps;
import android.content.Context;
-import androidx.annotation.Nullable;
-
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.AppInfo;
@@ -73,7 +71,6 @@ public class AlphabeticalAppsList implement
// The set of apps from the system
private final List mApps = new ArrayList<>();
- @Nullable
private final AllAppsStore mAllAppsStore;
// The number of results in current adapter
@@ -91,16 +88,14 @@ public class AlphabeticalAppsList implement
private int mNumAppRowsInAdapter;
private ItemInfoMatcher mItemFilter;
- public AlphabeticalAppsList(Context context, @Nullable AllAppsStore appsStore,
+ public AlphabeticalAppsList(Context context, AllAppsStore appsStore,
WorkAdapterProvider adapterProvider) {
mAllAppsStore = appsStore;
mActivityContext = ActivityContext.lookupContext(context);
mAppNameComparator = new AppInfoComparator(context);
mWorkAdapterProvider = adapterProvider;
mNumAppsPerRowAllApps = mActivityContext.getDeviceProfile().inv.numAllAppsColumns;
- if (mAllAppsStore != null) {
- mAllAppsStore.addUpdateListener(this);
- }
+ mAllAppsStore.addUpdateListener(this);
}
public void updateItemFilter(ItemInfoMatcher itemFilter) {
@@ -173,9 +168,9 @@ public class AlphabeticalAppsList implement
}
/**
- * Returns whether there are search results which will hide the A-Z list.
+ * Returns whether there are is a filter set.
*/
- public boolean hasSearchResults() {
+ public boolean hasFilter() {
return !mSearchResults.isEmpty();
}
@@ -183,7 +178,7 @@ public class AlphabeticalAppsList implement
* Returns whether there are no filtered results.
*/
public boolean hasNoFilteredResults() {
- return hasSearchResults() && mAccessibilityResultsCount == 0;
+ return hasFilter() && mAccessibilityResultsCount == 0;
}
/**
@@ -201,13 +196,13 @@ public class AlphabeticalAppsList implement
return true;
}
- /** Appends results to search. */
- public void appendSearchResults(ArrayList results) {
- if (hasSearchResults() && results != null && results.size() > 0) {
+ public boolean appendSearchResults(ArrayList results) {
+ if (hasFilter() && results != null && results.size() > 0) {
updateSearchAdapterItems(results, mSearchResults.size());
- mSearchResults.addAll(results);
refreshRecyclerView();
+ return true;
}
+ return false;
}
void updateSearchAdapterItems(ArrayList list, int offset) {
@@ -227,14 +222,11 @@ public class AlphabeticalAppsList implement
*/
@Override
public void onAppsUpdated() {
- if (mAllAppsStore == null) {
- return;
- }
// Sort the list of apps
mApps.clear();
for (AppInfo app : mAllAppsStore.getApps()) {
- if (mItemFilter == null || mItemFilter.matches(app, null) || hasSearchResults()) {
+ if (mItemFilter == null || mItemFilter.matches(app, null) || hasFilter()) {
mApps.add(app);
}
}
@@ -304,18 +296,7 @@ public class AlphabeticalAppsList implement
// Recreate the filtered and sectioned apps (for convenience for the grid layout) from the
// ordered set of sections
- if (hasSearchResults()) {
- if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
- // Append the search market item
- if (hasNoFilteredResults()) {
- mSearchResults.add(AdapterItem.asEmptySearch(position++));
- } else {
- mSearchResults.add(AdapterItem.asAllAppsDivider(position++));
- }
- mSearchResults.add(AdapterItem.asMarketSearch(position++));
- }
- updateSearchAdapterItems(mSearchResults, 0);
- } else {
+ if (!hasFilter()) {
mAccessibilityResultsCount = mApps.size();
if (mWorkAdapterProvider != null) {
position += mWorkAdapterProvider.addWorkItems(mAdapterItems);
@@ -342,6 +323,18 @@ public class AlphabeticalAppsList implement
mAdapterItems.add(appItem);
}
+ } else {
+ updateSearchAdapterItems(mSearchResults, 0);
+ if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
+ // Append the search market item
+ if (hasNoFilteredResults()) {
+ mAdapterItems.add(AdapterItem.asEmptySearch(position++));
+ } else {
+ mAdapterItems.add(AdapterItem.asAllAppsDivider(position++));
+ }
+ mAdapterItems.add(AdapterItem.asMarketSearch(position++));
+
+ }
}
if (mNumAppsPerRowAllApps != 0) {
// Update the number of rows in the adapter after we do all the merging (otherwise, we
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
index 6a4498917e..f913aa9093 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
@@ -80,7 +80,7 @@ public abstract class BaseAllAppsContainerView {
- if (hasFocus && getActiveAppsRecyclerView() != null) {
- getActiveAppsRecyclerView().requestFocus();
+ if (hasFocus && getActiveRecyclerView() != null) {
+ getActiveRecyclerView().requestFocus();
}
});
mHeader = findViewById(R.id.all_apps_header);
- mSearchRecyclerView = findViewById(R.id.search_results_list_view);
- mAH.get(AdapterHolder.SEARCH).setup(mSearchRecyclerView,
- /* Filter out A-Z apps */ (itemInfo, componentName) -> false);
rebindAdapters(true /* force */);
mBottomSheetBackground = findViewById(R.id.bottom_sheet_background);
@@ -447,19 +438,13 @@ public abstract class BaseAllAppsContainerView getSearchResultList() {
- return mAH.get(AdapterHolder.SEARCH).mAppsList;
+ public AlphabeticalAppsList getApps() {
+ return mAH.get(AdapterHolder.MAIN).mAppsList;
}
public FloatingHeaderView getFloatingHeaderView() {
@@ -601,19 +566,17 @@ public abstract class BaseAllAppsContainerView createAdapter(AlphabeticalAppsList mAppsList,
+ protected abstract BaseAllAppsAdapter getAdapter(AlphabeticalAppsList mAppsList,
BaseAdapterProvider[] adapterProviders);
protected int getHeaderBottom() {
return (int) getTranslationY();
}
- /**
- * Returns a view that denotes the visible part of all apps container view.
- */
- public View getVisibleContainerView() {
- return mActivityContext.getDeviceProfile().isTablet ? mBottomSheetBackground : this;
- }
-
/** Holds a {@link BaseAllAppsAdapter} and related fields. */
public class AdapterHolder {
public static final int MAIN = 0;
public static final int WORK = 1;
- public static final int SEARCH = 2;
- private final int mType;
- public final BaseAllAppsAdapter mAdapter;
+ private final boolean mIsWork;
+ public final BaseAllAppsAdapter adapter;
final RecyclerView.LayoutManager mLayoutManager;
final AlphabeticalAppsList mAppsList;
final Rect mPadding = new Rect();
AllAppsRecyclerView mRecyclerView;
boolean mVerticalFadingEdge;
- AdapterHolder(int type) {
- mType = type;
- mAppsList = new AlphabeticalAppsList<>(mActivityContext,
- isSearch() ? null : mAllAppsStore,
- isWork() ? mWorkManager.getAdapterProvider() : null);
+ AdapterHolder(boolean isWork) {
+ mIsWork = isWork;
+ mAppsList = new AlphabeticalAppsList<>(mActivityContext, mAllAppsStore,
+ isWork ? mWorkManager.getAdapterProvider() : null);
BaseAdapterProvider[] adapterProviders =
- isWork() ? new BaseAdapterProvider[]{mMainAdapterProvider,
+ isWork ? new BaseAdapterProvider[]{mMainAdapterProvider,
mWorkManager.getAdapterProvider()}
: new BaseAdapterProvider[]{mMainAdapterProvider};
- mAdapter = createAdapter(mAppsList, adapterProviders);
- mAppsList.setAdapter(mAdapter);
- mLayoutManager = mAdapter.getLayoutManager();
+ adapter = getAdapter(mAppsList, adapterProviders);
+ mAppsList.setAdapter(adapter);
+ mLayoutManager = adapter.getLayoutManager();
}
void setup(@NonNull View rv, @Nullable ItemInfoMatcher matcher) {
@@ -785,14 +737,14 @@ public abstract class BaseAllAppsContainerView mSearchResultsList;
+ private AlphabeticalAppsList> mApps;
private ActivityAllAppsContainerView> mAppsView;
// The amount of pixels to shift down and overlap with the rest of the content.
@@ -102,8 +102,8 @@ public class AppsSearchContainerLayout extends ExtendedEditText
// Update the width to match the grid padding
DeviceProfile dp = mLauncher.getDeviceProfile();
int myRequestedWidth = getSize(widthMeasureSpec);
- int rowWidth = myRequestedWidth - mAppsView.getActiveAppsRecyclerView().getPaddingLeft()
- - mAppsView.getActiveAppsRecyclerView().getPaddingRight();
+ int rowWidth = myRequestedWidth - mAppsView.getActiveRecyclerView().getPaddingLeft()
+ - mAppsView.getActiveRecyclerView().getPaddingRight();
int cellWidth = DeviceProfile.calculateCellWidth(rowWidth,
dp.cellLayoutBorderSpacePx.x, dp.numShownHotseatIcons);
@@ -131,7 +131,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText
@Override
public void initializeSearch(ActivityAllAppsContainerView> appsView) {
- mSearchResultsList = appsView.getSearchResultList();
+ mApps = appsView.getApps();
mAppsView = appsView;
mSearchBarController.initialize(
new DefaultAppSearchAlgorithm(getContext()),
@@ -170,7 +170,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText
@Override
public void onSearchResult(String query, ArrayList items) {
if (items != null) {
- mSearchResultsList.setSearchResults(items);
+ mApps.setSearchResults(items);
notifyResultChanged();
mAppsView.setLastSearchQuery(query);
}
@@ -179,14 +179,14 @@ public class AppsSearchContainerLayout extends ExtendedEditText
@Override
public void onAppendSearchResult(String query, ArrayList items) {
if (items != null) {
- mSearchResultsList.appendSearchResults(items);
+ mApps.appendSearchResults(items);
notifyResultChanged();
}
}
@Override
public void clearSearchResult() {
- if (mSearchResultsList.setSearchResults(null)) {
+ if (mApps.setSearchResults(null)) {
notifyResultChanged();
}
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index ee8f85d3ab..a6b481ada0 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -108,7 +108,7 @@ public class TestInformationHandler implements ResourceBasedOverride {
case TestProtocol.REQUEST_APPS_LIST_SCROLL_Y: {
return getLauncherUIProperty(Bundle::putInt,
- l -> l.getAppsView().getActiveAppsRecyclerView().getCurrentScrollY());
+ l -> l.getAppsView().getActiveRecyclerView().getCurrentScrollY());
}
case TestProtocol.REQUEST_WIDGETS_SCROLL_Y: {
diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
index 5f6e45348b..a982786972 100644
--- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java
+++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
@@ -43,7 +43,7 @@ import android.widget.TextView;
import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.launcher3.FastScrollRecyclerView;
+import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.graphics.FastScrollThumbDrawable;
@@ -127,7 +127,7 @@ public class RecyclerViewFastScroller extends View {
private String mPopupSectionName;
private Insets mSystemGestureInsets;
- protected FastScrollRecyclerView mRv;
+ protected BaseRecyclerView mRv;
private RecyclerView.OnScrollListener mOnScrollListener;
private int mDownX;
@@ -172,7 +172,7 @@ public class RecyclerViewFastScroller extends View {
ta.recycle();
}
- public void setRecyclerView(FastScrollRecyclerView rv, TextView popupView) {
+ public void setRecyclerView(BaseRecyclerView rv, TextView popupView) {
if (mRv != null && mOnScrollListener != null) {
mRv.removeOnScrollListener(mOnScrollListener);
}
diff --git a/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java b/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
index ea62c1706c..f780f03948 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
@@ -27,8 +27,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.OnItemTouchListener;
+import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.FastScrollRecyclerView;
import com.android.launcher3.R;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.model.WidgetListSpaceEntry;
@@ -41,7 +41,7 @@ import com.android.launcher3.widget.picker.WidgetsSpaceViewHolderBinder.EmptySpa
/**
* The widgets recycler view.
*/
-public class WidgetsRecyclerView extends FastScrollRecyclerView implements OnItemTouchListener {
+public class WidgetsRecyclerView extends BaseRecyclerView implements OnItemTouchListener {
private WidgetsListAdapter mAdapter;
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 9b37741adc..7080c85690 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -525,7 +525,7 @@ public abstract class AbstractLauncherUiTest {
}
protected int getAllAppsScroll(Launcher launcher) {
- return launcher.getAppsView().getActiveAppsRecyclerView().getCurrentScrollY();
+ return launcher.getAppsView().getActiveRecyclerView().getCurrentScrollY();
}
private void checkLauncherIntegrity(
diff --git a/tests/src/com/android/launcher3/ui/WorkProfileTest.java b/tests/src/com/android/launcher3/ui/WorkProfileTest.java
index 13b93d10ae..f31e4f315c 100644
--- a/tests/src/com/android/launcher3/ui/WorkProfileTest.java
+++ b/tests/src/com/android/launcher3/ui/WorkProfileTest.java
@@ -134,8 +134,8 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
executeOnLauncher(l -> {
ActivityAllAppsContainerView> allApps = l.getAppsView();
assertEquals("Work tab is not focused", allApps.getCurrentPage(), WORK_PAGE);
- View workPausedCard = allApps.getActiveAppsRecyclerView()
- .findViewHolderForAdapterPosition(0).itemView;
+ View workPausedCard = allApps.getActiveRecyclerView().findViewHolderForAdapterPosition(
+ 0).itemView;
workPausedCard.findViewById(R.id.enable_work_apps).performClick();
});
waitForLauncherCondition("Work profile toggle ON failed", launcher -> {
@@ -155,7 +155,7 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
});
waitForLauncherCondition("Work profile education not shown",
- l -> l.getAppsView().getActiveAppsRecyclerView()
+ l -> l.getAppsView().getActiveRecyclerView()
.findViewHolderForAdapterPosition(0).itemView instanceof WorkEduCard,
LauncherInstrumentation.WAIT_TIME_MS);
}