diff options
| author | 2024-04-23 03:24:39 +0000 | |
|---|---|---|
| committer | 2024-04-23 03:24:39 +0000 | |
| commit | b4b571d55554ce2d0c1120f920195d792d3cfccd (patch) | |
| tree | 823978b345fe03e4f53be9c2371611c1c1613897 /java/src | |
| parent | cb10c1675f9bf72baeea662acd7553405ad559cc (diff) | |
| parent | a6a3fe4434af644d01acd21da0c976c4483501bc (diff) | |
Merge "Remove scrollable preview flag" into main
Diffstat (limited to 'java/src')
3 files changed, 18 insertions, 51 deletions
diff --git a/java/src/com/android/intentresolver/ChooserActivity.java b/java/src/com/android/intentresolver/ChooserActivity.java index b712788c..b712edf4 100644 --- a/java/src/com/android/intentresolver/ChooserActivity.java +++ b/java/src/com/android/intentresolver/ChooserActivity.java @@ -506,8 +506,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements mProfiles, mProfileAvailability, mRequest.getInitialIntents(), - mMaxTargetsPerRow, - mFeatureFlags); + mMaxTargetsPerRow); if (!configureContentView(mTargetDataLoader)) { mPersonalPackageMonitor = createPackageMonitor( @@ -728,8 +727,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements mProfiles, mProfileAvailability, mRequest.getInitialIntents(), - mMaxTargetsPerRow, - mFeatureFlags); + mMaxTargetsPerRow); mChooserMultiProfilePagerAdapter.setCurrentPage(currentPage); if (mPersonalPackageMonitor != null) { mPersonalPackageMonitor.unregister(); @@ -1191,9 +1189,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements boolean rebuildCompleted = mChooserMultiProfilePagerAdapter.rebuildTabs( mProfiles.getWorkProfilePresent()); - mLayoutId = mFeatureFlags.scrollablePreview() - ? R.layout.chooser_grid_scrollable_preview - : R.layout.chooser_grid; + mLayoutId = R.layout.chooser_grid_scrollable_preview; setContentView(mLayoutId); mTabHost = findViewById(com.android.internal.R.id.profile_tabhost); @@ -1362,8 +1358,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements mProfiles, mProfileAvailability, mRequest.getInitialIntents(), - mMaxTargetsPerRow, - mFeatureFlags); + mMaxTargetsPerRow); } private ChooserMultiProfilePagerAdapter createMultiProfilePagerAdapter( @@ -1373,8 +1368,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements ProfileHelper profileHelper, ProfileAvailability profileAvailability, List<Intent> initialIntents, - int maxTargetsPerRow, - FeatureFlags featureFlags) { + int maxTargetsPerRow) { Log.d(TAG, "createMultiProfilePagerAdapter"); Profile launchedAs = profileHelper.getLaunchedAsProfile(); @@ -1418,8 +1412,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements launchedAs.getType().ordinal(), profileHelper.getWorkHandle(), profileHelper.getCloneHandle(), - maxTargetsPerRow, - featureFlags); + maxTargetsPerRow); } protected EmptyStateProvider createBlockerEmptyStateProvider() { @@ -1576,9 +1569,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements getResources(), getLayoutInflater(), parent, - mFeatureFlags.scrollablePreview() - ? findViewById(R.id.chooser_headline_row_container) - : null); + findViewById(R.id.chooser_headline_row_container)); if (layout != null) { adjustPreviewWidth(getResources().getConfiguration().orientation, layout); @@ -2477,8 +2468,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements ResolverListAdapter adapter = mChooserMultiProfilePagerAdapter.getListAdapterForUserHandle( UserHandle.of(UserHandle.myUserId())); boolean isEmpty = adapter == null || adapter.getCount() == 0; - return (mFeatureFlags.scrollablePreview() || mProfiles.getWorkProfilePresent()) - && (!isEmpty || shouldShowContentPreviewWhenEmpty()); + return !isEmpty || shouldShowContentPreviewWhenEmpty(); } /** diff --git a/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java b/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java index ba76a4a0..cda69b9e 100644 --- a/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java +++ b/java/src/com/android/intentresolver/grid/ChooserGridAdapter.java @@ -149,9 +149,7 @@ public final class ChooserGridAdapter extends RecyclerView.Adapter<RecyclerView. @Override public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) { - if (mFeatureFlags.scrollablePreview()) { - mRecyclerView = recyclerView; - } + mRecyclerView = recyclerView; } @Override @@ -212,22 +210,7 @@ public final class ChooserGridAdapter extends RecyclerView.Adapter<RecyclerView. * This area includes the content preview (if present) and action row. */ public int getSystemRowCount() { - // For the tabbed case we show the sticky content preview above the tabs, - // please refer to shouldShowStickyContentPreview - if (mChooserActivityDelegate.shouldShowTabs() - || mFeatureFlags.scrollablePreview()) { - return 0; - } - - if (!mShouldShowContentPreview) { - return 0; - } - - if (mChooserListAdapter == null || mChooserListAdapter.getCount() == 0) { - return 0; - } - - return 1; + return 0; } public int getFooterRowCount() { diff --git a/java/src/com/android/intentresolver/profiles/ChooserMultiProfilePagerAdapter.java b/java/src/com/android/intentresolver/profiles/ChooserMultiProfilePagerAdapter.java index 4d0f4a49..8aee0da1 100644 --- a/java/src/com/android/intentresolver/profiles/ChooserMultiProfilePagerAdapter.java +++ b/java/src/com/android/intentresolver/profiles/ChooserMultiProfilePagerAdapter.java @@ -27,7 +27,6 @@ import androidx.viewpager.widget.PagerAdapter; import com.android.intentresolver.ChooserListAdapter; import com.android.intentresolver.ChooserRecyclerViewAccessibilityDelegate; -import com.android.intentresolver.FeatureFlags; import com.android.intentresolver.R; import com.android.intentresolver.emptystate.EmptyStateProvider; import com.android.intentresolver.grid.ChooserGridAdapter; @@ -56,8 +55,7 @@ public class ChooserMultiProfilePagerAdapter extends MultiProfilePagerAdapter< @ProfileType int defaultProfile, UserHandle workProfileUserHandle, UserHandle cloneProfileUserHandle, - int maxTargetsPerRow, - FeatureFlags featureFlags) { + int maxTargetsPerRow) { this( context, new ChooserProfileAdapterBinder(maxTargetsPerRow), @@ -67,8 +65,7 @@ public class ChooserMultiProfilePagerAdapter extends MultiProfilePagerAdapter< defaultProfile, workProfileUserHandle, cloneProfileUserHandle, - new BottomPaddingOverrideSupplier(context), - featureFlags); + new BottomPaddingOverrideSupplier(context)); } private ChooserMultiProfilePagerAdapter( @@ -80,10 +77,9 @@ public class ChooserMultiProfilePagerAdapter extends MultiProfilePagerAdapter< @ProfileType int defaultProfile, UserHandle workProfileUserHandle, UserHandle cloneProfileUserHandle, - BottomPaddingOverrideSupplier bottomPaddingOverrideSupplier, - FeatureFlags featureFlags) { + BottomPaddingOverrideSupplier bottomPaddingOverrideSupplier) { super( - gridAdapter -> gridAdapter.getListAdapter(), + gridAdapter -> gridAdapter.getListAdapter(), adapterBinder, tabs, emptyStateProvider, @@ -91,7 +87,7 @@ public class ChooserMultiProfilePagerAdapter extends MultiProfilePagerAdapter< defaultProfile, workProfileUserHandle, cloneProfileUserHandle, - () -> makeProfileView(context, featureFlags), + () -> makeProfileView(context), bottomPaddingOverrideSupplier); mAdapterBinder = adapterBinder; mBottomPaddingOverrideSupplier = bottomPaddingOverrideSupplier; @@ -116,12 +112,10 @@ public class ChooserMultiProfilePagerAdapter extends MultiProfilePagerAdapter< } } - private static ViewGroup makeProfileView( - Context context, FeatureFlags featureFlags) { + private static ViewGroup makeProfileView(Context context) { LayoutInflater inflater = LayoutInflater.from(context); - ViewGroup rootView = featureFlags.scrollablePreview() - ? (ViewGroup) inflater.inflate(R.layout.chooser_list_per_profile_wrap, null, false) - : (ViewGroup) inflater.inflate(R.layout.chooser_list_per_profile, null, false); + ViewGroup rootView = + (ViewGroup) inflater.inflate(R.layout.chooser_list_per_profile_wrap, null, false); RecyclerView recyclerView = rootView.findViewById(com.android.internal.R.id.resolver_list); recyclerView.setAccessibilityDelegateCompat( new ChooserRecyclerViewAccessibilityDelegate(recyclerView)); |