Add content description for module action buttons.

pull/27/head
Fox2Code 4 years ago
parent 1ecf075fb2
commit dc9672507a

@ -228,12 +228,14 @@ public final class ModuleViewAdapter extends RecyclerView.Adapter<ModuleViewAdap
imageButton.setVisibility(View.VISIBLE); imageButton.setVisibility(View.VISIBLE);
imageButton.setImportantForAccessibility( imageButton.setImportantForAccessibility(
View.IMPORTANT_FOR_ACCESSIBILITY_AUTO); View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
this.actionButtonsTypes.get(i) ActionButtonType button = this.actionButtonsTypes.get(i);
.update(imageButton, moduleHolder); button.update(imageButton, moduleHolder);
imageButton.setContentDescription(button.name());
} else { } else {
imageButton.setVisibility(View.GONE); imageButton.setVisibility(View.GONE);
imageButton.setImportantForAccessibility( imageButton.setImportantForAccessibility(
View.IMPORTANT_FOR_ACCESSIBILITY_NO); View.IMPORTANT_FOR_ACCESSIBILITY_NO);
imageButton.setContentDescription(null);
} }
} }
this.cardView.setClickable(false); this.cardView.setClickable(false);
@ -265,6 +267,7 @@ public final class ModuleViewAdapter extends RecyclerView.Adapter<ModuleViewAdap
button.setVisibility(View.GONE); button.setVisibility(View.GONE);
button.setImportantForAccessibility( button.setImportantForAccessibility(
View.IMPORTANT_FOR_ACCESSIBILITY_NO); View.IMPORTANT_FOR_ACCESSIBILITY_NO);
button.setContentDescription(null);
} }
if (type == ModuleHolder.Type.NOTIFICATION) { if (type == ModuleHolder.Type.NOTIFICATION) {
NotificationType notificationType = moduleHolder.notificationType; NotificationType notificationType = moduleHolder.notificationType;

Loading…
Cancel
Save