Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46e245a4 authored by Alison Cichowlas's avatar Alison Cichowlas Committed by android-build-merger
Browse files

Merge "Use the correct targets-per-row count for Landscape." into qt-dev am: 67ad0cab

am: 18a7ae4e

Change-Id: I7f20cda098664d98f46229493804731639b187b8
parents d8858fd3 18a7ae4e
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -1427,12 +1427,10 @@ public class ChooserActivity extends ResolverActivity {
    }

    private void updateAlphabeticalList() {
        if (getDisplayList().size() > MAX_RANKED_TARGETS) {
        mSortedList.clear();
        mSortedList.addAll(getDisplayList());
        Collections.sort(mSortedList, new AzInfoComparator(ChooserActivity.this));
    }
    }

    /**
     * Sort intents alphabetically based on display label.
@@ -2047,12 +2045,13 @@ public class ChooserActivity extends ResolverActivity {
        @Override
        public int getUnfilteredCount() {
            int appTargets = super.getUnfilteredCount();
            if (appTargets > MAX_RANKED_TARGETS) {
                appTargets = appTargets + MAX_RANKED_TARGETS;
            if (appTargets > getMaxRankedTargets()) {
                appTargets = appTargets + getMaxRankedTargets();
            }
            return appTargets + getSelectableServiceTargetCount() + getCallerTargetCount();
        }


        public int getCallerTargetCount() {
            return Math.min(mCallerTargets.size(), MAX_SUGGESTED_APP_TARGETS);
        }
@@ -2080,14 +2079,17 @@ public class ChooserActivity extends ResolverActivity {

        int getAlphaTargetCount() {
            int standardCount = super.getCount();
            return standardCount > MAX_RANKED_TARGETS ? standardCount : 0;
            return standardCount > getMaxRankedTargets() ? standardCount : 0;
        }

        int getRankedTargetCount() {
            int spacesAvailable = MAX_RANKED_TARGETS - getCallerTargetCount();
            int spacesAvailable = getMaxRankedTargets() - getCallerTargetCount();
            return Math.min(spacesAvailable, super.getCount());
        }

        private int getMaxRankedTargets() {
            return mChooserRowAdapter == null ? 4 : mChooserRowAdapter.getMaxTargetsPerRow();
        }

        public int getPositionTargetType(int position) {
            int offset = 0;