Merge "Add app grouping indicators to Sharesheet" into rvc-dev am: 0b079c3383 am: 0e543bf645

Change-Id: I61d73a4a0b3950ad9c3c742a2c841405bfc0544b
This commit is contained in:
Mike Digman
2020-05-15 22:05:30 +00:00
committed by Automerger Merge Worker
4 changed files with 64 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ import android.content.pm.LabeledIntent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ShortcutInfo;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.UserHandle;
import android.os.UserManager;
@@ -253,6 +254,16 @@ public class ChooserListAdapter extends ResolverListAdapter {
holder.text.setBackground(null);
holder.itemView.setBackground(holder.defaultItemViewBackground);
}
// If the target is grouped show an indicator
if (info instanceof MultiDisplayResolveInfo) {
Drawable bkg = mContext.getDrawable(R.drawable.chooser_group_background);
holder.text.setPaddingRelative(0, 0, bkg.getIntrinsicWidth() /* end */, 0);
holder.text.setBackground(bkg);
} else {
holder.text.setBackground(null);
holder.text.setPaddingRelative(0, 0, 0, 0);
}
}
void updateAlphabeticalList() {