Keyboard

Function

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

A DeviceConfigurationOverride that overrides the current keyboard type.

Parameters

keyboardTypethe keyboard type to render content under test in. This should be one of the Configuration.KEYBOARD_* types.
isHiddenif true, render the content under test with a hidden keyboard.
isHardKeyboardHiddenif true, render the content under test with a hidden hard keyboard.

Returns

a DeviceConfigurationOverride that specifies the keyboard status for the content under test.

Code Examples

DeviceConfigurationOverrideKeyboard

@Composable
fun DeviceConfigurationOverrideKeyboard() {
    DeviceConfigurationOverride(
        DeviceConfigurationOverride.Keyboard(Configuration.KEYBOARD_QWERTY)
    ) {
        LocalConfiguration.current.keyboard // will be Configuration.KEYBOARD_QWERTY
    }
}