Skip to content

Commit 2783b4f

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "ActivityChooserView shows "see all" improperly."
2 parents 46c78b4 + 1c07e22 commit 2783b4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/widget/ActivityChooserView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ private void showPopupUnchecked(int maxActivityCount) {
302302

303303
getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
304304

305-
mAdapter.setMaxActivityCount(maxActivityCount);
306-
307305
final boolean defaultActivityButtonShown =
308306
mDefaultActivityButton.getVisibility() == VISIBLE;
309307

@@ -312,8 +310,10 @@ private void showPopupUnchecked(int maxActivityCount) {
312310
if (maxActivityCount != ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED
313311
&& activityCount > maxActivityCount + maxActivityCountOffset) {
314312
mAdapter.setShowFooterView(true);
313+
mAdapter.setMaxActivityCount(maxActivityCount - 1);
315314
} else {
316315
mAdapter.setShowFooterView(false);
316+
mAdapter.setMaxActivityCount(maxActivityCount);
317317
}
318318

319319
ListPopupWindow popupWindow = getListPopupWindow();

0 commit comments

Comments
 (0)