Make deletion-related views on MediaDetailFragment neater

This commit is contained in:
Suchit Kar 2018-03-20 15:32:50 +05:30
parent 085eea3d31
commit a39d398edd
3 changed files with 29 additions and 12 deletions

View file

@ -82,7 +82,8 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
private TextView license;
private TextView coordinates;
private TextView uploadedDate;
private TextView nominatedforDeletion;
private TextView seeMore;
private LinearLayout nominatedforDeletion;
private LinearLayout categoryContainer;
private Button delete;
private ScrollView scrollView;
@ -137,7 +138,8 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
license = (TextView) view.findViewById(R.id.mediaDetailLicense);
coordinates = (TextView) view.findViewById(R.id.mediaDetailCoordinates);
uploadedDate = (TextView) view.findViewById(R.id.mediaDetailuploadeddate);
nominatedforDeletion = (TextView) view.findViewById(R.id.nominatedDeletionBanner);
seeMore = (TextView) view.findViewById(R.id.seeMore);
nominatedforDeletion = (LinearLayout) view.findViewById(R.id.nominatedDeletionBanner);
delete = (Button) view.findViewById(R.id.nominateDeletion);
categoryContainer = (LinearLayout) view.findViewById(R.id.mediaDetailCategoryContainer);
@ -349,7 +351,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
});
}
if (nominatedforDeletion.getVisibility() == View.VISIBLE){
nominatedforDeletion.setOnClickListener(v -> {
seeMore.setOnClickListener(v -> {
openWebBrowser(media.getFilePageTitle().getMobileUri().toString());
});
}

View file

@ -251,19 +251,33 @@
android:layout_width="match_parent"
android:layout_height="@dimen/small_gap" />
<TextView
<LinearLayout
android:id="@+id/nominatedDeletionBanner"
android:background="@color/deleteBackgroundColor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/tiny_gap"
android:gravity="center"
android:text="@string/nominated_for_deletion"
android:textColor="@color/primaryTextColor"
android:orientation="vertical"
android:padding="@dimen/standard_gap"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
android:visibility="gone"/>
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/nominated_for_deletion"
android:textColor="@color/primaryTextColor"
android:textSize="@dimen/normal_text"
android:textStyle="bold"/>
<TextView
android:id="@+id/seeMore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/nominated_see_more"
android:paddingTop="@dimen/standard_gap"
android:textColor="@color/primaryTextColor"
android:textSize="@dimen/normal_text"
android:textStyle="bold"/>
</LinearLayout>
<Button
android:id="@+id/nominateDeletion"

View file

@ -231,7 +231,8 @@
<string name="no_web_browser">No web browser found to open URL</string>
<string name="null_url">Error! URL not found</string>
<string name="nominate_deletion">Nominate for Deletion</string>
<string name="nominated_for_deletion">This image has been nominated for deletion.\n\n<u>See webpage for details</u></string>
<string name="nominated_for_deletion">This image has been nominated for deletion.</string>
<string name="nominated_see_more"><u>See webpage for details</u></string>
<string name="view_browser">View in Browser</string>
<string name="nearby_location_has_not_changed">Location has not changed.</string>