mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Work towards eliminating string literals from code. (#1861)
String literals are being used in many places in the code, instead of proper string resources which are automatically localized. This PR replaces many of the string literals with pre-packaged resources, or will add the appropriate string if necessary.
This commit is contained in:
		
							parent
							
								
									b84e22c292
								
							
						
					
					
						commit
						e945d45558
					
				
					 8 changed files with 23 additions and 26 deletions
				
			
		|  | @ -3,13 +3,11 @@ package fr.free.nrw.commons.contributions; | |||
| import android.content.Intent; | ||||
| import android.content.SharedPreferences; | ||||
| import android.content.pm.PackageManager; | ||||
| import android.net.Uri; | ||||
| import android.os.Build; | ||||
| import android.os.Bundle; | ||||
| import android.support.annotation.NonNull; | ||||
| import android.support.v4.content.ContextCompat; | ||||
| import android.support.v7.app.AlertDialog; | ||||
| import android.util.Log; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.Menu; | ||||
| import android.view.MenuInflater; | ||||
|  | @ -33,7 +31,6 @@ import fr.free.nrw.commons.BuildConfig; | |||
| import fr.free.nrw.commons.R; | ||||
| import fr.free.nrw.commons.di.CommonsDaggerSupportFragment; | ||||
| import fr.free.nrw.commons.nearby.NearbyActivity; | ||||
| import fr.free.nrw.commons.utils.ContributionUtils; | ||||
| import timber.log.Timber; | ||||
| 
 | ||||
| import static android.Manifest.permission.READ_EXTERNAL_STORAGE; | ||||
|  | @ -154,11 +151,11 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { | |||
| 
 | ||||
|                             new AlertDialog.Builder(getActivity()) | ||||
|                                     .setMessage(getString(R.string.read_storage_permission_rationale)) | ||||
|                                     .setPositiveButton("OK", (dialog, which) -> { | ||||
|                                     .setPositiveButton(android.R.string.ok, (dialog, which) -> { | ||||
|                                         requestPermissions(new String[]{READ_EXTERNAL_STORAGE}, 1); | ||||
|                                         dialog.dismiss(); | ||||
|                                     }) | ||||
|                                     .setNegativeButton("Cancel", null) | ||||
|                                     .setNegativeButton(android.R.string.cancel, null) | ||||
|                                     .create() | ||||
|                                     .show(); | ||||
| 
 | ||||
|  | @ -196,11 +193,11 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment { | |||
|                             // sees the explanation, try again to request the permission. | ||||
|                             new AlertDialog.Builder(getActivity()) | ||||
|                                     .setMessage(getString(R.string.write_storage_permission_rationale)) | ||||
|                                     .setPositiveButton("OK", (dialog, which) -> { | ||||
|                                     .setPositiveButton(android.R.string.ok, (dialog, which) -> { | ||||
|                                         requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE}, 3); | ||||
|                                         dialog.dismiss(); | ||||
|                                     }) | ||||
|                                     .setNegativeButton("Cancel", null) | ||||
|                                     .setNegativeButton(android.R.string.cancel, null) | ||||
|                                     .create() | ||||
|                                     .show(); | ||||
|                         } else { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dmitry Brant
						Dmitry Brant