ViewRootForTest


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

Summary

Public companion properties

((ViewRootForTest) -> Unit)?

Called after an View implementing ViewRootForTest is created.

android

Public functions

Unit

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

android

Public properties

Boolean

Whether the Owner has pending layout work.

android
Boolean

Returns true when the associated LifecycleOwner is in the resumed state

android
View

The view backing this Owner.

android

Inherited functions

From androidx.compose.ui.node.RootForTest
Unit

Force accessibility to be enabled for testing.

android
open Unit

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

android
Boolean

Send this KeyEvent to the focused component in this Owner.

android
Unit

Set the time interval between sending accessibility events in milliseconds.

android

Inherited properties

From androidx.compose.ui.node.RootForTest
Density

Current device density.

android
SemanticsOwner

Semantics owner for this root.

android
TextInputService

This property is deprecated. Use PlatformTextInputModifierNode instead.

android

Public companion properties

onViewCreatedCallback

@VisibleForTesting
var onViewCreatedCallback: ((ViewRootForTest) -> Unit)?

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.

Public functions

invalidateDescendants

fun invalidateDescendants(): Unit

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

Public properties

hasPendingMeasureOrLayout

val hasPendingMeasureOrLayoutBoolean

Whether the Owner has pending layout work.

isLifecycleInResumedState

val isLifecycleInResumedStateBoolean

Returns true when the associated LifecycleOwner is in the resumed state

view

val viewView

The view backing this Owner.