mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Injected the CategoryDao where needed.
This commit is contained in:
		
							parent
							
								
									feb435304f
								
							
						
					
					
						commit
						1d3befcbd2
					
				
					 4 changed files with 35 additions and 19 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; | ||||
|  | @ -26,6 +27,8 @@ import static android.content.Context.MODE_PRIVATE; | |||
| @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 +40,12 @@ public class CommonsApplicationModule { | |||
|         return new AccountUtil(application); | ||||
|     } | ||||
| 
 | ||||
|     @Provides | ||||
|     @Named("category") | ||||
|     public ContentProviderClient provideContentProviderClient() { | ||||
|         return application.getContentResolver().acquireContentProviderClient(CATEGORY_AUTHORITY); | ||||
|     } | ||||
| 
 | ||||
|     @Provides | ||||
|     @Named("application_preferences") | ||||
|     public SharedPreferences providesApplicationSharedPreferences() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Paul Hawke
						Paul Hawke