Android 12 Developer Preview is here! Try it out, and give us your feedback!

ViewRootForTest

interface ViewRootForTest : RootForTest
androidx.compose.ui.platform.ViewRootForTest

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

Summary

Public methods
abstract Unit

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

Inherited functions
Properties
abstract Boolean

Whether the Owner has pending layout work.

abstract Boolean

Returns true when the associated LifecycleOwner is in the resumed state

abstract View

The view backing this Owner.

Companion properties
(ViewRootForTest) -> Unit

Called after an View implementing ViewRootForTest is created.

Inherited properties

Public methods

invalidateDescendants

abstract fun invalidateDescendants(): Unit

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

Properties

hasPendingMeasureOrLayout

abstract val hasPendingMeasureOrLayout: Boolean

Whether the Owner has pending layout work.

isLifecycleInResumedState

abstract val isLifecycleInResumedState: Boolean

Returns true when the associated LifecycleOwner is in the resumed state

view

abstract val view: View

The view backing this Owner.

Companion properties

onViewCreatedCallback

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.