Skip to content

Commit 20c83ac

Browse files
Migrated nearby/fragments/NearbyParentFragment.java to nearby/fragments/NearbyParentFragment.kt
1 parent ce2b0d8 commit 20c83ac

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ open class CommonsApplicationModule(private val applicationContext: Context) {
138138
*/
139139
@Provides
140140
@Named("default_preferences")
141+
@Singleton
141142
open fun providesDefaultKvStore(context: Context, gson: Gson): JsonKvStore =
142143
JsonKvStore(context, "${context.packageName}_preferences", gson)
143144

app/src/main/java/fr/free/nrw/commons/di/NearbyParentFragmentModule.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ package fr.free.nrw.commons.di
33
import android.app.Activity
44
import dagger.Module
55
import dagger.Provides
6+
import fr.free.nrw.commons.kvstore.JsonKvStore
67
import fr.free.nrw.commons.nearby.fragments.NearbyParentFragment
8+
import javax.inject.Named
79

810
@Module
911
class NearbyParentFragmentModule {
1012
@Provides
1113
fun NearbyParentFragment.providesActivity(): Activity = activity!!
14+
@Provides
15+
fun providesApplicationKvStore(
16+
@Named("default_preferences") kvStore: JsonKvStore
17+
): JsonKvStore {
18+
return kvStore
19+
}
1220
}

0 commit comments

Comments
 (0)