RootForTest

Known direct subclasses
SkiaRootForTest

The marker interface to be implemented by the desktop root backing the composition.

ViewRootForTest

The marker interface to be implemented by the View backing the composition.


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

Summary

Public functions

Unit

Force accessibility to be enabled for testing.

Cmn
open Unit

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

Cmn
Boolean

Send this KeyEvent to the focused component in this Owner.

Cmn
Unit

Set the time interval between sending accessibility events in milliseconds.

Cmn

Public properties

Density

Current device density.

Cmn
SemanticsOwner

Semantics owner for this root.

Cmn
TextInputService

This property is deprecated. Use PlatformTextInputModifierNode instead.

Cmn

Public functions

forceAccessibilityForTesting

@ExperimentalComposeUiApi
fun forceAccessibilityForTesting(): Unit

Force accessibility to be enabled for testing.

measureAndLayoutForTest

@ExperimentalComposeUiApi
open fun measureAndLayoutForTest(): Unit

Requests another layout (measure + placement) pass be performed for any nodes that need it. This doesn't force anything to be remeasured that wouldn't be if requestLayout were called. However, unlike requestLayout, it doesn't merely schedule another layout pass to be performed, it actually performs it synchronously.

This method is used in UI tests to perform layout in between frames when pumping frames as fast as possible (i.e. without waiting for the choreographer to schedule them) in order to get to idle, e.g. during a waitForIdle call.

sendKeyEvent

fun sendKeyEvent(keyEvent: KeyEvent): Boolean

Send this KeyEvent to the focused component in this Owner.

Returns
Boolean

true if the event was consumed. False otherwise.

setAccessibilityEventBatchIntervalMillis

@ExperimentalComposeUiApi
fun setAccessibilityEventBatchIntervalMillis(accessibilityInterval: Long): Unit

Set the time interval between sending accessibility events in milliseconds.

This is the delay before dispatching a recurring accessibility event in milliseconds. It delays the loop that sends events to the accessibility and content capture framework in batches. A recurring event will be sent at most once during the accessibilityInterval timeframe. The default time delay is 100 milliseconds.

Public properties

density

val densityDensity

Current device density.

semanticsOwner

val semanticsOwnerSemanticsOwner

Semantics owner for this root. Manages all the semantics nodes.

textInputService

val textInputServiceTextInputService

The service handling text input.