Add APICache + splashscreen init.

This commit is contained in:
Thomas Andres Gomez 2021-05-09 14:45:37 +02:00
parent e9cb8cd0ac
commit 2ad8d5953a
16 changed files with 309 additions and 15 deletions

View file

@ -1,29 +1,38 @@
package com.pixelized.biblib
import android.app.Application
import android.content.Context
import android.content.SharedPreferences
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.pixelized.biblib.utils.injection.Bob
import com.pixelized.biblib.network.client.BibLibClient
import com.pixelized.biblib.network.client.IBibLibClient
import com.pixelized.biblib.repository.apiCache.APICacheRepository
import com.pixelized.biblib.repository.apiCache.IAPICacheRepository
import com.pixelized.biblib.repository.credential.CredentialRepository
import com.pixelized.biblib.repository.credential.ICredentialRepository
import com.pixelized.biblib.repository.googlesignin.GoogleSingInRepository
import com.pixelized.biblib.repository.googlesignin.IGoogleSingInRepository
import com.pixelized.biblib.repository.googleSignIn.GoogleSingInRepository
import com.pixelized.biblib.repository.googleSignIn.IGoogleSingInRepository
import com.pixelized.biblib.utils.BitmapCache
import com.pixelized.biblib.utils.injection.Bob
class BibLibApplication : Application() {
override fun onCreate() {
super.onCreate()
Bob[BitmapCache::class] = BitmapCache(this)
Bob[SharedPreferences::class] = getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE)
Bob[Gson::class] = GsonBuilder().create()
Bob[BitmapCache::class] = BitmapCache(this)
Bob[IBibLibClient::class] = BibLibClient()
Bob[IGoogleSingInRepository::class] = GoogleSingInRepository(this)
Bob[ICredentialRepository::class] = CredentialRepository(this)
Bob[ICredentialRepository::class] = CredentialRepository()
Bob[IAPICacheRepository::class] = APICacheRepository()
}
companion object {
const val SHARED_PREF = "BIB_LIB_SHARED_PREF"
}
}