mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
Complete initiateDirectUpload()
This commit is contained in:
parent
da5e20a547
commit
946c6c740d
2 changed files with 9 additions and 11 deletions
|
|
@ -49,8 +49,7 @@ class DirectUpload {
|
||||||
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) {
|
||||||
if (ContextCompat.checkSelfPermission(activity, READ_EXTERNAL_STORAGE)
|
if (ContextCompat.checkSelfPermission(activity, READ_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {
|
||||||
!= PERMISSION_GRANTED) {
|
|
||||||
if (activity.shouldShowRequestPermissionRationale(READ_EXTERNAL_STORAGE)) {
|
if (activity.shouldShowRequestPermissionRationale(READ_EXTERNAL_STORAGE)) {
|
||||||
new AlertDialog.Builder(activity)
|
new AlertDialog.Builder(activity)
|
||||||
.setMessage(activity.getString(R.string.read_storage_permission_rationale))
|
.setMessage(activity.getString(R.string.read_storage_permission_rationale))
|
||||||
|
|
@ -64,15 +63,13 @@ class DirectUpload {
|
||||||
} else {
|
} else {
|
||||||
activity.requestPermissions(new String[]{READ_EXTERNAL_STORAGE},
|
activity.requestPermissions(new String[]{READ_EXTERNAL_STORAGE},
|
||||||
1);
|
1);
|
||||||
|
}
|
||||||
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
|
} else {
|
||||||
// app-defined int constant. The callback method gets the
|
controller.startGalleryPick();
|
||||||
// result of the request.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
controller.startGalleryPick();
|
controller.startGalleryPick();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -386,8 +386,9 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
||||||
//TODO: Change this to activate camera upload (see ContributionsListFragment). Insert shared preference.
|
//TODO: Change this to activate camera 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());
|
||||||
|
|
||||||
DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription());
|
DirectUpload directUpload = new DirectUpload(place.getName(), place.getLongDescription(), this);
|
||||||
directUpload.storeSharedPrefs(getActivity());
|
directUpload.storeSharedPrefs(getActivity());
|
||||||
|
directUpload.initiateUpload(getActivity());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue