android-beans / rocks.frieler.android.beans.scopes.activity

Package rocks.frieler.android.beans.scopes.activity

Types

ActivityAware

interface ActivityAware

Interface for activity-scoped beans that need to be aware of the Activity they're scoped to.

ActivityScopedFactoryBean

class ActivityScopedFactoryBean<T : Any> : GenericScopedFactoryBean<T>

ScopedFactoryBean for beans of the ActivityScopedFactoryBeanHandler.ACTIVITY_SCOPE-scope.

ActivityScopedFactoryBeanHandler

class ActivityScopedFactoryBeanHandler : ScopedFactoryBeanHandler

ScopedFactoryBeanHandler for the ACTIVITY_SCOPE-scope.

ForegroundActivityHolder

class ForegroundActivityHolder : ActivityLifecycleCallbacks

Implementation of the android.app.Application.ActivityLifecycleCallbacks that holds the Activity which is currently in the foreground (if any).

Functions

activityScopedBean

fun <T : Any> DeclarativeBeanConfiguration.activityScopedBean(name: String? = null, definition: BeansProvider.() -> T): Unit

Adds a BeanDefinition for an ActivityScopedFactoryBean that produces a bean with the given definition, optionally with the specified name.