summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorMario Bertschler <bmario@google.com>2017-09-27 17:05:21 -0700
committerMario Bertschler <bmario@google.com>2017-09-27 17:05:21 -0700
commit230612f50216b2ea2639d15aa79ab2489efa00f7 (patch)
tree298c2e5b5718da8ab9e0388ff3e5e9e3c004fa35 /src/com/android/launcher3/BubbleTextView.java
parent534fa8a62b8f539af3b620502b613c8b131f29b3 (diff)
downloadandroid_packages_apps_Trebuchet-230612f50216b2ea2639d15aa79ab2489efa00f7.tar.gz
android_packages_apps_Trebuchet-230612f50216b2ea2639d15aa79ab2489efa00f7.tar.bz2
android_packages_apps_Trebuchet-230612f50216b2ea2639d15aa79ab2489efa00f7.zip
Fixing content description of a promise icon that is fully downloaded.
Bug: 65779803 Change-Id: I912a70310c6a44f0b0b443cebf77608fd19bdc71
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index ac842f92e..485125e03 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -496,11 +496,17 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver {
public PreloadIconDrawable applyProgressLevel(int progressLevel) {
if (getTag() instanceof ItemInfoWithIcon) {
ItemInfoWithIcon info = (ItemInfoWithIcon) getTag();
- setContentDescription(progressLevel > 0
- ? getContext().getString(R.string.app_downloading_title, info.title,
- NumberFormat.getPercentInstance().format(progressLevel * 0.01))
- : getContext().getString(R.string.app_waiting_download_title, info.title));
-
+ if (progressLevel >= 100) {
+ setContentDescription(info.contentDescription != null
+ ? info.contentDescription : "");
+ } else if (progressLevel > 0) {
+ setContentDescription(getContext()
+ .getString(R.string.app_downloading_title, info.title,
+ NumberFormat.getPercentInstance().format(progressLevel * 0.01)));
+ } else {
+ setContentDescription(getContext()
+ .getString(R.string.app_waiting_download_title, info.title));
+ }
if (mIcon != null) {
final PreloadIconDrawable preloadDrawable;
if (mIcon instanceof PreloadIconDrawable) {