mediaQuery
@ExperimentalMediaQueryApi
inline fun <T> CompositionLocalAccessorScope.mediaQuery(query: UiMediaScope.() -> T): T
Evaluates a query against the current UiMediaScope from a CompositionLocalAccessorScope.
If called within a snapshot-aware context, the specific property reads within the query will be tracked, and the scope will be invalidated when any of those properties change.
Parameters
| query | A lambda expression with UiMediaScope as its receiver, representing the condition to evaluate. |
Returns
| The immediate result of the query. |
mediaQuery
@ExperimentalMediaQueryApi
inline fun <T> CompositionLocalConsumerModifierNode.mediaQuery(query: UiMediaScope.() -> T): T
Evaluates a query against the current UiMediaScope from a Modifier.Node.
This function is designed to be used within a Modifier.Node that implements CompositionLocalConsumerModifierNode.
If called within a snapshot-aware context like LayoutModifierNode.measure or DrawModifierNode.draw callbacks, the reads within the query will be tracked, and the scope will be invalidated when the properties change.
Parameters
| query | A lambda expression with UiMediaScope as its receiver, representing the condition to evaluate. |
Returns
| The immediate result of the query. |