add user data fetch support.
This commit is contained in:
parent
9ce20ba374
commit
6254ec4f02
28 changed files with 467 additions and 142 deletions
|
|
@ -17,8 +17,10 @@ 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.user.IUserRepository
|
||||
import com.pixelized.biblib.repository.user.UserRepository
|
||||
import com.pixelized.biblib.utils.BitmapCache
|
||||
import com.pixelized.biblib.utils.injection.Bob
|
||||
import com.pixelized.biblib.utils.injection.ServiceLocator
|
||||
|
||||
class BibLibApplication : Application() {
|
||||
|
||||
|
|
@ -26,21 +28,22 @@ class BibLibApplication : Application() {
|
|||
super.onCreate()
|
||||
|
||||
// Android.
|
||||
Bob[BibLibDatabase::class] =
|
||||
ServiceLocator[BibLibDatabase::class] =
|
||||
Room.databaseBuilder(this, BibLibDatabase::class.java, BibLibDatabase.DATABASE_NAME)
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
Bob[SharedPreferences::class] = getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE)
|
||||
ServiceLocator[SharedPreferences::class] = getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE)
|
||||
// Web service.
|
||||
Bob[Gson::class] = GsonBuilder().create()
|
||||
Bob[IBibLibClient::class] = BibLibClient()
|
||||
ServiceLocator[Gson::class] = GsonBuilder().create()
|
||||
ServiceLocator[IBibLibClient::class] = BibLibClient()
|
||||
// Bitmap cache.
|
||||
Bob[BitmapCache::class] = BitmapCache(this)
|
||||
ServiceLocator[BitmapCache::class] = BitmapCache(this)
|
||||
// Repositories.
|
||||
Bob[IGoogleSingInRepository::class] = GoogleSingInRepository(this)
|
||||
Bob[ICredentialRepository::class] = CredentialRepository()
|
||||
Bob[IAPICacheRepository::class] = APICacheRepository()
|
||||
Bob[IBookRepository::class] = BookRepository()
|
||||
ServiceLocator[IGoogleSingInRepository::class] = GoogleSingInRepository(this)
|
||||
ServiceLocator[ICredentialRepository::class] = CredentialRepository()
|
||||
ServiceLocator[IAPICacheRepository::class] = APICacheRepository()
|
||||
ServiceLocator[IBookRepository::class] = BookRepository()
|
||||
ServiceLocator[IUserRepository::class] = UserRepository()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue