|
|
|
@ -32,6 +32,7 @@ import kotlinx.serialization.json.Json
|
|
|
|
|
import okhttp3.Call
|
|
|
|
|
import okhttp3.OkHttpClient
|
|
|
|
|
import okhttp3.logging.HttpLoggingInterceptor
|
|
|
|
|
import java.io.InputStream
|
|
|
|
|
import javax.inject.Singleton
|
|
|
|
|
|
|
|
|
|
@Module
|
|
|
|
@ -48,7 +49,10 @@ internal object NetworkModule {
|
|
|
|
|
@Singleton
|
|
|
|
|
fun providesDemoAssetManager(
|
|
|
|
|
@ApplicationContext context: Context,
|
|
|
|
|
): DemoAssetManager = DemoAssetManager(context.assets::open)
|
|
|
|
|
): DemoAssetManager = object : DemoAssetManager {
|
|
|
|
|
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
|
|
|
|
|
@Singleton
|
|
|
|
|