|
|
@ -32,7 +32,6 @@ import kotlinx.serialization.json.Json
|
|
|
|
import okhttp3.Call
|
|
|
|
import okhttp3.Call
|
|
|
|
import okhttp3.OkHttpClient
|
|
|
|
import okhttp3.OkHttpClient
|
|
|
|
import okhttp3.logging.HttpLoggingInterceptor
|
|
|
|
import okhttp3.logging.HttpLoggingInterceptor
|
|
|
|
import java.io.InputStream
|
|
|
|
|
|
|
|
import javax.inject.Singleton
|
|
|
|
import javax.inject.Singleton
|
|
|
|
|
|
|
|
|
|
|
|
@Module
|
|
|
|
@Module
|
|
|
@ -49,10 +48,7 @@ internal object NetworkModule {
|
|
|
|
@Singleton
|
|
|
|
@Singleton
|
|
|
|
fun providesDemoAssetManager(
|
|
|
|
fun providesDemoAssetManager(
|
|
|
|
@ApplicationContext context: Context,
|
|
|
|
@ApplicationContext context: Context,
|
|
|
|
): DemoAssetManager = object : DemoAssetManager {
|
|
|
|
): DemoAssetManager = DemoAssetManager(context.assets::open)
|
|
|
|
override fun open(fileName: String): InputStream = context.assets.open(fileName)
|
|
|
|
|
|
|
|
override fun readText(fileName: String): String = context.assets.open(fileName).bufferedReader().use { it.readText() }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@Singleton
|
|
|
|
@Singleton
|
|
|
|