summaryrefslogtreecommitdiff
path: root/java/src/com
diff options
context:
space:
mode:
author Andrey Epin <ayepin@google.com> 2023-10-06 16:23:56 -0700
committer Andrey Epin <ayepin@google.com> 2023-10-12 10:03:08 -0700
commit5fc200698096eb4666247c8ab1bda9573cb075a6 (patch)
tree0f6c424fdf490235bbe9160ac7dccabf478a26cb /java/src/com
parent3b306cbbce743466212778fdda51cd1600b0711d (diff)
Fix shortcuts loading state
Caused by ag/24642135: legacy code, effectively, did not set background for the shortcut placeholder labels. Specifically, for a placeholder TargetInfo with isPlaceholderTargetInfo() returning true, neither isMultiDisplayResolveInfo() nor isPinned() returned true as well thus the background drawable set for the label got immediately reset by the following logic (and ag/24642135 removed this overriding logic). This change removes the placeholder label background drawable and related view size limitation. Fix: 302391707 Test: manual testing -- simulate long shortcut loading (by a code injection), observe no visual artifacts in the shortcuts row. Change-Id: I86975407b729b488a0a5c924859bc218abc4444e
Diffstat (limited to 'java/src/com')
-rw-r--r--java/src/com/android/intentresolver/ChooserListAdapter.java7
-rw-r--r--java/src/com/android/intentresolver/ResolverListAdapter.java5
2 files changed, 2 insertions, 10 deletions
diff --git a/java/src/com/android/intentresolver/ChooserListAdapter.java b/java/src/com/android/intentresolver/ChooserListAdapter.java
index 35258317..9a15c919 100644
--- a/java/src/com/android/intentresolver/ChooserListAdapter.java
+++ b/java/src/com/android/intentresolver/ChooserListAdapter.java
@@ -375,13 +375,8 @@ public class ChooserListAdapter extends ResolverListAdapter {
}
}
- // If target is loading, show a special placeholder shape in the label, make unclickable
if (info.isPlaceHolderTargetInfo()) {
- int maxTextWidth = mContext.getResources().getDimensionPixelSize(
- R.dimen.chooser_direct_share_label_placeholder_max_width);
- Drawable placeholderDrawable = mContext.getResources().getDrawable(
- R.drawable.chooser_direct_share_label_placeholder, mContext.getTheme());
- holder.bindPlaceholderDrawable(maxTextWidth, placeholderDrawable);
+ holder.bindPlaceholder();
}
if (info.isMultiDisplayResolveInfo()) {
diff --git a/java/src/com/android/intentresolver/ResolverListAdapter.java b/java/src/com/android/intentresolver/ResolverListAdapter.java
index d1e8c15b..0dd89d87 100644
--- a/java/src/com/android/intentresolver/ResolverListAdapter.java
+++ b/java/src/com/android/intentresolver/ResolverListAdapter.java
@@ -993,10 +993,7 @@ public class ResolverListAdapter extends BaseAdapter {
}
}
- public void bindPlaceholderDrawable(int maxTextWidth, Drawable drawable) {
- text.setMaxWidth(maxTextWidth);
- text.setBackground(drawable);
- // Prevent rippling by removing background containing ripple
+ public void bindPlaceholder() {
itemView.setBackground(null);
}