class ActivityScopedFactoryBeanHandler : ScopedFactoryBeanHandler
ScopedFactoryBeanHandler for the ACTIVITY_SCOPE-scope.
It provides a bean-instance per android.app.Activity, always scoped to the
foreground-activity. Due to the limitation of the ViewModelProviders
this only works for subtypes of ComponentActivity such as the android.support.v7.app.AppCompatActivity.
The ActivityScopedFactoryBeanHandler supports the ActivityAware-interface.
Author
Christopher Frieler
class ActivityScopedBeanHolder<T : Any> : ViewModel |
ActivityScopedFactoryBeanHandler(foregroundActivityHolder: ForegroundActivityHolder)
ScopedFactoryBeanHandler for the ACTIVITY_SCOPE-scope. |
val isActive: Boolean
Checks whether the scope is active, i.e. if beans of this scope are currently available. |
|
val name: String
Returns the name of the scope. |
fun <T : Any> getBean(name: String, factoryBean: ScopedFactoryBean<T>, dependencies: BeansProvider): T
Returns the bean defined by the given ScopedFactoryBean. |
const val ACTIVITY_SCOPE: String
The name of the Activity-scope. |