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

activityScoped

@JvmStatic fun <T : Any> activityScoped(type: Class<T>, producer: () -> T): BeanDefinition<ActivityScopedFactoryBean<*>>

Provides a BeanDefinition for a ActivityScopedFactoryBean that produces a bean of the given type using the given producer without dependencies.

Parameters

type - the type of bean produced

producer - the producer to create new beans

Parameters

Return
a BeanDefinition for a ActivityScopedFactoryBean

@JvmStatic fun <T : Any> activityScoped(type: Class<T>, producer: BeansProvider.() -> T): BeanDefinition<ActivityScopedFactoryBean<*>>

Provides a BeanDefinition for an ActivityScopedFactoryBean that produces a bean of the given type using the given producer with dependencies.

Parameters

type - the type of bean produced

producer - the producer to create new beans

Parameters

Return
a BeanDefinition for an ActivityScopedFactoryBean