From c469aadd923d13caaf8c043813aa9582a50a8cd4 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 1 Oct 2015 11:24:23 -0700 Subject: Adding progress information for preload icons in content description Bug: 24086091 Change-Id: Id8fb024973f4affd998627d30077e2764b07edc4 --- src/com/android/launcher3/BubbleTextView.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/com/android/launcher3/BubbleTextView.java') diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 0742b0e50..a6a1f4e3f 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -40,6 +40,8 @@ import android.widget.TextView; import com.android.launcher3.IconCache.IconLoadRequest; import com.android.launcher3.model.PackageItemInfo; +import java.text.NumberFormat; + /** * TextView that draws a bubble behind the text. We cannot use a LineBackgroundSpan * because we want to make the bubble taller than the text and TextView's clip is @@ -440,6 +442,11 @@ public class BubbleTextView extends TextView ((info.hasStatusFlag(ShortcutInfo.FLAG_INSTALL_SESSION_ACTIVE) ? info.getInstallProgress() : 0)) : 100; + 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 (mIcon != null) { final PreloadIconDrawable preloadDrawable; if (mIcon instanceof PreloadIconDrawable) { -- cgit v1.2.3