ActivityChooserView not showing "Show all" properly if the default target button not shown.
If the default target button is hidden all activities are shown in the list from which to choose. In this case due to off by one error the list was not showing the option to expand it if the activities are one more than the initially shown. bug:5358475 Change-Id: I8c3db37dab008637d78330f8de830cec92720264
This commit is contained in:
@@ -287,9 +287,13 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
|
||||
|
||||
mAdapter.setMaxActivityCount(maxActivityCount);
|
||||
|
||||
final boolean defaultActivityButtonShown =
|
||||
mDefaultActivityButton.getVisibility() == VISIBLE;
|
||||
|
||||
final int activityCount = mAdapter.getActivityCount();
|
||||
final int maxActivityCountOffset = defaultActivityButtonShown ? 1 : 0;
|
||||
if (maxActivityCount != ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED
|
||||
&& activityCount > maxActivityCount + 1) {
|
||||
&& activityCount > maxActivityCount + maxActivityCountOffset) {
|
||||
mAdapter.setShowFooterView(true);
|
||||
} else {
|
||||
mAdapter.setShowFooterView(false);
|
||||
@@ -297,8 +301,6 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
|
||||
|
||||
ListPopupWindow popupWindow = getListPopupWindow();
|
||||
if (!popupWindow.isShowing()) {
|
||||
final boolean defaultActivityButtonShown =
|
||||
mDefaultActivityButton.getVisibility() == VISIBLE;
|
||||
if (mIsSelectingDefaultActivity || !defaultActivityButtonShown) {
|
||||
mAdapter.setShowDefaultActivity(true, defaultActivityButtonShown);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user