forked from upstream-mirrors/quik
use dependency injection for conversation viewmodel
This commit is contained in:
@@ -2,11 +2,19 @@ package com.moez.QKSMS
|
||||
|
||||
import android.app.Application
|
||||
import com.bugsnag.android.Bugsnag
|
||||
import com.moez.QKSMS.dagger.AppComponent
|
||||
import com.moez.QKSMS.dagger.AppModule
|
||||
import com.moez.QKSMS.dagger.ConversationModule
|
||||
import com.moez.QKSMS.dagger.DaggerAppComponent
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmConfiguration
|
||||
|
||||
|
||||
class QKApplication : Application() {
|
||||
|
||||
var appComponent: AppComponent? = null
|
||||
private set
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
@@ -16,6 +24,11 @@ class QKApplication : Application() {
|
||||
Realm.setDefaultConfiguration(RealmConfiguration.Builder()
|
||||
.deleteRealmIfMigrationNeeded()
|
||||
.build())
|
||||
|
||||
appComponent = DaggerAppComponent.builder()
|
||||
.appModule(AppModule(this))
|
||||
.conversationModule(ConversationModule())
|
||||
.build()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user