Reorganize code

This commit is contained in:
Kirill Kamakin
2022-04-03 17:21:18 +05:00
parent 984415bfb2
commit 8fee0c3a3d
19 changed files with 49 additions and 41 deletions

View File

@@ -10,9 +10,6 @@ import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import gq.kirmanak.mealient.data.AppDb
import gq.kirmanak.mealient.data.impl.OkHttpBuilder
import kotlinx.serialization.json.Json
import okhttp3.OkHttpClient
import javax.inject.Singleton
@Module
@@ -27,16 +24,4 @@ object AppModule {
@Singleton
fun createSharedPreferences(@ApplicationContext context: Context): SharedPreferences =
PreferenceManager.getDefaultSharedPreferences(context)
@Provides
@Singleton
fun createOkHttp(okHttpBuilder: OkHttpBuilder): OkHttpClient =
okHttpBuilder.buildOkHttp()
@Provides
@Singleton
fun createJson(): Json = Json {
coerceInputValues = true
ignoreUnknownKeys = true
}
}