Add content description to images
app/src/main/java/eu/lepiller/nani/DictionaryDownloadActivity.java
56 | 56 | manager.notify(notificationID, builder.build()); | |
57 | 57 | currentDownloadTask.execute(d); | |
58 | 58 | setIcon(download_button, R.drawable.ic_pause); | |
59 | + | download_button.setContentDescription(getString(R.string.alt_text_pause)); | |
59 | 60 | ||
60 | 61 | download_button.setOnClickListener(pause_click_listener); | |
61 | 62 | } | |
… | |||
66 | 67 | public void onClick(View v) { | |
67 | 68 | currentDownloadTask.cancel(true); | |
68 | 69 | setIcon(download_button, R.drawable.ic_nani_download); | |
70 | + | download_button.setContentDescription(getString(R.string.alt_text_download)); | |
69 | 71 | ||
70 | 72 | download_button.setOnClickListener(download_click_listener); | |
71 | 73 | currentDownloadTask = null; | |
… | |||
119 | 121 | } | |
120 | 122 | ||
121 | 123 | int drawableResId = d.isDownloaded() ? R.drawable.ic_nani_refresh : R.drawable.ic_nani_download; | |
124 | + | if(d.isDownloaded()) | |
125 | + | download_button.setContentDescription(getString(R.string.alt_text_refresh)); | |
126 | + | else | |
127 | + | download_button.setContentDescription(getString(R.string.alt_text_download)); | |
122 | 128 | download_button = findViewById(R.id.download_button); | |
123 | 129 | setIcon(download_button, drawableResId); | |
124 | 130 | download_button.setEnabled(true); |
app/src/main/res/layout/activity_dictionary_download.xml
25 | 25 | android:layout_width="64dp" | |
26 | 26 | android:layout_height="64dp" | |
27 | 27 | android:layout_weight="0" | |
28 | - | app:srcCompat="@android:drawable/ic_menu_close_clear_cancel" /> | |
28 | + | app:srcCompat="@android:drawable/ic_menu_close_clear_cancel" | |
29 | + | android:contentDescription="@string/alt_text_icon" /> | |
29 | 30 | ||
30 | 31 | <TextView | |
31 | 32 | android:id="@+id/name_view" | |
… | |||
105 | 106 | android:minHeight="64dp" | |
106 | 107 | android:minWidth="64dp" | |
107 | 108 | android:background="#00ffffff" | |
108 | - | app:srcCompat="@android:drawable/arrow_down_float" /> | |
109 | + | app:srcCompat="@android:drawable/arrow_down_float" | |
110 | + | android:contentDescription="@string/alt_text_download" /> | |
109 | 111 | </LinearLayout> | |
110 | 112 | ||
111 | 113 | <LinearLayout | |
… | |||
131 | 133 | android:layout_height="wrap_content" | |
132 | 134 | android:layout_margin="8dp" | |
133 | 135 | android:layout_weight="0" | |
134 | - | app:srcCompat="@android:drawable/arrow_down_float" /> | |
136 | + | app:srcCompat="@android:drawable/arrow_down_float" | |
137 | + | android:contentDescription="@string/alt_text_remove" /> | |
135 | 138 | </LinearLayout> | |
136 | 139 | ||
137 | 140 | </androidx.constraintlayout.widget.ConstraintLayout> | |
137 | 140 | = | |
138 | 141 | = | \ No newline at end of file |
app/src/main/res/layout/layout_dictionary.xml
2 | 2 | <LinearLayout | |
3 | 3 | xmlns:android="http://schemas.android.com/apk/res/android" | |
4 | 4 | xmlns:app="http://schemas.android.com/apk/res-auto" | |
5 | - | xmlns:tools="http://schemas.android.com/tools" | |
6 | 5 | android:layout_width="match_parent" | |
7 | 6 | android:layout_height="wrap_content"> | |
8 | 7 | ||
… | |||
11 | 10 | android:layout_width="64dp" | |
12 | 11 | android:layout_height="64dp" | |
13 | 12 | android:layout_gravity="center" | |
14 | - | android:contentDescription="@string/icon_description" | |
13 | + | android:contentDescription="@string/alt_text_icon" | |
15 | 14 | android:layout_weight="0" | |
16 | 15 | app:srcCompat="@android:drawable/ic_menu_close_clear_cancel" /> | |
17 | 16 |
app/src/main/res/values-fr/strings.xml
18 | 18 | ||
19 | 19 | <string name="download">T??l??charger</string> | |
20 | 20 | <string name="remove">Supprimer</string> | |
21 | - | <string name="icon_description">Icone</string> | |
22 | 21 | <string name="kanji_description">??criture</string> | |
23 | 22 | <string name="close">fermer</string> | |
24 | 23 | ||
… | |||
30 | 29 | <string name="feedback_progress">Recherche???</string> | |
31 | 30 | <string name="feedback_didyoumean">Vouliez-vous dire ?? %s ?? ?</string> | |
32 | 31 | ||
32 | + | <string name="alt_text_icon">Icone</string> | |
33 | + | <string name="alt_text_download">T??l??charger</string> | |
34 | + | <string name="alt_text_pause">Mettre en pause</string> | |
35 | + | <string name="alt_text_refresh">Mettre ?? jour</string> | |
36 | + | <string name="alt_text_remove">Supprimer</string> | |
37 | + | ||
33 | 38 | <!-- Preferences --> | |
34 | 39 | <string name="pref_rad_size">Taille des radicaux</string> | |
35 | 40 | <string-array name="pref_rad_size_choice"> |
app/src/main/res/values/strings.xml
14 | 14 | ||
15 | 15 | <string name="download">Download</string> | |
16 | 16 | <string name="remove">Remove</string> | |
17 | - | <string name="icon_description">Icon</string> | |
18 | 17 | <string name="kanji_description">Writing</string> | |
19 | 18 | <string name="close">close</string> | |
20 | 19 | ||
… | |||
26 | 25 | <string name="feedback_progress">Searching???</string> | |
27 | 26 | <string name="feedback_didyoumean">Did you mean "%s"?</string> | |
28 | 27 | ||
28 | + | ||
29 | + | <string name="alt_text_icon">Icon</string> | |
30 | + | <string name="alt_text_download">Download</string> | |
31 | + | <string name="alt_text_pause">Pause</string> | |
32 | + | <string name="alt_text_refresh">Update</string> | |
33 | + | <string name="alt_text_remove">Remove</string> | |
34 | + | ||
29 | 35 | <!-- Preferences --> | |
30 | 36 | <string name="pref_rad_size">Radicals Size</string> | |
31 | 37 | <string-array name="pref_rad_size_choice"> |