From 87b794ce1f65baec423af0b91c6aea02877b0ca8 Mon Sep 17 00:00:00 2001 From: yashshah7197 Date: Mon, 12 Mar 2018 18:06:04 +0530 Subject: [PATCH] feat: Add checks for title and description in intent extras. In case other apps want to send a title and description along with the image, we check if those have been passed as intent extras and set the EditText values accordingly. Fixes: #1273 See also: #892 --- .../fr/free/nrw/commons/upload/SingleUploadFragment.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java b/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java index 6a6083403..a11e7066c 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java @@ -101,6 +101,14 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment { View rootView = inflater.inflate(R.layout.fragment_single_upload, container, false); ButterKnife.bind(this, rootView); + Intent activityIntent = getActivity().getIntent(); + if (activityIntent.hasExtra("title")) { + titleEdit.setText(activityIntent.getStringExtra("title")); + } + if (activityIntent.hasExtra("description")) { + descEdit.setText(activityIntent.getStringExtra("description")); + } + ArrayList licenseItems = new ArrayList<>(); licenseItems.add(getString(R.string.license_name_cc0)); licenseItems.add(getString(R.string.license_name_cc_by));