Settings suggestions now describes expand and collapse in talkback am: 62cf9efd9b
am: d522eff9e5
Change-Id: I95c7c1e9f7e3cec8dc9d439b480b78b2520730fb
This commit is contained in:
@@ -5870,6 +5870,12 @@
|
|||||||
<!--Dashboard strings-->
|
<!--Dashboard strings-->
|
||||||
<!-- Text to describe the dashboard fragment title [CHAR LIMIT=16] -->
|
<!-- Text to describe the dashboard fragment title [CHAR LIMIT=16] -->
|
||||||
<string name="dashboard_title">Settings</string>
|
<string name="dashboard_title">Settings</string>
|
||||||
|
<!-- Text to describe the items to be expanded as suggested settings [CHAR LIMIT=none] -->
|
||||||
|
<plurals name="settings_suggestion_header_summary_hidden_items">
|
||||||
|
<item quantity="one">Show %d hidden item</item>
|
||||||
|
<item quantity="other">Show %d hidden items</item>
|
||||||
|
</plurals>
|
||||||
|
|
||||||
|
|
||||||
<!-- Search strings -->
|
<!-- Search strings -->
|
||||||
<!-- Text to describe the search results fragment title [CHAR LIMIT=16] -->
|
<!-- Text to describe the search results fragment title [CHAR LIMIT=16] -->
|
||||||
|
@@ -301,11 +301,22 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onBindSuggestionHeader(final DashboardItemHolder holder) {
|
private void onBindSuggestionHeader(final DashboardItemHolder holder) {
|
||||||
holder.icon.setImageResource(hasMoreSuggestions() ? R.drawable.ic_expand_more
|
final boolean moreSuggestions = hasMoreSuggestions();
|
||||||
: R.drawable.ic_expand_less);
|
|
||||||
holder.title.setText(mContext.getString(R.string.suggestions_title, mSuggestions.size()));
|
|
||||||
final int undisplayedSuggestionCount =
|
final int undisplayedSuggestionCount =
|
||||||
mSuggestions.size() - getDisplayableSuggestionCount();
|
mSuggestions.size() - getDisplayableSuggestionCount();
|
||||||
|
holder.icon.setImageResource(moreSuggestions ? R.drawable.ic_expand_more
|
||||||
|
: R.drawable.ic_expand_less);
|
||||||
|
holder.title.setText(mContext.getString(R.string.suggestions_title, mSuggestions.size()));
|
||||||
|
String summaryContentDescription;
|
||||||
|
if (moreSuggestions) {
|
||||||
|
summaryContentDescription = mContext.getResources().getQuantityString(
|
||||||
|
R.plurals.settings_suggestion_header_summary_hidden_items,
|
||||||
|
undisplayedSuggestionCount, undisplayedSuggestionCount);
|
||||||
|
} else {
|
||||||
|
summaryContentDescription = mContext.getString(R.string.condition_expand_hide);
|
||||||
|
}
|
||||||
|
holder.summary.setContentDescription(summaryContentDescription);
|
||||||
|
|
||||||
if (undisplayedSuggestionCount == 0) {
|
if (undisplayedSuggestionCount == 0) {
|
||||||
holder.summary.setText(null);
|
holder.summary.setText(null);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user