Merge "Adding progress information for preload icons in content description" into ub-launcher3-burnaby-polish

This commit is contained in:
Sunny Goyal
2015-10-01 18:36:29 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 0 deletions

View File

@@ -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) {