2018-11-11 19:36:17 -08:00
|
|
|
package cash.z.android.wallet
|
|
|
|
|
2019-01-31 15:17:29 -08:00
|
|
|
import android.content.Context
|
|
|
|
import androidx.multidex.MultiDex
|
2018-11-11 19:36:17 -08:00
|
|
|
import cash.z.android.wallet.di.component.DaggerApplicationComponent
|
2019-02-19 05:22:45 -08:00
|
|
|
import cash.z.wallet.sdk.data.TroubleshootingTwig
|
|
|
|
import cash.z.wallet.sdk.data.Twig
|
2019-01-02 21:32:27 -08:00
|
|
|
import com.facebook.stetho.Stetho
|
2018-11-11 19:36:17 -08:00
|
|
|
import dagger.android.AndroidInjector
|
|
|
|
import dagger.android.DaggerApplication
|
|
|
|
|
2019-01-31 15:17:29 -08:00
|
|
|
|
2018-11-11 19:36:17 -08:00
|
|
|
class ZcashWalletApplication : DaggerApplication() {
|
|
|
|
|
2018-12-06 07:22:07 -08:00
|
|
|
override fun onCreate() {
|
|
|
|
instance = this
|
|
|
|
super.onCreate()
|
2019-01-02 21:32:27 -08:00
|
|
|
Stetho.initializeWithDefaults(this)
|
2019-02-19 05:22:45 -08:00
|
|
|
Twig.plant(TroubleshootingTwig())
|
2018-12-06 07:22:07 -08:00
|
|
|
}
|
|
|
|
|
2018-11-11 19:36:17 -08:00
|
|
|
/**
|
|
|
|
* Implement the HasActivityInjector behavior so that dagger knows which [AndroidInjector] to use.
|
|
|
|
*/
|
|
|
|
override fun applicationInjector(): AndroidInjector<out DaggerApplication> {
|
|
|
|
return DaggerApplicationComponent.builder().create(this)
|
|
|
|
}
|
2018-12-06 07:22:07 -08:00
|
|
|
|
2019-01-31 15:17:29 -08:00
|
|
|
override fun attachBaseContext(base: Context) {
|
|
|
|
super.attachBaseContext(base)
|
|
|
|
MultiDex.install(this)
|
|
|
|
}
|
|
|
|
|
2018-12-06 07:22:07 -08:00
|
|
|
companion object {
|
|
|
|
lateinit var instance: ZcashWalletApplication
|
|
|
|
}
|
2018-11-11 19:36:17 -08:00
|
|
|
}
|