Settings suggestions now describes expand and collapse in talkback am: 62cf9efd9b am: d522eff9e5

am: a7b7f86f1e

Change-Id: Icac895f280eb02b5cedebfec4d6b809431ea04f7
This commit is contained in:
Matthew Fritze
2016-09-28 23:21:51 +00:00
committed by android-build-merger
2 changed files with 20 additions and 3 deletions

View File

@@ -306,11 +306,22 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
}
private void onBindSuggestionHeader(final DashboardItemHolder holder) {
holder.icon.setImageResource(hasMoreSuggestions() ? R.drawable.ic_expand_more
: R.drawable.ic_expand_less);
holder.title.setText(mContext.getString(R.string.suggestions_title, mSuggestions.size()));
final boolean moreSuggestions = hasMoreSuggestions();
final int undisplayedSuggestionCount =
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) {
holder.summary.setText(null);
} else {