Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit dc96725

Browse files
committed
Add content description for module action buttons.
1 parent 1ecf075 commit dc96725

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/main/java/com/fox2code/mmm/ModuleViewAdapter.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,14 @@ public boolean update(ModuleHolder moduleHolder) {
228228
imageButton.setVisibility(View.VISIBLE);
229229
imageButton.setImportantForAccessibility(
230230
View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
231-
this.actionButtonsTypes.get(i)
232-
.update(imageButton, moduleHolder);
231+
ActionButtonType button = this.actionButtonsTypes.get(i);
232+
button.update(imageButton, moduleHolder);
233+
imageButton.setContentDescription(button.name());
233234
} else {
234235
imageButton.setVisibility(View.GONE);
235236
imageButton.setImportantForAccessibility(
236237
View.IMPORTANT_FOR_ACCESSIBILITY_NO);
238+
imageButton.setContentDescription(null);
237239
}
238240
}
239241
this.cardView.setClickable(false);
@@ -265,6 +267,7 @@ public boolean update(ModuleHolder moduleHolder) {
265267
button.setVisibility(View.GONE);
266268
button.setImportantForAccessibility(
267269
View.IMPORTANT_FOR_ACCESSIBILITY_NO);
270+
button.setContentDescription(null);
268271
}
269272
if (type == ModuleHolder.Type.NOTIFICATION) {
270273
NotificationType notificationType = moduleHolder.notificationType;

0 commit comments

Comments
 (0)