Giovani Guerra
08/01/2019, 6:56 PMsalomonbrys
08/02/2019, 6:58 PMGiovani Guerra
08/06/2019, 4:19 PMclass MyLibrarySdk private constructor(
context: Context
) : KodeinAware {
override val kodein: Kodein = Kodein.lazy {
// my bindings
}.on(context.applicationContext)
class Builder(private val context: Context) {
fun build(): MyLibrarySdk {
return MyLibrarySdk(context).also {
sdk = it
}
}
}
companion object {
lateinit var sdk: MyLibrarySdk
fun init(context: Context) {
context.startActivity(MyActivity.createIntent(context))
}
}
}
And a base activity to reference Kodein:
class BaseActivity: AppCompatActivity(), KodeinAware {
override val kodein = Kodein.lazy {
extend(MyLibrarySdk.sdk.kodein)
}
}
This is working for now, but is this right?salomonbrys
08/06/2019, 7:50 PM