koin-androidx-scope / org.koin.androidx.scope / ScopeFragment

ScopeFragment

abstract class ScopeFragment : Fragment, KoinScopeComponent

ScopeFragment

Fragment, allow to create & destroy tied Koin scope

Author
Arnaud Giuliani

Constructors

<init>

ScopeFragment

ScopeFragment(contentLayoutId: Int = 0, initialiseScope: Boolean = true)

Properties

scope

open val scope: Scope

scopeActivity

val scopeActivity: ScopeActivity?

Functions

get

get given dependency

fun <T : Any> KoinScopeComponent.get(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): T

inject

inject lazily

fun <T : Any> KoinScopeComponent.inject(qualifier: Qualifier? = null, mode: LazyThreadSafetyMode = LazyThreadSafetyMode.SYNCHRONIZED, parameters: ParametersDefinition? = null): Lazy<T>

onDestroy

open fun onDestroy(): Unit

onViewCreated

open fun onViewCreated(view: View, savedInstanceState: Bundle?): Unit

requireScopeActivity

fun <T : ScopeActivity> requireScopeActivity(): T

Extension Functions

fragmentScope

Provide scope tied to Fragment

fun <T : Fragment> T.fragmentScope(): Scope

getScopeId

fun <T : ComponentActivity> T.getScopeId(): String

getScopeName

fun <T : ComponentActivity> T.getScopeName(): TypeQualifier

newScope

Create new scope

fun <T : ComponentActivity> T.newScope(source: Any? = null): Scope