diff --git a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java
index b32d83a31..6d46da801 100644
--- a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java
+++ b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java
@@ -23,7 +23,9 @@ import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.assist.ImageLoadingListener;
import java.io.IOException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Date;
import fr.free.nrw.commons.CommonsApplication;
import fr.free.nrw.commons.License;
@@ -71,6 +73,7 @@ public class MediaDetailFragment extends Fragment {
private TextView desc;
private TextView license;
private TextView coordinates;
+ private TextView uploadedDate;
private LinearLayout categoryContainer;
private ScrollView scrollView;
private ArrayList categoryNames;
@@ -125,6 +128,7 @@ public class MediaDetailFragment extends Fragment {
desc = (TextView) view.findViewById(R.id.mediaDetailDesc);
license = (TextView) view.findViewById(R.id.mediaDetailLicense);
coordinates = (TextView) view.findViewById(R.id.mediaDetailCoordinates);
+ uploadedDate = (TextView) view.findViewById(R.id.mediaDetailuploadeddate);
categoryContainer = (LinearLayout) view.findViewById(R.id.mediaDetailCategoryContainer);
licenseList = new LicenseList(getActivity());
@@ -229,6 +233,7 @@ public class MediaDetailFragment extends Fragment {
desc.setText(prettyDescription(media));
license.setText(prettyLicense(media));
coordinates.setText(prettyCoordinates(media));
+ uploadedDate.setText(prettyUploadedDate(media));
categoryNames.removeAll(categoryNames);
categoryNames.addAll(media.getCategories());
@@ -392,6 +397,16 @@ public class MediaDetailFragment extends Fragment {
}
}
+ private String prettyUploadedDate(Media media) {
+ Date date = media.getDateUploaded();
+ if (date.toString() == null || date.toString().isEmpty()) {
+ return "Uploaded date not available";
+ }
+ SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy");
+ String formattedDate = formatter.format(date);
+ return formattedDate;
+ }
+
/**
* Returns the coordinates nicely formatted.
*
diff --git a/app/src/main/res/layout/fragment_media_detail.xml b/app/src/main/res/layout/fragment_media_detail.xml
index 279957270..121f777c4 100644
--- a/app/src/main/res/layout/fragment_media_detail.xml
+++ b/app/src/main/res/layout/fragment_media_detail.xml
@@ -217,6 +217,41 @@
android:id="@+id/mediaDetailCategoryContainer"
/>
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 679797a6e..6ffb94a83 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -167,6 +167,7 @@ Tap this message (or hit back) to skip this step.
Title of the media
Description
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.
+ Uploaded date>
Become a Beta Tester
Opt-in to our beta channel on Google Play and get early access to new features and bug fixes
https://play.google.com/apps/testing/fr.free.nrw.commons