State download information in content description whether or not there was an update. am: 5f7f4cb35d

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13452996

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I597d54c8115c1851b2ff5f8192a0a8d0c5f89d45
This commit is contained in:
Schneider Victor-tulias authored and Automerger Merge Worker committed 2021-02-02 00:30:26 +00:00
commit 53fc67d381
2 files changed
+25 -3

No files matched your search

+2
View File
@@ -232,6 +232,8 @@
<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 installed. -->
<string name="app_installing_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> installing, <xliff:g id="progress" example="30%">%2$s</xliff:g> complete</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. -->
+23 -3
View File
@@ -289,6 +289,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
setTag(info);
applyLoadingState(promiseStateChanged);
applyDotState(info, false /* animate */);
setDownloadStateContentDescription(info, info.getProgressLevel());
}
public void applyFromApplicationInfo(AppInfo info) {
@@ -304,6 +305,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
applyProgressLevel();
}
applyDotState(info, false /* animate */);
setDownloadStateContentDescription(info, info.getProgressLevel());
}
/**
@@ -316,6 +318,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
// Verify high res immediately
verifyHighRes();
setDownloadStateContentDescription(info, info.getProgressLevel());
}
/**
@@ -635,9 +639,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
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)));
setDownloadStateContentDescription(info, progressLevel);
} else {
setContentDescription(getContext()
.getString(R.string.app_waiting_download_title, info.title));
@@ -713,6 +715,24 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
}
}
private void setDownloadStateContentDescription(ItemInfoWithIcon info, int progressLevel) {
if ((info.runtimeStatusFlags & ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK)
!= 0) {
String percentageString = NumberFormat.getPercentInstance()
.format(progressLevel * 0.01);
if ((info.runtimeStatusFlags & ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE) != 0) {
setContentDescription(getContext()
.getString(
R.string.app_installing_title, info.title, percentageString));
} else if ((info.runtimeStatusFlags
& ItemInfoWithIcon.FLAG_INCREMENTAL_DOWNLOAD_ACTIVE) != 0) {
setContentDescription(getContext()
.getString(
R.string.app_downloading_title, info.title, percentageString));
}
}
}
/**
* Sets the icon for this view based on the layout direction.
*/