mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Clean up DirectNearbyUpload constructor
This commit is contained in:
parent
82e9ffbdb8
commit
5a0a8c6019
2 changed files with 3 additions and 8 deletions
|
|
@ -19,17 +19,13 @@ import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||||
|
|
||||||
public class DirectUpload {
|
public class DirectUpload {
|
||||||
|
|
||||||
private String title;
|
|
||||||
private String desc;
|
|
||||||
private ContributionController controller;
|
private ContributionController controller;
|
||||||
private Fragment fragment;
|
private Fragment fragment;
|
||||||
private SharedPreferences prefs;
|
private SharedPreferences prefs;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DirectUpload(String title, String desc, Fragment fragment, ContributionController controller, SharedPreferences prefs) {
|
DirectUpload(Fragment fragment, ContributionController controller, SharedPreferences prefs) {
|
||||||
this.title = title;
|
|
||||||
this.desc = desc;
|
|
||||||
this.fragment = fragment;
|
this.fragment = fragment;
|
||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
this.prefs = prefs;
|
this.prefs = prefs;
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
fabCamera.setOnClickListener(view -> {
|
fabCamera.setOnClickListener(view -> {
|
||||||
Timber.d("Camera button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
|
Timber.d("Camera button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
|
||||||
controller = new ContributionController(this);
|
controller = new ContributionController(this);
|
||||||
DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription(), this, controller, prefs);
|
DirectUpload directUpload = new DirectUpload(this, controller, prefs);
|
||||||
storeSharedPrefs();
|
storeSharedPrefs();
|
||||||
directUpload.initiateCameraUpload();
|
directUpload.initiateCameraUpload();
|
||||||
});
|
});
|
||||||
|
|
@ -418,7 +418,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
fabGallery.setOnClickListener(view -> {
|
fabGallery.setOnClickListener(view -> {
|
||||||
Timber.d("Gallery button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
|
Timber.d("Gallery button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
|
||||||
controller = new ContributionController(this);
|
controller = new ContributionController(this);
|
||||||
DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription(), this, controller, prefs);
|
DirectUpload directUpload = new DirectUpload(this, controller, prefs);
|
||||||
storeSharedPrefs();
|
storeSharedPrefs();
|
||||||
directUpload.initiateGalleryUpload();
|
directUpload.initiateGalleryUpload();
|
||||||
|
|
||||||
|
|
@ -429,7 +429,6 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
|
|
||||||
void storeSharedPrefs() {
|
void storeSharedPrefs() {
|
||||||
SharedPreferences.Editor editor = directPrefs.edit();
|
SharedPreferences.Editor editor = directPrefs.edit();
|
||||||
|
|
||||||
editor.putString("Title", place.getName());
|
editor.putString("Title", place.getName());
|
||||||
editor.putString("Desc", place.getLongDescription());
|
editor.putString("Desc", place.getLongDescription());
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue