diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index 0478a82bdbb73..3ecc3e26ff485 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -2115,6 +2115,24 @@ public class ChooserActivity extends ResolverActivity {
com.android.internal.R.layout.resolve_grid_item, parent, false);
}
+ @Override
+ protected void onBindView(View view, TargetInfo info) {
+ super.onBindView(view, info);
+
+ // If target is loading, show a special placeholder shape in the label
+ final ViewHolder holder = (ViewHolder) view.getTag();
+ if (info instanceof PlaceHolderTargetInfo) {
+ final int maxWidth = getResources().getDimensionPixelSize(
+ R.dimen.chooser_direct_share_label_placeholder_max_width);
+ holder.text.setMaxWidth(maxWidth);
+ holder.text.setBackground(getResources().getDrawable(
+ R.drawable.chooser_direct_share_label_placeholder, getTheme()));
+ } else {
+ holder.text.setMaxWidth(Integer.MAX_VALUE);
+ holder.text.setBackground(null);
+ }
+ }
+
@Override
public void onListRebuilt() {
// don't support direct share on low ram devices
diff --git a/core/res/res/drawable/chooser_direct_share_label_placeholder.xml b/core/res/res/drawable/chooser_direct_share_label_placeholder.xml
new file mode 100644
index 0000000000000..b21444bf1ade3
--- /dev/null
+++ b/core/res/res/drawable/chooser_direct_share_label_placeholder.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index e5bf088f64f06..0b3ad59a39893 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -735,4 +735,5 @@
18dp
90dp
288dp
+ 72dp
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index fbbbecde74aea..b1e438f4df09f 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3766,4 +3766,6 @@
+
+