mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +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 title;
|
||||||
private String description;
|
private String description;
|
||||||
private Snackbar snackbar;
|
private Snackbar snackbar;
|
||||||
|
private boolean duplicateCheckPassed = false;
|
||||||
|
|
||||||
private String nearbyTitle;
|
private String nearbyTitle;
|
||||||
private String nearbyDesc;
|
private String nearbyDesc;
|
||||||
private boolean duplicateCheckPassed = false;
|
|
||||||
private boolean haveCheckedForOtherImages = false;
|
private boolean haveCheckedForOtherImages = false;
|
||||||
|
private boolean isNearbyUpload = false;
|
||||||
/**
|
/**
|
||||||
* Called when user taps the submit button.
|
* Called when user taps the submit button.
|
||||||
*/
|
*/
|
||||||
|
|
@ -213,6 +215,10 @@ public class ShareActivity
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isNearbyUpload() {
|
||||||
|
return isNearbyUpload;
|
||||||
|
}
|
||||||
|
|
||||||
protected String getNearbyTitle() {
|
protected String getNearbyTitle() {
|
||||||
return nearbyTitle;
|
return nearbyTitle;
|
||||||
}
|
}
|
||||||
|
|
@ -249,6 +255,7 @@ public class ShareActivity
|
||||||
}
|
}
|
||||||
if (intent.hasExtra("isDirectUpload")) {
|
if (intent.hasExtra("isDirectUpload")) {
|
||||||
Timber.d("This was initiated by a direct upload from Nearby");
|
Timber.d("This was initiated by a direct upload from Nearby");
|
||||||
|
isNearbyUpload = true;
|
||||||
|
|
||||||
SharedPreferences sharedPref = this.getSharedPreferences("Direct Upload", Context.MODE_PRIVATE);
|
SharedPreferences sharedPref = this.getSharedPreferences("Direct Upload", Context.MODE_PRIVATE);
|
||||||
nearbyTitle = sharedPref.getString("Title", "");
|
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);
|
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
|
//TODO: Get this to display title and desc
|
||||||
if (true) {
|
if (isNearbyUpload) {
|
||||||
String imageTitle = ((ShareActivity) getActivity()).getNearbyTitle();
|
String imageTitle = ((ShareActivity) getActivity()).getNearbyTitle();
|
||||||
String imageDesc = ((ShareActivity) getActivity()).getNearbyDesc();
|
String imageDesc = ((ShareActivity) getActivity()).getNearbyDesc();
|
||||||
titleEdit.setText(imageTitle);
|
titleEdit.setText(imageTitle);
|
||||||
|
|
@ -269,6 +271,7 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("StringFormatInvalid")
|
||||||
private void setLicenseSummary(String license) {
|
private void setLicenseSummary(String license) {
|
||||||
licenseSummaryView.setText(getString(R.string.share_license_summary, getString(Utils.licenseNameFor(license))));
|
licenseSummaryView.setText(getString(R.string.share_license_summary, getString(Utils.licenseNameFor(license))));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue