Object

ViewCompositionStrategy.DisposeOnDetachedFromWindow

ViewCompositionStrategy that disposes the composition whenever the view becomes detached from a window.

Source set: Android
public object DisposeOnDetachedFromWindow : ViewCompositionStrategy

ViewCompositionStrategy that disposes the composition whenever the view becomes detached from a window. If the user of a Compose UI view never explicitly calls AbstractComposeView.createComposition, this strategy is always safe and will always clean up composition resources with no explicit action required - just use the view like any other View and let garbage collection do the rest. (If AbstractComposeView.createComposition is called while the view is detached from a window, AbstractComposeView.disposeComposition must be called manually if the view is not later attached to a window.)

Functions

installFor

Source set: Android
override fun installFor(view: AbstractComposeView): () -> Unit
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: