mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Migrated nearby/fragments/NearbyParentFragment.java to nearby/fragments/NearbyParentFragment.kt
This commit is contained in:
parent
ce2b0d8025
commit
20c83ac556
2 changed files with 9 additions and 0 deletions
|
|
@ -138,6 +138,7 @@ open class CommonsApplicationModule(private val applicationContext: Context) {
|
|||
*/
|
||||
@Provides
|
||||
@Named("default_preferences")
|
||||
@Singleton
|
||||
open fun providesDefaultKvStore(context: Context, gson: Gson): JsonKvStore =
|
||||
JsonKvStore(context, "${context.packageName}_preferences", gson)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,18 @@ package fr.free.nrw.commons.di
|
|||
import android.app.Activity
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import fr.free.nrw.commons.kvstore.JsonKvStore
|
||||
import fr.free.nrw.commons.nearby.fragments.NearbyParentFragment
|
||||
import javax.inject.Named
|
||||
|
||||
@Module
|
||||
class NearbyParentFragmentModule {
|
||||
@Provides
|
||||
fun NearbyParentFragment.providesActivity(): Activity = activity!!
|
||||
@Provides
|
||||
fun providesApplicationKvStore(
|
||||
@Named("default_preferences") kvStore: JsonKvStore
|
||||
): JsonKvStore {
|
||||
return kvStore
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue