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

Commit 781020e

Browse files
committed
Improve accessibility service awareness for module view.
1 parent 01292ac commit 781020e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,9 @@ public boolean update(ModuleHolder moduleHolder) {
188188
moduleInfo.version + ")") + " " +
189189
this.getString(R.string.module_by) + " " + moduleInfo.author);
190190
} else {
191-
this.creditText.setText((
191+
this.creditText.setText(localModuleInfo.version + (
192192
localModuleInfo.version.equals(localModuleInfo.updateVersion) ?
193-
localModuleInfo.version : localModuleInfo.version + " (" +
194-
this.getString(R.string.module_last_update) +
193+
"" : " (" + this.getString(R.string.module_last_update) +
195194
localModuleInfo.updateVersion + ")") + " " +
196195
this.getString(R.string.module_by) + " " + localModuleInfo.author);
197196
}
@@ -206,7 +205,7 @@ public boolean update(ModuleHolder moduleHolder) {
206205
this.updateText.setVisibility(View.VISIBLE);
207206
this.updateText.setText(
208207
this.getString(R.string.module_last_update) + " " + updateText + "\n" +
209-
this.getString(R.string.module_repo) + " " + moduleHolder.getRepoName() +
208+
this.getString(R.string.module_repo) + " " + moduleHolder.getRepoName() +
210209
(repoModule.qualityText == 0 ? "" : (
211210
"\n" + this.getString(repoModule.qualityText) +
212211
" " + repoModule.qualityValue)));
@@ -227,10 +226,14 @@ public boolean update(ModuleHolder moduleHolder) {
227226
ImageButton imageButton = this.actionsButtons[i];
228227
if (i < this.actionButtonsTypes.size()) {
229228
imageButton.setVisibility(View.VISIBLE);
229+
imageButton.setImportantForAccessibility(
230+
View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
230231
this.actionButtonsTypes.get(i)
231232
.update(imageButton, moduleHolder);
232233
} else {
233234
imageButton.setVisibility(View.GONE);
235+
imageButton.setImportantForAccessibility(
236+
View.IMPORTANT_FOR_ACCESSIBILITY_NO);
234237
}
235238
}
236239
this.cardView.setClickable(false);
@@ -260,6 +263,8 @@ public boolean update(ModuleHolder moduleHolder) {
260263
this.actionButtonsTypes.clear();
261264
for (ImageButton button:this.actionsButtons) {
262265
button.setVisibility(View.GONE);
266+
button.setImportantForAccessibility(
267+
View.IMPORTANT_FOR_ACCESSIBILITY_NO);
263268
}
264269
if (type == ModuleHolder.Type.NOTIFICATION) {
265270
NotificationType notificationType = moduleHolder.notificationType;

0 commit comments

Comments
 (0)