Loading core/java/com/android/internal/app/ChooserActivity.java +22 −2 Original line number Diff line number Diff line Loading @@ -2072,6 +2072,8 @@ public class ChooserActivity extends ResolverActivity { private static final int MAX_SERVICE_TARGETS = 8; private int mNumShortcutResults = 0; // Reserve spots for incoming direct share targets by adding placeholders private ChooserTargetInfo mPlaceHolderTargetInfo = new PlaceHolderTargetInfo(); private final List<ChooserTargetInfo> mServiceTargets = new ArrayList<>(); Loading Loading @@ -2407,9 +2409,15 @@ public class ChooserActivity extends ResolverActivity { // This incents ChooserTargetServices to define what's truly better. targetScore = lastScore * 0.95f; } shouldNotify |= insertServiceTarget( boolean isInserted = insertServiceTarget( new SelectableTargetInfo(origTarget, target, targetScore)); if (isInserted && isShortcutResult) { mNumShortcutResults++; } shouldNotify |= isInserted; if (DEBUG) { Log.d(TAG, " => " + target.toString() + " score=" + targetScore + " base=" + target.getScore() Loading @@ -2425,6 +2433,10 @@ public class ChooserActivity extends ResolverActivity { } } private int getNumShortcutResults() { return mNumShortcutResults; } /** * Use the scoring system along with artificial boosts to create up to 3 distinct buckets: * <ol> Loading Loading @@ -2955,7 +2967,15 @@ public class ChooserActivity extends ResolverActivity { } public void handleScroll(View v, int y, int oldy) { if (mDirectShareViewHolder != null) { // Only expand direct share area if there is a minimum number of shortcuts, // which will help reduce the amount of visible shuffling due to older-style // direct share targets. int orientation = getResources().getConfiguration().orientation; boolean canExpandDirectShare = mChooserListAdapter.getNumShortcutResults() > getMaxTargetsPerRow() && orientation == Configuration.ORIENTATION_PORTRAIT; if (mDirectShareViewHolder != null && canExpandDirectShare) { mDirectShareViewHolder.handleScroll(mAdapterView, y, oldy, getMaxTargetsPerRow()); } } Loading Loading
core/java/com/android/internal/app/ChooserActivity.java +22 −2 Original line number Diff line number Diff line Loading @@ -2072,6 +2072,8 @@ public class ChooserActivity extends ResolverActivity { private static final int MAX_SERVICE_TARGETS = 8; private int mNumShortcutResults = 0; // Reserve spots for incoming direct share targets by adding placeholders private ChooserTargetInfo mPlaceHolderTargetInfo = new PlaceHolderTargetInfo(); private final List<ChooserTargetInfo> mServiceTargets = new ArrayList<>(); Loading Loading @@ -2407,9 +2409,15 @@ public class ChooserActivity extends ResolverActivity { // This incents ChooserTargetServices to define what's truly better. targetScore = lastScore * 0.95f; } shouldNotify |= insertServiceTarget( boolean isInserted = insertServiceTarget( new SelectableTargetInfo(origTarget, target, targetScore)); if (isInserted && isShortcutResult) { mNumShortcutResults++; } shouldNotify |= isInserted; if (DEBUG) { Log.d(TAG, " => " + target.toString() + " score=" + targetScore + " base=" + target.getScore() Loading @@ -2425,6 +2433,10 @@ public class ChooserActivity extends ResolverActivity { } } private int getNumShortcutResults() { return mNumShortcutResults; } /** * Use the scoring system along with artificial boosts to create up to 3 distinct buckets: * <ol> Loading Loading @@ -2955,7 +2967,15 @@ public class ChooserActivity extends ResolverActivity { } public void handleScroll(View v, int y, int oldy) { if (mDirectShareViewHolder != null) { // Only expand direct share area if there is a minimum number of shortcuts, // which will help reduce the amount of visible shuffling due to older-style // direct share targets. int orientation = getResources().getConfiguration().orientation; boolean canExpandDirectShare = mChooserListAdapter.getNumShortcutResults() > getMaxTargetsPerRow() && orientation == Configuration.ORIENTATION_PORTRAIT; if (mDirectShareViewHolder != null && canExpandDirectShare) { mDirectShareViewHolder.handleScroll(mAdapterView, y, oldy, getMaxTargetsPerRow()); } } Loading