Skip to content

Commit a39d398

Browse files
author
Suchit Kar
committed
Make deletion-related views on MediaDetailFragment neater
1 parent 085eea3 commit a39d398

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public static MediaDetailFragment forMedia(int index, boolean editable) {
8282
private TextView license;
8383
private TextView coordinates;
8484
private TextView uploadedDate;
85-
private TextView nominatedforDeletion;
85+
private TextView seeMore;
86+
private LinearLayout nominatedforDeletion;
8687
private LinearLayout categoryContainer;
8788
private Button delete;
8889
private ScrollView scrollView;
@@ -137,7 +138,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
137138
license = (TextView) view.findViewById(R.id.mediaDetailLicense);
138139
coordinates = (TextView) view.findViewById(R.id.mediaDetailCoordinates);
139140
uploadedDate = (TextView) view.findViewById(R.id.mediaDetailuploadeddate);
140-
nominatedforDeletion = (TextView) view.findViewById(R.id.nominatedDeletionBanner);
141+
seeMore = (TextView) view.findViewById(R.id.seeMore);
142+
nominatedforDeletion = (LinearLayout) view.findViewById(R.id.nominatedDeletionBanner);
141143
delete = (Button) view.findViewById(R.id.nominateDeletion);
142144
categoryContainer = (LinearLayout) view.findViewById(R.id.mediaDetailCategoryContainer);
143145

@@ -349,7 +351,7 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
349351
});
350352
}
351353
if (nominatedforDeletion.getVisibility() == View.VISIBLE){
352-
nominatedforDeletion.setOnClickListener(v -> {
354+
seeMore.setOnClickListener(v -> {
353355
openWebBrowser(media.getFilePageTitle().getMobileUri().toString());
354356
});
355357
}

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

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,33 @@
251251
android:layout_width="match_parent"
252252
android:layout_height="@dimen/small_gap" />
253253

254-
<TextView
254+
<LinearLayout
255255
android:id="@+id/nominatedDeletionBanner"
256256
android:background="@color/deleteBackgroundColor"
257257
android:layout_width="match_parent"
258258
android:layout_height="wrap_content"
259-
android:paddingBottom="@dimen/tiny_gap"
260-
android:gravity="center"
261-
android:text="@string/nominated_for_deletion"
262-
android:textColor="@color/primaryTextColor"
259+
android:orientation="vertical"
263260
android:padding="@dimen/standard_gap"
264-
android:textSize="@dimen/normal_text"
265-
android:textStyle="bold"
266-
android:visibility="gone"/>
261+
android:visibility="gone">
262+
<TextView
263+
android:layout_width="match_parent"
264+
android:layout_height="wrap_content"
265+
android:gravity="center"
266+
android:text="@string/nominated_for_deletion"
267+
android:textColor="@color/primaryTextColor"
268+
android:textSize="@dimen/normal_text"
269+
android:textStyle="bold"/>
270+
<TextView
271+
android:id="@+id/seeMore"
272+
android:layout_width="match_parent"
273+
android:layout_height="wrap_content"
274+
android:gravity="center"
275+
android:text="@string/nominated_see_more"
276+
android:paddingTop="@dimen/standard_gap"
277+
android:textColor="@color/primaryTextColor"
278+
android:textSize="@dimen/normal_text"
279+
android:textStyle="bold"/>
280+
</LinearLayout>
267281

268282
<Button
269283
android:id="@+id/nominateDeletion"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@
231231
<string name="no_web_browser">No web browser found to open URL</string>
232232
<string name="null_url">Error! URL not found</string>
233233
<string name="nominate_deletion">Nominate for Deletion</string>
234-
<string name="nominated_for_deletion">This image has been nominated for deletion.\n\n<u>See webpage for details</u></string>
234+
<string name="nominated_for_deletion">This image has been nominated for deletion.</string>
235+
<string name="nominated_see_more"><u>See webpage for details</u></string>
235236
<string name="view_browser">View in Browser</string>
236237

237238
<string name="nearby_location_has_not_changed">Location has not changed.</string>

0 commit comments

Comments
 (0)