summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-10-01 18:39:10 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-10-01 18:39:10 +0000
commit5a87313591d04cac6525f386509e986f5b6bf446 (patch)
treef643f1f10f664604b91bdfbf657a18e7a7f9c09d /src/com/android/launcher3/BubbleTextView.java
parentdab7da510ff4286b023238cb8b8c7abd0b2ee90c (diff)
parenteaaed098a633eb5a5759778d5b015e11373a5e3d (diff)
downloadandroid_packages_apps_Trebuchet-5a87313591d04cac6525f386509e986f5b6bf446.tar.gz
android_packages_apps_Trebuchet-5a87313591d04cac6525f386509e986f5b6bf446.tar.bz2
android_packages_apps_Trebuchet-5a87313591d04cac6525f386509e986f5b6bf446.zip
am eaaed098: Merge "Adding progress information for preload icons in content description" into ub-launcher3-burnaby-polish
* commit 'eaaed098a633eb5a5759778d5b015e11373a5e3d': Adding progress information for preload icons in content description
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index e7157aac5..10db45945 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -42,6 +42,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
@@ -451,6 +453,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) {