mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Tidy up DirectUpload - overloaded constructor not necessary
This commit is contained in:
parent
3f7e22058a
commit
fec005304e
2 changed files with 3 additions and 11 deletions
|
|
@ -13,18 +13,10 @@ import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||||
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||||
|
|
||||||
public class DirectUpload {
|
class DirectUpload {
|
||||||
|
|
||||||
private ContributionController controller;
|
private ContributionController controller;
|
||||||
private Fragment fragment;
|
private Fragment fragment;
|
||||||
private SharedPreferences prefs;
|
|
||||||
|
|
||||||
|
|
||||||
DirectUpload(Fragment fragment, ContributionController controller, SharedPreferences prefs) {
|
|
||||||
this.fragment = fragment;
|
|
||||||
this.controller = controller;
|
|
||||||
this.prefs = prefs;
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectUpload(Fragment fragment, ContributionController controller) {
|
DirectUpload(Fragment fragment, ContributionController controller) {
|
||||||
this.fragment = fragment;
|
this.fragment = fragment;
|
||||||
|
|
|
||||||
|
|
@ -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(this, controller, prefs);
|
DirectUpload directUpload = new DirectUpload(this, controller);
|
||||||
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(this, controller, prefs);
|
DirectUpload directUpload = new DirectUpload(this, controller);
|
||||||
storeSharedPrefs();
|
storeSharedPrefs();
|
||||||
directUpload.initiateGalleryUpload();
|
directUpload.initiateGalleryUpload();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue