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

ViewRootForTest

@VisibleForTesting
public interface ViewRootForTest extends RootForTest


The marker interface to be implemented by the View backing the composition. To be used in tests.

Summary

Nested types

public static class ViewRootForTest.Companion

Public methods

abstract boolean

Whether the Owner has pending layout work.

abstract @NonNull View

The view backing this Owner.

abstract void

Called to invalidate the Android View sub-hierarchy handled by this View.

abstract boolean

Returns true when the associated LifecycleOwner is in the resumed state

Inherited methods

From androidx.compose.ui.node.RootForTest
abstract @NonNull Density

Current device density.

abstract @NonNull SemanticsOwner

Semantics owner for this root.

abstract @NonNull TextInputService

The service handling text input.

default void

Requests another layout (measure + placement) pass be performed for any nodes that need it.

abstract boolean

Send this KeyEvent to the focused component in this Owner.

Public methods

getHasPendingMeasureOrLayout

abstract boolean getHasPendingMeasureOrLayout()

Whether the Owner has pending layout work.

getView

abstract @NonNull View getView()

The view backing this Owner.

invalidateDescendants

abstract void invalidateDescendants()

Called to invalidate the Android View sub-hierarchy handled by this View.

isLifecycleInResumedState

abstract boolean isLifecycleInResumedState()

Returns true when the associated LifecycleOwner is in the resumed state