{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool

public static class ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool implements ViewCompositionStrategy


The composition will be disposed automatically when the view is detached from a window, unless it is part of a pooling container, such as RecyclerView.

When not within a pooling container, this behaves exactly the same as DisposeOnDetachedFromWindow.

Summary

Public fields

static @NonNull ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool

Public methods

@NonNull Function0<Unit>

Install this strategy for view and return a function that will uninstall it later.

Public fields

INSTANCE

public static @NonNull ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool INSTANCE

Public methods

installFor

public @NonNull Function0<UnitinstallFor(@NonNull AbstractComposeView view)

Install this strategy for view and return a function that will uninstall it later. This function should not be called directly; it is called by AbstractComposeView.setViewCompositionStrategy after uninstalling the previous strategy.