mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Finish tidying up setOnClickListeners
This commit is contained in:
parent
8b533ef98d
commit
65b0b52b01
2 changed files with 7 additions and 2 deletions
|
|
@ -29,6 +29,11 @@ public class DirectUpload {
|
|||
this.prefs = prefs;
|
||||
}
|
||||
|
||||
DirectUpload(Fragment fragment, ContributionController controller) {
|
||||
this.fragment = fragment;
|
||||
this.controller = controller;
|
||||
}
|
||||
|
||||
void initiateCameraUpload() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (ContextCompat.checkSelfPermission(fragment.getActivity(), WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class PlaceRenderer extends Renderer<Place> {
|
|||
cameraButton.setOnClickListener(view2 -> {
|
||||
Timber.d("Camera button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
|
||||
controller = new ContributionController(fragment);
|
||||
DirectUpload directUpload = new DirectUpload(this, controller, prefs);
|
||||
DirectUpload directUpload = new DirectUpload(fragment, controller);
|
||||
storeSharedPrefs();
|
||||
directUpload.initiateCameraUpload();
|
||||
});
|
||||
|
|
@ -110,7 +110,7 @@ class PlaceRenderer extends Renderer<Place> {
|
|||
galleryButton.setOnClickListener(view3 -> {
|
||||
Timber.d("Gallery button tapped. Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
|
||||
controller = new ContributionController(fragment);
|
||||
DirectUpload directUpload = new DirectUpload(this, controller, prefs);
|
||||
DirectUpload directUpload = new DirectUpload(fragment, controller);
|
||||
storeSharedPrefs();
|
||||
directUpload.initiateGalleryUpload();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue