mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Tidy up DirectUpload.java
This commit is contained in:
		
							parent
							
								
									cd713caa5e
								
							
						
					
					
						commit
						d01d6a69f2
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		|  | @ -1,12 +1,8 @@ | |||
| package fr.free.nrw.commons.nearby; | ||||
| 
 | ||||
| import android.app.Activity; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.content.SharedPreferences; | ||||
| import android.content.pm.PackageManager; | ||||
| import android.os.Build; | ||||
| import android.support.annotation.NonNull; | ||||
| import android.support.v4.app.Fragment; | ||||
| import android.support.v4.content.ContextCompat; | ||||
| import android.support.v7.app.AlertDialog; | ||||
|  | @ -16,7 +12,6 @@ import javax.inject.Named; | |||
| 
 | ||||
| import fr.free.nrw.commons.R; | ||||
| import fr.free.nrw.commons.contributions.ContributionController; | ||||
| import timber.log.Timber; | ||||
| 
 | ||||
| import static android.Manifest.permission.READ_EXTERNAL_STORAGE; | ||||
| import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; | ||||
|  | @ -40,7 +35,7 @@ class DirectUpload { | |||
|     } | ||||
| 
 | ||||
|     void storeSharedPrefs() { | ||||
|         SharedPreferences sharedPref = fragment.getActivity().getSharedPreferences("Direct Upload",Context.MODE_PRIVATE); | ||||
|         SharedPreferences sharedPref = fragment.getActivity().getSharedPreferences("Direct Upload", Context.MODE_PRIVATE); | ||||
|         SharedPreferences.Editor editor = sharedPref.edit(); | ||||
| 
 | ||||
|         editor.putString("Title", title); | ||||
|  | @ -50,7 +45,7 @@ class DirectUpload { | |||
| 
 | ||||
|     void initiateCameraUpload() { | ||||
|         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | ||||
|             if (ContextCompat.checkSelfPermission(fragment.getActivity(), WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { | ||||
|             if (ContextCompat.checkSelfPermission(fragment.getActivity(), WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED) { | ||||
|                 if (fragment.getActivity().shouldShowRequestPermissionRationale(WRITE_EXTERNAL_STORAGE)) { | ||||
|                     new AlertDialog.Builder(fragment.getActivity()) | ||||
|                             .setMessage(fragment.getActivity().getString(R.string.write_storage_permission_rationale)) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan