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
This commit is contained in:
yashshah7197 2018-03-12 18:06:04 +05:30
parent 2516445d68
commit 87b794ce1f

View file

@ -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<String> licenseItems = new ArrayList<>();
licenseItems.add(getString(R.string.license_name_cc0));
licenseItems.add(getString(R.string.license_name_cc_by));