зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1052026 - Add content description when creating action button in GeckoActionProvider. r=wesj
This commit is contained in:
Родитель
26d3044e7e
Коммит
c0673aa7a0
|
@ -135,7 +135,7 @@ public class MenuItemActionView extends LinearLayout
|
|||
mMenuItem.setSubMenuIndicator(hasSubMenu);
|
||||
}
|
||||
|
||||
public void addActionButton(Drawable drawable) {
|
||||
public void addActionButton(Drawable drawable, CharSequence label) {
|
||||
// If this is the first icon, retain the text.
|
||||
// If not, make the menu item an icon.
|
||||
final int count = mActionButtons.size();
|
||||
|
@ -145,6 +145,7 @@ public class MenuItemActionView extends LinearLayout
|
|||
if (drawable != null) {
|
||||
ImageButton button = new ImageButton(getContext(), null, R.attr.menuItemShareActionButtonStyle);
|
||||
button.setImageDrawable(drawable);
|
||||
button.setContentDescription(label);
|
||||
button.setOnClickListener(this);
|
||||
button.setTag(count);
|
||||
|
||||
|
|
|
@ -105,7 +105,8 @@ public class GeckoActionProvider {
|
|||
}
|
||||
|
||||
for (int i = 0; i < historySize; i++) {
|
||||
view.addActionButton(dataModel.getActivity(i).loadIcon(packageManager));
|
||||
view.addActionButton(dataModel.getActivity(i).loadIcon(packageManager),
|
||||
dataModel.getActivity(i).loadLabel(packageManager));
|
||||
}
|
||||
|
||||
return view;
|
||||
|
|
Загрузка…
Ссылка в новой задаче