Loading core/java/com/android/internal/app/ChooserActivity.java +16 −0 Original line number Diff line number Diff line Loading @@ -2654,6 +2654,7 @@ public class ChooserActivity extends ResolverActivity implements if (recyclerView.getVisibility() == View.VISIBLE) { int directShareHeight = 0; rowsToShow = Math.min(4, rowsToShow); boolean shouldShowExtraRow = shouldShowExtraRow(rowsToShow); mLastNumberOfChildren = recyclerView.getChildCount(); for (int i = 0, childCount = recyclerView.getChildCount(); i < childCount && rowsToShow > 0; i++) { Loading @@ -2664,6 +2665,9 @@ public class ChooserActivity extends ResolverActivity implements } int height = child.getHeight(); offset += height; if (shouldShowExtraRow) { offset += height; } if (gridAdapter.getTargetType( recyclerView.getChildAdapterPosition(child)) Loading Loading @@ -2698,6 +2702,18 @@ public class ChooserActivity extends ResolverActivity implements } } /** * If we have a tabbed view and are showing 1 row in the current profile and an empty * state screen in the other profile, to prevent cropping of the empty state screen we show * a second row in the current profile. */ private boolean shouldShowExtraRow(int rowsToShow) { return shouldShowTabs() && rowsToShow == 1 && mChooserMultiProfilePagerAdapter.shouldShowEmptyStateScreen( mChooserMultiProfilePagerAdapter.getInactiveListAdapter()); } /** * Returns {@link #PROFILE_PERSONAL}, {@link #PROFILE_WORK}, or -1 if the given user handle * does not match either the personal or work user handle. Loading Loading
core/java/com/android/internal/app/ChooserActivity.java +16 −0 Original line number Diff line number Diff line Loading @@ -2654,6 +2654,7 @@ public class ChooserActivity extends ResolverActivity implements if (recyclerView.getVisibility() == View.VISIBLE) { int directShareHeight = 0; rowsToShow = Math.min(4, rowsToShow); boolean shouldShowExtraRow = shouldShowExtraRow(rowsToShow); mLastNumberOfChildren = recyclerView.getChildCount(); for (int i = 0, childCount = recyclerView.getChildCount(); i < childCount && rowsToShow > 0; i++) { Loading @@ -2664,6 +2665,9 @@ public class ChooserActivity extends ResolverActivity implements } int height = child.getHeight(); offset += height; if (shouldShowExtraRow) { offset += height; } if (gridAdapter.getTargetType( recyclerView.getChildAdapterPosition(child)) Loading Loading @@ -2698,6 +2702,18 @@ public class ChooserActivity extends ResolverActivity implements } } /** * If we have a tabbed view and are showing 1 row in the current profile and an empty * state screen in the other profile, to prevent cropping of the empty state screen we show * a second row in the current profile. */ private boolean shouldShowExtraRow(int rowsToShow) { return shouldShowTabs() && rowsToShow == 1 && mChooserMultiProfilePagerAdapter.shouldShowEmptyStateScreen( mChooserMultiProfilePagerAdapter.getInactiveListAdapter()); } /** * Returns {@link #PROFILE_PERSONAL}, {@link #PROFILE_WORK}, or -1 if the given user handle * does not match either the personal or work user handle. Loading