mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +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; | ||||
| 
 | ||||
|         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | ||||
|             if (ContextCompat.checkSelfPermission(activity, READ_EXTERNAL_STORAGE) | ||||
|                     != PERMISSION_GRANTED) { | ||||
|             if (ContextCompat.checkSelfPermission(activity, READ_EXTERNAL_STORAGE) != PERMISSION_GRANTED) { | ||||
|                 if (activity.shouldShowRequestPermissionRationale(READ_EXTERNAL_STORAGE)) { | ||||
|                     new AlertDialog.Builder(activity) | ||||
|                             .setMessage(activity.getString(R.string.read_storage_permission_rationale)) | ||||
|  | @ -64,15 +63,13 @@ class DirectUpload { | |||
|                 } else { | ||||
|                     activity.requestPermissions(new String[]{READ_EXTERNAL_STORAGE}, | ||||
|                             1); | ||||
| 
 | ||||
|                     // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an | ||||
|                     // app-defined int constant. The callback method gets the | ||||
|                     // result of the request. | ||||
|                 } | ||||
|             } else { | ||||
|                 controller.startGalleryPick(); | ||||
|             } | ||||
|                 else { | ||||
|                     controller.startGalleryPick(); | ||||
|                     return true; | ||||
|                 } | ||||
|         } | ||||
|         else { | ||||
|             controller.startGalleryPick(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -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. | ||||
|             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.initiateUpload(getActivity()); | ||||
| 
 | ||||
|         }); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan