mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Merge pull request #1047 from psh/more-database-cleanup
More database related cleanup
This commit is contained in:
		
						commit
						1224302ccb
					
				
					 22 changed files with 211 additions and 151 deletions
				
			
		|  | @ -1,5 +1,6 @@ | |||
| package fr.free.nrw.commons.di; | ||||
| 
 | ||||
| import android.content.ContentProviderClient; | ||||
| import android.content.SharedPreferences; | ||||
| import android.preference.PreferenceManager; | ||||
| import android.support.v4.util.LruCache; | ||||
|  | @ -22,10 +23,14 @@ import fr.free.nrw.commons.nearby.NearbyPlaces; | |||
| import fr.free.nrw.commons.upload.UploadController; | ||||
| 
 | ||||
| import static android.content.Context.MODE_PRIVATE; | ||||
| import static fr.free.nrw.commons.contributions.ContributionsContentProvider.CONTRIBUTION_AUTHORITY; | ||||
| import static fr.free.nrw.commons.modifications.ModificationsContentProvider.MODIFICATIONS_AUTHORITY; | ||||
| 
 | ||||
| @Module | ||||
| @SuppressWarnings({"WeakerAccess", "unused"}) | ||||
| public class CommonsApplicationModule { | ||||
|     public static final String CATEGORY_AUTHORITY = "fr.free.nrw.commons.categories.contentprovider"; | ||||
| 
 | ||||
|     private CommonsApplication application; | ||||
| 
 | ||||
|     public CommonsApplicationModule(CommonsApplication application) { | ||||
|  | @ -37,6 +42,24 @@ public class CommonsApplicationModule { | |||
|         return new AccountUtil(application); | ||||
|     } | ||||
| 
 | ||||
|     @Provides | ||||
|     @Named("category") | ||||
|     public ContentProviderClient provideCategoryContentProviderClient() { | ||||
|         return application.getContentResolver().acquireContentProviderClient(CATEGORY_AUTHORITY); | ||||
|     } | ||||
| 
 | ||||
|     @Provides | ||||
|     @Named("contribution") | ||||
|     public ContentProviderClient provideContributionContentProviderClient() { | ||||
|         return application.getContentResolver().acquireContentProviderClient(CONTRIBUTION_AUTHORITY); | ||||
|     } | ||||
| 
 | ||||
|     @Provides | ||||
|     @Named("modification") | ||||
|     public ContentProviderClient provideModificationContentProviderClient() { | ||||
|         return application.getContentResolver().acquireContentProviderClient(MODIFICATIONS_AUTHORITY); | ||||
|     } | ||||
| 
 | ||||
|     @Provides | ||||
|     @Named("application_preferences") | ||||
|     public SharedPreferences providesApplicationSharedPreferences() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan