# DeviceConfigurationOverride.Companion

Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.kt+class:androidx.compose.ui.test.DeviceConfigurationOverride.Companion) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0) Common/AllAndroid/JVM
- Cmn

  ```
  object DeviceConfigurationOverride.Companion
  ```

*** ** * ** ***

## Summary

| ### Extension functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).DarkMode(kotlin.Boolean)(isDarkMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the dark mode or light mode theme for the contained content. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).FontScale(kotlin.Float)(fontScale: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the font scale for the contained content. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 31) https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).FontWeightAdjustment(kotlin.Int)( fontWeightAdjustment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the font weight adjustment for the contained content. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).ForcedSize(androidx.compose.ui.unit.DpSize)(size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize)` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the available size for the contained content. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).Keyboard(kotlin.Int,kotlin.Boolean,kotlin.Boolean)( keyboardType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, isHardKeyboardHidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, isHidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current keyboard type. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).LayoutDirection(androidx.compose.ui.unit.LayoutDirection)( layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection )` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the layout direction for the contained content. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).Locales(androidx.compose.ui.text.intl.LocaleList)(locales: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the locales for the contained content. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).Navigation(kotlin.Int,kotlin.Boolean)( navigationType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, isHidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current navigation type and whether it is hidden. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 23) https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).RoundScreen(kotlin.Boolean)( isScreenRound: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides whether the screen is round for the contained content. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).Touchscreen(kotlin.Boolean)( isTouchScreen: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current touchscreen type. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).UiMode(kotlin.Int)(uiModeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current ui mode type. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).WindowInsets(androidx.core.view.WindowInsetsCompat)( windowInsets: https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat )` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the window insets for the contained content. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride.Companion#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).WindowSize(androidx.compose.ui.unit.DpSize)(size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize)` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the window size for the contained content. | Cmn android |

## Extension functions

### DeviceConfigurationOverride.Companion.DarkMode

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:DarkMode)

```
fun DeviceConfigurationOverride.Companion.DarkMode(isDarkMode: Boolean): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the dark mode or light mode theme for the contained content. Inside the content under test, `isSystemInDarkTheme()` will return `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).DarkMode(kotlin.Boolean)`.

```kotlin
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.ui.test.DarkMode
import androidx.compose.ui.test.DeviceConfigurationOverride

DeviceConfigurationOverride(DeviceConfigurationOverride.DarkMode(true)) {
    isSystemInDarkTheme() // will be true
}
```

| Parameters |
|---|---|
| `isDarkMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | if `true`, render content under test in dark mode. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the dark mode for the content under test. |

### DeviceConfigurationOverride.Companion.FontScale

Cmn android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.+function:FontScale)

```
fun DeviceConfigurationOverride.Companion.FontScale(fontScale: Float): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the font scale for the contained content.

```kotlin
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.FontScale

DeviceConfigurationOverride(DeviceConfigurationOverride.FontScale(1.5f)) {
    MyScreen() // will be rendered with a larger than default font scale
}
```

| Parameters |
|---|---|
| `fontScale: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the font scale to use for the content under test. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the font scale for the content under test. |

### DeviceConfigurationOverride.Companion.FontWeightAdjustment

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:FontWeightAdjustment)

```
@RequiresApi(value = 31)
fun DeviceConfigurationOverride.Companion.FontWeightAdjustment(
    fontWeightAdjustment: Int
): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the font weight adjustment for the contained content.

```kotlin
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.FontWeightAdjustment

DeviceConfigurationOverride(DeviceConfigurationOverride.FontWeightAdjustment(200)) {
    MyComponent() // will be rendered with adjusted font weight
}
```

| Parameters |
|---|---|
| `fontWeightAdjustment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the font weight adjustment to use to render the content under test. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the font weight adjustment for the content under test. |

### DeviceConfigurationOverride.Companion.ForcedSize

Cmn android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.+function:ForcedSize)

```
fun DeviceConfigurationOverride.Companion.ForcedSize(size: DpSize): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the available size for the contained content.

This is only suitable for tests, since this will override `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalDensity()` to ensure that the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).ForcedSize(androidx.compose.ui.unit.DpSize)` is met (as opposed to `Modifier.requiredSize` which will result in clipping).

```kotlin
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.ForcedSize
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp

DeviceConfigurationOverride(DeviceConfigurationOverride.ForcedSize(DpSize(1280.dp, 800.dp))) {
    MyScreen() // will be rendered in the space for 1280dp by 800dp without clipping
}
```

| Parameters |
|---|---|
| `size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` to force the contained content to render in, changing density if necessary |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that forces the content size. |

### DeviceConfigurationOverride.Companion.Keyboard

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:Keyboard)

```
fun DeviceConfigurationOverride.Companion.Keyboard(
    keyboardType: Int,
    isHardKeyboardHidden: Boolean = false,
    isHidden: Boolean = false
): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current keyboard type.

```kotlin
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.Keyboard

DeviceConfigurationOverride(
    DeviceConfigurationOverride.Keyboard(Configuration.KEYBOARD_QWERTY)
) {
    LocalConfiguration.current.keyboard // will be Configuration.KEYBOARD_QWERTY
}
```

| Parameters |
|---|---|
| `keyboardType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the keyboard type to render content under test in. This should be one of the `Configuration.KEYBOARD_*` types. Value is one of the following: - `1` - `2` - `3` <br /> |
| `isHardKeyboardHidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if `true`, render the content under test with a hidden hard keyboard. |
| `isHidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if `true`, render the content under test with a hidden keyboard. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the keyboard status for the content under test. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/Configuration.html#keyboard` |   |
| `https://developer.android.com/reference/android/content/res/Configuration.html#keyboardHidden` |   |
| `https://developer.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden` |   |

### DeviceConfigurationOverride.Companion.LayoutDirection

Cmn android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.+function:LayoutDirection)

```
fun DeviceConfigurationOverride.Companion.LayoutDirection(
    layoutDirection: LayoutDirection
): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the layout direction for the contained content.

```kotlin
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.LayoutDirection
import androidx.compose.ui.unit.LayoutDirection

DeviceConfigurationOverride(DeviceConfigurationOverride.LayoutDirection(LayoutDirection.Rtl)) {
    MyComponent() // will be rendered with a right-to-left layout direction
}
```

| Parameters |
|---|---|
| `layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).LayoutDirection(androidx.compose.ui.unit.LayoutDirection)` to use for the content under test. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the layout direction for the content under test. |

### DeviceConfigurationOverride.Companion.Locales

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:Locales)

```
fun DeviceConfigurationOverride.Companion.Locales(locales: LocaleList): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the locales for the contained content.

This will change resource resolution for the content under test, and also override the layout direction as specified by the locales.

```kotlin
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.Locales
import androidx.compose.ui.text.intl.LocaleList

DeviceConfigurationOverride(DeviceConfigurationOverride.Locales(LocaleList("es-ES"))) {
    MyScreen() // will be rendered with overridden locale
}
```

| Parameters |
|---|---|
| `locales: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` to use for the content under test. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the locales for the content under test. |

### DeviceConfigurationOverride.Companion.Navigation

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:Navigation)

```
fun DeviceConfigurationOverride.Companion.Navigation(
    navigationType: Int,
    isHidden: Boolean = false
): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current navigation type and whether it is hidden.

```kotlin
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.Navigation

DeviceConfigurationOverride(
    DeviceConfigurationOverride.Navigation(
        navigationType = Configuration.NAVIGATION_DPAD,
        isHidden = false,
    )
) {
    LocalConfiguration.current.navigation // will be Configuration.NAVIGATION_DPAD
    LocalConfiguration.current.navigationHidden // will be Configuration.NAVIGATIONHIDDEN_NO
}
```

| Parameters |
|---|---|
| `navigationType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the navigation type to render the content under test in. This should be one of the `Configuration.NAVIGATION_*` values. Value is one of the following: - `1` - `2` - `3` - `4` <br /> |
| `isHidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if `true`, render the content under test with hidden navigation. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the navigation type for the content under test. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/Configuration.html#navigation` |   |
| `https://developer.android.com/reference/android/content/res/Configuration.html#navigationHidden` |   |

### DeviceConfigurationOverride.Companion.RoundScreen

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:RoundScreen)

```
@RequiresApi(value = 23)
fun DeviceConfigurationOverride.Companion.RoundScreen(
    isScreenRound: Boolean
): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides whether the screen is round for the contained content.

```kotlin
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.RoundScreen

DeviceConfigurationOverride(DeviceConfigurationOverride.RoundScreen(true)) {
    LocalConfiguration.current.isScreenRound // will be true
}
```

| Parameters |
|---|---|
| `isScreenRound: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | if `true`, render content under test in a round screen. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies whether the screen is round for the content under test. |

### DeviceConfigurationOverride.Companion.Touchscreen

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:Touchscreen)

```
fun DeviceConfigurationOverride.Companion.Touchscreen(
    isTouchScreen: Boolean
): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current touchscreen type.

```kotlin
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.Touchscreen

DeviceConfigurationOverride(DeviceConfigurationOverride.Touchscreen(false)) {
    LocalConfiguration.current.touchscreen // will be Configuration.TOUCHSCREEN_NOTOUCH
}
```

### DeviceConfigurationOverride.Companion.UiMode

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:UiMode)

```
fun DeviceConfigurationOverride.Companion.UiMode(uiModeType: Int): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the current ui mode type.

```kotlin
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.UiMode

DeviceConfigurationOverride(
    DeviceConfigurationOverride.UiMode(Configuration.UI_MODE_TYPE_CAR)
) {
    // will be Configuration.UI_MODE_TYPE_CAR
    LocalConfiguration.current.uiMode and Configuration.UI_MODE_TYPE_MASK
}
```

| Parameters |
|---|---|
| `uiModeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the uiMode type to render the content under test in. This should be one of the `Configuration.UI_MODE_TYPE_*` values. Value is one of the following: - `1` - `2` - `3` - `4` - `5` - `6` - `7` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the uiMode type for the content under test. |

### DeviceConfigurationOverride.Companion.WindowInsets

android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.android.kt+function:WindowInsets)

```
fun DeviceConfigurationOverride.Companion.WindowInsets(
    windowInsets: WindowInsetsCompat
): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the window insets for the contained content.

```kotlin
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.WindowInsets
import androidx.compose.ui.unit.DpRect
import androidx.compose.ui.unit.IntRect
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.roundToIntRect
import androidx.core.view.WindowInsetsCompat

fun IntRect.toAndroidXInsets() = androidx.core.graphics.Insets.of(left, top, right, bottom)

DeviceConfigurationOverride(
    DeviceConfigurationOverride.WindowInsets(
        WindowInsetsCompat.Builder()
            .setInsets(
                WindowInsetsCompat.Type.captionBar(),
                with(LocalDensity.current) { DpRect(0.dp, 64.dp, 0.dp, 0.dp).toRect() }
                    .roundToIntRect()
                    .toAndroidXInsets(),
            )
            .setInsets(
                WindowInsetsCompat.Type.navigationBars(),
                with(LocalDensity.current) { DpRect(24.dp, 0.dp, 48.dp, 24.dp).toRect() }
                    .roundToIntRect()
                    .toAndroidXInsets(),
            )
            .build()
    )
) {
    Box(
        Modifier.background(Color.Blue)
            // Will apply 64dp padding on the top, 24dp padding on the sides, and 48dp on the
            // bottom
            .safeDrawingPadding()
            .background(Color.Red)
    )
}
```

| Parameters |
|---|---|
| `windowInsets: https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat` | the `https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat` to render the content under test in. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that specifies the window insets for the content under test. |

### DeviceConfigurationOverride.Companion.WindowSize

Cmn android Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/DeviceConfigurationOverride.+function:WindowSize)

```
fun DeviceConfigurationOverride.Companion.WindowSize(size: DpSize): DeviceConfigurationOverride
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that overrides the window size for the contained content.

Like `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).ForcedSize(androidx.compose.ui.unit.DpSize)`, this is only suitable for tests, since this will override `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalDensity()` to ensure that the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).WindowSize(androidx.compose.ui.unit.DpSize)` is met (as opposed to `Modifier.requiredSize` which will result in clipping).

Unlike `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.DeviceConfigurationOverride.Companion).ForcedSize(androidx.compose.ui.unit.DpSize)`, this override will override `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalWindowInfo()` and `LocalConfiguration` on Android to reflect the requested size.

```kotlin
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.WindowSize
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp

DeviceConfigurationOverride(DeviceConfigurationOverride.WindowSize(DpSize(1280.dp, 800.dp))) {
    MyScreen() // will be rendered with an apparent window size of 1280dp by 800dp without
    // clipping
}
```

| Parameters |
|---|---|
| `size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` to force the window size to appear as, changing density if necessary |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` | a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/DeviceConfigurationOverride` that forces the window size. |