Create ContributionController object

This commit is contained in:
misaochan 2018-01-01 20:19:25 +10:00 committed by maskara
parent 8fe03f1e4e
commit 1a7ea256cc
2 changed files with 5 additions and 3 deletions

View file

@ -25,14 +25,14 @@ import static fr.free.nrw.commons.contributions.Contribution.SOURCE_CAMERA;
import static fr.free.nrw.commons.contributions.Contribution.SOURCE_GALLERY; import static fr.free.nrw.commons.contributions.Contribution.SOURCE_GALLERY;
import static fr.free.nrw.commons.upload.UploadService.EXTRA_SOURCE; import static fr.free.nrw.commons.upload.UploadService.EXTRA_SOURCE;
class ContributionController { public class ContributionController {
private static final int SELECT_FROM_GALLERY = 1; private static final int SELECT_FROM_GALLERY = 1;
private static final int SELECT_FROM_CAMERA = 2; private static final int SELECT_FROM_CAMERA = 2;
private Fragment fragment; private Fragment fragment;
ContributionController(Fragment fragment) { public ContributionController(Fragment fragment) {
this.fragment = fragment; this.fragment = fragment;
} }

View file

@ -4,6 +4,7 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
@ -20,9 +21,10 @@ class DirectUpload {
private String desc; private String desc;
private ContributionController controller; private ContributionController controller;
DirectUpload(String title, String desc) { DirectUpload(String title, String desc, Fragment fragment) {
this.title = title; this.title = title;
this.desc = desc; this.desc = desc;
controller = new ContributionController(fragment);
} }
void storeSharedPrefs(Context context) { void storeSharedPrefs(Context context) {