From 1c07e22c364732779b33c72bdc0e18c4bda0f7ef Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Thu, 29 Sep 2011 16:50:59 -0700 Subject: [PATCH] ActivityChooserView shows "see all" improperly. 1. The cooser was presenting the "Show all" option if the number of available activities was more than the initial max count of activities to be shown. Since the show all option is added to the drop down the latter becomes effectively one longer than the initial max activity count which may make the drop down taller than client expectats. Also this leads to the case where if the activities are one more than the initial activity count pressing the show all button will just replace the show all item with the activity that did not fit - this is somehow annoying to the user. bug:5379282 Change-Id: I2693214cb0b66edb2a3bdffc01ed29139341111c --- core/java/android/widget/ActivityChooserView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/widget/ActivityChooserView.java b/core/java/android/widget/ActivityChooserView.java index c6e63c36098f4..c37cc52238300 100644 --- a/core/java/android/widget/ActivityChooserView.java +++ b/core/java/android/widget/ActivityChooserView.java @@ -302,8 +302,6 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener); - mAdapter.setMaxActivityCount(maxActivityCount); - final boolean defaultActivityButtonShown = mDefaultActivityButton.getVisibility() == VISIBLE; @@ -312,8 +310,10 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod if (maxActivityCount != ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED && activityCount > maxActivityCount + maxActivityCountOffset) { mAdapter.setShowFooterView(true); + mAdapter.setMaxActivityCount(maxActivityCount - 1); } else { mAdapter.setShowFooterView(false); + mAdapter.setMaxActivityCount(maxActivityCount); } ListPopupWindow popupWindow = getListPopupWindow();