summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-10-01 18:36:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-01 18:36:29 +0000
commiteaaed098a633eb5a5759778d5b015e11373a5e3d (patch)
tree5ef97916675d6d987bac4f8098aa0e520f035e5a
parent9ccacb544bfcb6b444edf09b1b37f955ae57168c (diff)
parentc469aadd923d13caaf8c043813aa9582a50a8cd4 (diff)
downloadandroid_packages_apps_Trebuchet-eaaed098a633eb5a5759778d5b015e11373a5e3d.tar.gz
android_packages_apps_Trebuchet-eaaed098a633eb5a5759778d5b015e11373a5e3d.tar.bz2
android_packages_apps_Trebuchet-eaaed098a633eb5a5759778d5b015e11373a5e3d.zip
Merge "Adding progress information for preload icons in content description" into ub-launcher3-burnaby-polish
-rw-r--r--res/values/strings.xml4
-rw-r--r--src/com/android/launcher3/BubbleTextView.java7
2 files changed, 11 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f93b363cc..91dfb19f3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -191,6 +191,10 @@
<string name="abandoned_promise_explanation">The app for this icon isn\'t installed.
You can remove it, or search for the app and install it manually.
</string>
+ <!-- Title for an app which is being downloaded. -->
+ <string name="app_downloading_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> downloading, <xliff:g id="progress" example="30%">%2$s</xliff:g> complete</string>
+ <!-- Title for an app whose download has been started. -->
+ <string name="app_waiting_download_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> waiting to install</string>
<!-- Strings for accessibility actions -->
<!-- Accessibility action to add an app to workspace. [CHAR_LIMIT=30] -->
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 7e790c6ab..70bf85992 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) {