The second Android 11 Developer Preview is now available, test it out and share your feedback.

SemanticsPredicate

class SemanticsPredicate
kotlin.Any
   ↳ androidx.ui.test.SemanticsPredicate

Wrapper for semantics predicate that allows to build string explaining to the developer what conditions were being performed.

Summary

Public constructors

<init>(description: String, condition: SemanticsNode.() -> Boolean)

Wrapper for semantics predicate that allows to build string explaining to the developer what conditions were being performed.

Public methods

infix SemanticsPredicate

operator SemanticsPredicate
not()

infix SemanticsPredicate

Companion functions

SemanticsPredicate
expectValue(key: SemanticsPropertyKey<T>, expectedValue: T)

Builds a predicate that tests whether the value of the given key is equal to expectedValue.

SemanticsPredicate

Builds a predicate that tests whether the given key is defined in semantics.

SemanticsPredicate

Builds a predicate that tests whether the given key is NOT defined in semantics.

Properties

SemanticsNode.() -> Boolean

String

Companion properties

SemanticsPredicate

Predicate that matches anything.

Public constructors

<init>

SemanticsPredicate(
    description: String,
    condition: SemanticsNode.() -> Boolean)

Wrapper for semantics predicate that allows to build string explaining to the developer what conditions were being performed.

Public methods

and

infix fun and(other: SemanticsPredicate): SemanticsPredicate

not

operator fun not(): SemanticsPredicate

or

infix fun or(other: SemanticsPredicate): SemanticsPredicate

Properties

condition

val condition: SemanticsNode.() -> Boolean

description

val description: String

Companion functions

expectValue

fun <T> expectValue(
    key: SemanticsPropertyKey<T>,
    expectedValue: T
): SemanticsPredicate

Builds a predicate that tests whether the value of the given key is equal to expectedValue.

keyIsDefined

fun <T> keyIsDefined(key: SemanticsPropertyKey<T>): SemanticsPredicate

Builds a predicate that tests whether the given key is defined in semantics.

keyNotDefined

fun <T> keyNotDefined(key: SemanticsPropertyKey<T>): SemanticsPredicate

Builds a predicate that tests whether the given key is NOT defined in semantics.

Companion properties

any

val any: SemanticsPredicate

Predicate that matches anything.