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

ViewRootForTest.Companion

public static class ViewRootForTest.Companion


Summary

Public methods

static final Function1<@NonNull ViewRootForTestUnit>

Called after an View implementing ViewRootForTest is created.

static final void
setOnViewCreatedCallback(
    @VisibleForTesting Function1<@NonNull ViewRootForTestUnit> onViewCreatedCallback
)

Called after an View implementing ViewRootForTest is created.

Public methods

getOnViewCreatedCallback

public static final Function1<@NonNull ViewRootForTestUnitgetOnViewCreatedCallback()

Called after an View implementing ViewRootForTest is created. Used by AndroidComposeTestRule to keep track of all attached ComposeViews. Not to be set or used by any other component.

setOnViewCreatedCallback

public static final void setOnViewCreatedCallback(
    @VisibleForTesting Function1<@NonNull ViewRootForTestUnit> onViewCreatedCallback
)

Called after an View implementing ViewRootForTest is created. Used by AndroidComposeTestRule to keep track of all attached ComposeViews. Not to be set or used by any other component.