DeviceConfigurationOverride
-
Cmn
fun interface DeviceConfigurationOverride
The specification for an override applied to some piece of content.
When wrapping content in Override, some particular override will be locally applied to the wrapped in order to test that content in isolation, without needing to configure the entire device.
Summary
Nested types |
|---|
Public functions |
||
|---|---|---|
Unit |
@ComposableA wrapper around |
Cmn
|
Extension functions |
||
|---|---|---|
infix DeviceConfigurationOverride |
Combines this override with the |
Cmn
|
Public functions
Override
@Composable
fun Override(contentUnderTest: @Composable () -> Unit): Unit
A wrapper around contentUnderTest that applies some override.
Implementations should call contentUnderTest exactly once.
Extension functions
then
infix fun DeviceConfigurationOverride.then(other: DeviceConfigurationOverride): DeviceConfigurationOverride
Combines this override with the other override into a single override, by applying this override as the outer override first, then the other override as an inner override, and then the content.
import androidx.compose.material.Text import androidx.compose.ui.test.DeviceConfigurationOverride import androidx.compose.ui.test.FontScale import androidx.compose.ui.test.FontWeightAdjustment import androidx.compose.ui.test.then DeviceConfigurationOverride( DeviceConfigurationOverride.FontScale(1.5f) then DeviceConfigurationOverride.FontWeightAdjustment(200) ) { Text(text = "text with increased scale and weight") }
| Parameters | |
|---|---|
other: DeviceConfigurationOverride |
the |
| Returns | |
|---|---|
DeviceConfigurationOverride |
a new |