Removing unnecessary work adapter wrapper

Simplifying view type constants to make it easier to add new view types

Bug: 234008165
Test: Verified on device
Change-Id: I96589ceba362ea7e75afdfc3fe8da3be214aa682
This commit is contained in:
Sunny Goyal
2022-07-15 16:23:02 -07:00
parent 6c057718ac
commit cba5f9a64e
8 changed files with 87 additions and 172 deletions

View File

@@ -50,7 +50,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
public static final String TAG = "AlphabeticalAppsList";
private final WorkAdapterProvider mWorkAdapterProvider;
private final WorkProfileManager mWorkProviderManager;
/**
* Info about a fast scroller section, depending if sections are merged, the fast scroller
@@ -92,11 +92,11 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
private Predicate<ItemInfo> mItemFilter;
public AlphabeticalAppsList(Context context, @Nullable AllAppsStore appsStore,
WorkAdapterProvider adapterProvider) {
WorkProfileManager workProfileManager) {
mAllAppsStore = appsStore;
mActivityContext = ActivityContext.lookupContext(context);
mAppNameComparator = new AppInfoComparator(context);
mWorkAdapterProvider = adapterProvider;
mWorkProviderManager = workProfileManager;
mNumAppsPerRowAllApps = mActivityContext.getDeviceProfile().inv.numAllAppsColumns;
if (mAllAppsStore != null) {
mAllAppsStore.addUpdateListener(this);
@@ -260,9 +260,9 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
}
} else {
int position = 0;
if (mWorkAdapterProvider != null) {
position += mWorkAdapterProvider.addWorkItems(mAdapterItems);
if (!mWorkAdapterProvider.shouldShowWorkApps()) {
if (mWorkProviderManager != null) {
position += mWorkProviderManager.addWorkItems(mAdapterItems);
if (!mWorkProviderManager.shouldShowWorkApps()) {
return;
}
}