mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-27 16:33:47 +00:00
Added accessibility message actions
This commit is contained in:
parent
3427d5787f
commit
be9ca6beed
1 changed files with 16 additions and 0 deletions
|
@ -3788,6 +3788,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
context.getString(R.string.title_accessibility_view_help)));
|
context.getString(R.string.title_accessibility_view_help)));
|
||||||
ibHelp.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
|
ibHelp.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||||
|
|
||||||
|
if (expanded) {
|
||||||
|
for (int i = 0; i < bnvActions.getMenu().size(); i++) {
|
||||||
|
MenuItem menuItem = bnvActions.getMenu().getItem(i);
|
||||||
|
if (menuItem.isVisible() && menuItem.isEnabled())
|
||||||
|
info.addAction(new AccessibilityNodeInfo.AccessibilityAction(
|
||||||
|
menuItem.getItemId(), menuItem.getTitle()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
info.setContentDescription(TextUtils.join(", ", result));
|
info.setContentDescription(TextUtils.join(", ", result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3817,6 +3826,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
onHelp(message);
|
onHelp(message);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
for (int i = 0; i < bnvActions.getMenu().size(); i++) {
|
||||||
|
MenuItem menuItem = bnvActions.getMenu().getItem(i);
|
||||||
|
if (menuItem.getItemId() == action) {
|
||||||
|
bnvActions.getMenu().performIdentifierAction(action, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return super.performAccessibilityAction(host, action, args);
|
return super.performAccessibilityAction(host, action, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue