mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Add check in SingleUploadFragment for isNearbyUploadf
This commit is contained in:
parent
0a6ed18c83
commit
2e59a8e0b6
2 changed files with 13 additions and 3 deletions
|
|
@ -112,10 +112,12 @@ public class ShareActivity
|
|||
private String title;
|
||||
private String description;
|
||||
private Snackbar snackbar;
|
||||
private boolean duplicateCheckPassed = false;
|
||||
|
||||
private String nearbyTitle;
|
||||
private String nearbyDesc;
|
||||
private boolean duplicateCheckPassed = false;
|
||||
private boolean haveCheckedForOtherImages = false;
|
||||
private boolean isNearbyUpload = false;
|
||||
/**
|
||||
* Called when user taps the submit button.
|
||||
*/
|
||||
|
|
@ -213,6 +215,10 @@ public class ShareActivity
|
|||
finish();
|
||||
}
|
||||
|
||||
protected boolean isNearbyUpload() {
|
||||
return isNearbyUpload;
|
||||
}
|
||||
|
||||
protected String getNearbyTitle() {
|
||||
return nearbyTitle;
|
||||
}
|
||||
|
|
@ -249,6 +255,7 @@ public class ShareActivity
|
|||
}
|
||||
if (intent.hasExtra("isDirectUpload")) {
|
||||
Timber.d("This was initiated by a direct upload from Nearby");
|
||||
isNearbyUpload = true;
|
||||
|
||||
SharedPreferences sharedPref = this.getSharedPreferences("Direct Upload", Context.MODE_PRIVATE);
|
||||
nearbyTitle = sharedPref.getString("Title", "");
|
||||
|
|
|
|||
|
|
@ -106,8 +106,10 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
|
|||
|
||||
license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA_3);
|
||||
|
||||
boolean isNearbyUpload = ((ShareActivity) getActivity()).isNearbyUpload();
|
||||
|
||||
//TODO: Get this to display title and desc
|
||||
if (true) {
|
||||
if (isNearbyUpload) {
|
||||
String imageTitle = ((ShareActivity) getActivity()).getNearbyTitle();
|
||||
String imageDesc = ((ShareActivity) getActivity()).getNearbyDesc();
|
||||
titleEdit.setText(imageTitle);
|
||||
|
|
@ -268,7 +270,8 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("StringFormatInvalid")
|
||||
private void setLicenseSummary(String license) {
|
||||
licenseSummaryView.setText(getString(R.string.share_license_summary, getString(Utils.licenseNameFor(license))));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue