Package-level declarations

Functions

Link copied to clipboard

Lazily creates or retrieves an AndroidScopes.ActivityRetainedScope tied to this ComponentActivity. This scope survives activity recreation due to configuration changes (e.g., screen rotation). It is managed by a hidden SavedHandleViewModel and is closed only when the activity is finished for good.

@JvmName(name = "inlineActivityRetainedScope")
inline fun <T : Activity> ComponentActivity.activityRetainedScope(noinline pathBuilder: ActivityRetainedScopePathBuilder.() -> Path = { find of Root }): Lazy<AndroidScopes.ActivityRetainedScope>

A type-safe overload of activityRetainedScope for inline usage.

Link copied to clipboard

Lazily creates or retrieves an AndroidScopes.ActivityScope tied to this ComponentActivity. The scope is automatically created and attached to the activity's lifecycle. It will be closed when the activity is destroyed.

@JvmName(name = "inlineActivityScope")
inline fun <T : Activity> ComponentActivity.activityScope(noinline pathBuilder: ActivityScopePathBuilder.() -> Path = { find of Root }): Lazy<AndroidScopes.ActivityScope>

A type-safe overload of activityScope for inline usage.

Link copied to clipboard
inline fun <VM : ViewModel> ComponentActivity.autoViewModels(noinline extrasProducer: () -> CreationExtras? = null): Lazy<VM>
inline fun <VM : ViewModel> ComponentActivity.autoViewModels(scope: Lazy<AndroidScopes.ViewModelScope>, noinline extrasProducer: () -> CreationExtras? = null): Lazy<VM>
Link copied to clipboard

Retrieves the root scope from the Application context. The Application class must implement the RootComponent interface.

Link copied to clipboard
inline fun <T> ComponentActivity.inject(qualifier: Qualifier = TypeQualifier(T::class), mode: LazyThreadSafetyMode = LazyThreadSafetyMode.SYNCHRONIZED): Lazy<T>

A helper function to lazily inject a dependency from the root scope.

Link copied to clipboard

Lazily creates or retrieves a AndroidScopes.ViewModelScope for a specific ViewModel type T. This scope is tied to the lifecycle of the ViewModel, surviving configuration changes. The scope is automatically closed when the ViewModel is cleared.