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
@@ -147,8 +147,7 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
mWorkManager = new WorkProfileManager(
mActivityContext.getSystemService(UserManager.class),
this,
Utilities.getPrefs(mActivityContext), mActivityContext.getDeviceProfile());
this, Utilities.getPrefs(mActivityContext));
mAH = Arrays.asList(null, null, null);
mAH.set(AdapterHolder.MAIN, new AdapterHolder(AdapterHolder.MAIN));
mAH.set(AdapterHolder.WORK, new AdapterHolder(AdapterHolder.WORK));
@@ -800,12 +799,9 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
mType = type;
mAppsList = new AlphabeticalAppsList<>(mActivityContext,
isSearch() ? null : mAllAppsStore,
isWork() ? mWorkManager.getAdapterProvider() : null);
isWork() ? mWorkManager : null);
BaseAdapterProvider[] adapterProviders =
isWork() ? new BaseAdapterProvider[]{mMainAdapterProvider,
mWorkManager.getAdapterProvider()}
: new BaseAdapterProvider[]{mMainAdapterProvider};
new BaseAdapterProvider[]{mMainAdapterProvider};
mAdapter = createAdapter(mAppsList, adapterProviders);
mAppsList.setAdapter(mAdapter);