koin-android / org.koin.android.ext.android / android.content.ComponentCallbacks

Extensions for android.content.ComponentCallbacks

get

fun <T : Any> ComponentCallbacks.get(name: String = "", scope: Scope? = null, parameters: ParameterDefinition = emptyParameterDefinition()): T

get given dependency for Android component

getKoin

fun ComponentCallbacks.getKoin(): KoinContext

Get Koin context

inject

fun <T : Any> ComponentCallbacks.inject(name: String = "", scope: Scope? = null, parameters: ParameterDefinition = emptyParameterDefinition()): Lazy<T>

inject lazily given dependency for Android component

property

fun <T> ComponentCallbacks.property(key: String): Lazy<T>

lazy inject given property for Android component

fun <T> ComponentCallbacks.property(key: String, defaultValue: T): Lazy<T>

lazy inject given property for Android component give a default value if property is missing

release

fun ComponentCallbacks.release(path: String): Unit

Release a Module from given Path

releaseContext

fun ComponentCallbacks.releaseContext(path: String): Unit

Release a Module from given Path

setProperty

fun ComponentCallbacks.setProperty(key: String, value: Any): Unit

Set a property

startKoin

fun ComponentCallbacks.startKoin(context: Context, modules: List<Module>, extraProperties: Map<String, Any> = HashMap(), loadProperties: Boolean = false, logger: Logger = AndroidLogger()): Unit

Create a new Koin ModuleDefinition