Commit e9ac4cae authored by dfalcantara's avatar dfalcantara Committed by Commit bot

Repurpose unused string for Accessibility

The TitleCondensed string property is now used to pass strings
for accessibility.  This gets around the inability to
set the content description normally for the custom menus.

BUG=293658

Review URL: https://codereview.chromium.org/691113005

Cr-Commit-Position: refs/heads/master@{#302533}
parent 4da86e95
......@@ -168,8 +168,9 @@ class AppMenuAdapter extends BaseAdapter {
holder.image.setImageDrawable(icon);
holder.image.setVisibility(icon == null ? View.GONE : View.VISIBLE);
holder.image.setChecked(item.isChecked());
holder.text.setText(item.getTitle());
holder.text.setContentDescription(item.getTitleCondensed());
boolean isEnabled = item.isEnabled();
// Set the text color (using a color state list).
holder.text.setEnabled(isEnabled);
......@@ -308,9 +309,10 @@ class AppMenuAdapter extends BaseAdapter {
int currentLevel = item.getIcon().getLevel();
button.setImageDrawable(item.getIcon());
item.getIcon().setLevel(currentLevel);
button.setContentDescription(item.getTitle());
button.setEnabled(item.isEnabled());
button.setFocusable(item.isEnabled());
button.setContentDescription(item.getTitleCondensed());
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
......
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