Commit e6b0ebd3 authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Minor DataSaver TalkBack fix

This CL adds a content description to the "Details" TextView header
over the Data Usage Breakdown table. This content description describes
what the current sorting scheme to users using TalkBack.

Bug: 849395
Change-Id: I8328a5a41a37a55a532c5955777200df73a44f53
Reviewed-on: https://chromium-review.googlesource.com/1090072Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565699}
parent e580db86
......@@ -39,6 +39,7 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
private int mNumDataUseItemsToDisplay = 10;
private TableLayout mTableLayout;
private TextView mDetailsTitle;
private TextView mHostnameTitle;
private TextView mDataUsedTitle;
private TextView mDataSavedTitle;
......@@ -53,6 +54,7 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
protected void onFinishInflate() {
super.onFinishInflate();
mTableLayout = (TableLayout) findViewById(R.id.data_reduction_proxy_breakdown_table);
mDetailsTitle = (TextView) findViewById(R.id.data_reduction_data_usage_breakdown_title);
mHostnameTitle = (TextView) findViewById(R.id.data_reduction_breakdown_site_title);
mDataUsedTitle = (TextView) findViewById(R.id.data_reduction_breakdown_used_title);
mDataSavedTitle = (TextView) findViewById(R.id.data_reduction_breakdown_saved_title);
......@@ -66,6 +68,8 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
setTextViewUnsortedAttributes(mDataUsedTitle);
setTextViewSortedAttributes(mHostnameTitle);
Collections.sort(mDataUseItems, new HostnameComparator());
mDetailsTitle.setContentDescription(
getContext().getString(R.string.data_reduction_breakdown_hostname_sorted));
updateSiteBreakdown();
}
});
......@@ -79,6 +83,8 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
setTextViewUnsortedAttributes(mDataSavedTitle);
setTextViewSortedAttributes(mDataUsedTitle);
Collections.sort(mDataUseItems, new DataUsedComparator());
mDetailsTitle.setContentDescription(
getContext().getString(R.string.data_reduction_breakdown_data_used_sorted));
updateSiteBreakdown();
}
});
......@@ -92,6 +98,8 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
setTextViewUnsortedAttributes(mDataUsedTitle);
setTextViewSortedAttributes(mDataSavedTitle);
Collections.sort(mDataUseItems, new DataSavedComparator());
mDetailsTitle.setContentDescription(getContext().getString(
R.string.data_reduction_breakdown_data_saved_sorted));
updateSiteBreakdown();
}
});
......@@ -118,6 +126,8 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
setTextViewUnsortedAttributes(mDataUsedTitle);
setTextViewSortedAttributes(mDataSavedTitle);
Collections.sort(mDataUseItems, new DataSavedComparator());
mDetailsTitle.setContentDescription(
getContext().getString(R.string.data_reduction_breakdown_data_saved_sorted));
if (mDataUseItems.size() == 0) {
setVisibility(GONE);
} else {
......
......@@ -1153,18 +1153,27 @@ To obtain new licenses, connect to the internet and play your downloaded content
<message name="IDS_DATA_REDUCTION_BREAKDOWN_SITE_HEADER_CONTENT_DESCRIPTION" desc="This label is used to state that by clicking the associated button, the displayed table will be sorted by website domain name. This is used in the device's screen reader and is not displayed visually to the user.">
Sort by site
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_HOSTNAME_SORTED" desc="This title states that the following table contains the details of how much data was saved for each site and that the table rows are sorted by the name of the site. This is used in the device's screen reader and is not displayed visually to the user.">
Details: Sorted by site name
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_USED_TITLE" desc="Title for the data used column on the Data Reduction statistics page. The breakdown lists the top ten sites with the greatest amount of data usage or mobile data that was saved.">
Used
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_USED_HEADER_CONTENT_DESCRIPTION" desc="This label is used to state that by clicking the associated button, the displayed table will be sorted descending by the amount of mobile data that was used when viewing a webpage. This is used in the device's screen reader and is not displayed visually to the user.">
Sort by amount of data used
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_DATA_USED_SORTED" desc="This title states that the following table contains the details of how much data was saved for each site and that the table rows are sorted by the how much data was used for each site. This is used in the device's screen reader and is not displayed visually to the user.">
Details: Sorted by amount of data used
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_SAVED_TITLE" desc="Title for the data saved column on the Data Reduction statistics page. The breakdown lists for the top ten sites with the greatest amount of data usage or mobile data that was saved. Data Saver allows users to to reduce their mobile data usage by compressing network traffic.">
Saved
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_SAVED_HEADER_CONTENT_DESCRIPTION" desc="This label is used to state that by clicking the associated button, the displayed table will be sorted descending by the amount of mobile data that was saved when viewing a webpage by using Chrome's Data Saver feature. This is used in the device's screen reader and is not displayed visually to the user.">
Sort by amount of data saved
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_DATA_SAVED_SORTED" desc="This title states that the following table contains the details of how much data was saved for each site and that the table rows are sorted by how much data was saved for each site. This is used in the device's screen reader and is not displayed visually to the user.">
Details: Sorted by amount of data saved
</message>
<message name="IDS_DATA_REDUCTION_BREAKDOWN_USED_CONTENT_DESCRIPTION" desc="This label is used as a suffix to describe the amount of mobile data that was used to view a webpage. It is used in the form '0 bytes used'.">
<ph name="amount">%1$s<ex>0 bytes</ex></ph> used
</message>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment