Skip to content

Commit 9882d24

Browse files
zhao-gangmaskaravivek
authored andcommitted
Clean up placeholders in media detail fragment fields(Fixed commons-app#2471) (commons-app#2500)
Remove placeholders and let these descriptions only shown in Android Studio layout preview. Use plain text in tools:text attributes so relative string values can also be removed and ease the translation work.
1 parent 02be443 commit 9882d24

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

app/src/main/res/layout/fragment_media_detail.xml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
android:layout_gravity="start"
7676
android:background="?attr/subBackground"
7777
android:padding="@dimen/small_gap"
78-
android:text="@string/media_detail_media_title"
7978
android:textColor="@android:color/white"
80-
android:textSize="@dimen/description_text_size" />
79+
android:textSize="@dimen/description_text_size"
80+
tools:text="Title of the media" />
8181
</LinearLayout>
8282

8383
<fr.free.nrw.commons.media.MediaDetailSpacer
@@ -108,9 +108,9 @@
108108
android:layout_gravity="start"
109109
android:background="?attr/subBackground"
110110
android:padding="@dimen/small_gap"
111-
android:text="@string/media_detail_author_explanation"
112111
android:textColor="@android:color/white"
113-
android:textSize="@dimen/description_text_size" />
112+
android:textSize="@dimen/description_text_size"
113+
tools:text="Media author user name goes here." />
114114
</LinearLayout>
115115

116116
<fr.free.nrw.commons.media.MediaDetailSpacer
@@ -140,9 +140,9 @@
140140
android:layout_gravity="start"
141141
android:background="?attr/subBackground"
142142
android:padding="@dimen/small_gap"
143-
android:text="@string/media_detail_description_explanation"
144143
android:textColor="@android:color/white"
145-
android:textSize="@dimen/description_text_size" />
144+
android:textSize="@dimen/description_text_size"
145+
tools:text="Description of the media goes here. This can potentially be fairly long, and will need to wrap across multiple lines. We hope it looks nice though." />
146146
</LinearLayout>
147147

148148
<fr.free.nrw.commons.media.MediaDetailSpacer
@@ -174,7 +174,6 @@
174174
android:foreground="?attr/selectableItemBackground"
175175
android:gravity="center_vertical"
176176
android:padding="@dimen/small_gap"
177-
android:text="@string/media_detail_license"
178177
android:textColor="@android:color/white"
179178
android:textSize="@dimen/description_text_size"
180179
app:drawablePadding="@dimen/tiny_gap"
@@ -211,7 +210,6 @@
211210
android:foreground="?attr/selectableItemBackground"
212211
android:gravity="center_vertical"
213212
android:padding="@dimen/small_gap"
214-
android:text="@string/media_detail_coordinates"
215213
android:textColor="@android:color/white"
216214
android:textSize="@dimen/description_text_size"
217215
app:drawablePadding="@dimen/tiny_gap"
@@ -275,9 +273,9 @@
275273
android:layout_gravity="start"
276274
android:background="?attr/subBackground"
277275
android:padding="@dimen/small_gap"
278-
android:text="@string/media_detail_uploaded_date"
279276
android:textColor="@android:color/white"
280-
android:textSize="@dimen/description_text_size" />
277+
android:textSize="@dimen/description_text_size"
278+
tools:text="Uploaded date" />
281279
</LinearLayout>
282280

283281
<fr.free.nrw.commons.media.MediaDetailSpacer

app/src/main/res/values/strings.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,8 @@
175175
<string name="yes">Yes</string>
176176
<string name="no">No</string>
177177
<string name="media_detail_title">Title</string>
178-
<string name="media_detail_media_title">Title of the media</string>
179178
<string name="media_detail_description">Description</string>
180-
<string name="media_detail_description_explanation">Description of the media goes here. This can potentially be fairly long, and will need to wrap across multiple lines. We hope it looks nice though.</string>
181179
<string name="media_detail_author">Author</string>
182-
<string name="media_detail_author_explanation">Featured image author user name goes here.</string>
183180
<string name="media_detail_uploaded_date">Uploaded date</string>
184181
<string name="media_detail_license">License</string>
185182
<string name="media_detail_coordinates">Coordinates</string>

0 commit comments

Comments
 (0)