diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 253bdaea8..8e56b91d6 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -91,6 +91,10 @@
android:name=".notification.NotificationActivity"
android:label="@string/navigation_item_notification" />
+
+
categoryNames;
private boolean categoriesLoaded = false;
@@ -122,6 +127,7 @@ 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);
+ delete = (Button) view.findViewById(R.id.nominateDeletion);
categoryContainer = (LinearLayout) view.findViewById(R.id.mediaDetailCategoryContainer);
licenseList = new LicenseList(getActivity());
@@ -181,6 +187,12 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
Timber.d("MediaDetailFragment ready to display details");
displayMediaDetails(media);
}
+ if (media instanceof Contribution) {
+ Contribution c = (Contribution) media;
+ if (c.getState()!= Contribution.STATE_COMPLETED) {
+ delete.setVisibility(View.GONE);
+ }
+ }
}
private void displayMediaDetails(final Media media) {
@@ -283,6 +295,14 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
if (media.getCoordinates() != null) {
coordinates.setOnClickListener(v -> openMap(media.getCoordinates()));
}
+ if (delete.getVisibility()!=View.GONE){
+ delete.setOnClickListener(v -> {
+ Bundle bundle = new Bundle();
+ bundle.putParcelable("media",media);
+ Intent deleteIntent = new Intent(getActivity(), DeleteActivity.class);
+ startActivity(deleteIntent);
+ });
+ }
}
private void rebuildCatList() {
diff --git a/app/src/main/res/layout/activity_delete.xml b/app/src/main/res/layout/activity_delete.xml
new file mode 100644
index 000000000..42b83f37d
--- /dev/null
+++ b/app/src/main/res/layout/activity_delete.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_media_detail.xml b/app/src/main/res/layout/fragment_media_detail.xml
index 5cc303763..d2438bd2a 100644
--- a/app/src/main/res/layout/fragment_media_detail.xml
+++ b/app/src/main/res/layout/fragment_media_detail.xml
@@ -247,6 +247,23 @@
android:textSize="@dimen/description_text_size" />
+
+
+
+
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index ccca64215..8e79f581e 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -15,6 +15,8 @@
#ffffff
#000000
+ #d50000
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index cf7052201..44f122f3c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -75,6 +75,7 @@
Categories
Settings
Sign Up
+ Request Deletion
About
The Wikimedia Commons app is an open-source app created and maintained by grantees and volunteers of the Wikimedia community. The Wikimedia Foundation is not involved in the creation, development, or maintenance of the app.
Wikimedia Commons
@@ -225,6 +226,7 @@
Send log file
Send log file to developers via email
Error! URL not found
+ Nominate for Deletion
Location has not changed.
Location not available.