[Wi-Fi] [a11y] In Wi-Fi data usage page, Talkback should also announce the Progress bar percentage instead of "Progress bar" only.
Add conent description for talkback to announce, if the progress bar is 50%, then before modification is "Progress bar", and after modification is "50% Progress bar". Bug: 146811265 Test: Add following unit test case to test if content description is correct or not: createPref_progressBarShouldSetPercentageContentDescription(). Change-Id: I71483df8e12f08c4c8c96ab3964666bf97872a83
This commit is contained in:
@@ -26,6 +26,8 @@ import com.android.settingslib.net.UidDetailProvider;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
import com.android.settingslib.widget.apppreference.AppPreference;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
|
||||
public class AppDataUsagePreference extends AppPreference {
|
||||
|
||||
private final AppItem mItem;
|
||||
@@ -66,6 +68,8 @@ public class AppDataUsagePreference extends AppPreference {
|
||||
progress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
progress.setProgress(mPercent);
|
||||
progress.setContentDescription(
|
||||
NumberFormat.getPercentInstance().format((double) mPercent / 100));
|
||||
}
|
||||
|
||||
private void setAppInfo() {
|
||||
|
Reference in New Issue
Block a user