Switch to uploading from gallery

This commit is contained in:
misaochan 2018-01-01 20:28:41 +10:00
parent 946c6c740d
commit b76ecf74f8
2 changed files with 5 additions and 8 deletions

View file

@ -45,7 +45,7 @@ class DirectUpload {
Timber.d("After shared prefs, image title: " + imageTitle + " Image desc: " + imageDesc); Timber.d("After shared prefs, image title: " + imageTitle + " Image desc: " + imageDesc);
} }
void initiateUpload(Context context) { void initiateGalleryUpload(Context context) {
Activity activity = (Activity) context; Activity activity = (Activity) context;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

View file

@ -383,19 +383,16 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
distance.setText(place.distance.toString()); distance.setText(place.distance.toString());
fabCamera.setOnClickListener(view -> { fabCamera.setOnClickListener(view -> {
//TODO: Change this to activate camera upload (see ContributionsListFragment). Insert shared preference.
Timber.d("Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription(), this);
directUpload.storeSharedPrefs(getActivity());
directUpload.initiateUpload(getActivity());
}); });
fabGallery.setOnClickListener(view -> { fabGallery.setOnClickListener(view -> {
//TODO: Change this to activate gallery upload (see ContributionsListFragment). Insert shared preference.
Timber.d("Image title: " + place.getName() + "Image desc: " + place.getLongDescription()); Timber.d("Image title: " + place.getName() + "Image desc: " + place.getLongDescription());
openWebView(place.siteLinks.getWikidataLink());
DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription(), this);
directUpload.storeSharedPrefs(getActivity());
directUpload.initiateGalleryUpload(getActivity());
}); });
} }