All Downloads are FREE. Search and download functionalities are using the official Maven repository.

composeUiMain.com.huanshankeji.compose.foundation.text.KeyboardActions.composeUi.kt Maven / Gradle / Ivy

Go to download

Common wrappers of components (including layouts) and modifiers for Compose UI (Android, desktop (JVM), iOS, and web (Kotlin/Wasm)) and Compose HTML

The newest version!
package com.huanshankeji.compose.foundation.text

import com.huanshankeji.compose.foundation.text.input.ImeAction
import com.huanshankeji.compose.foundation.text.input.toPlatformValue
import androidx.compose.foundation.text.KeyboardActionScope as PlatformKeyboardActionScope
import androidx.compose.foundation.text.KeyboardActions as PlatformKeyboardActions

fun KeyboardActions.toPlatformValue(): PlatformKeyboardActions =
    onAny?.let {
        PlatformKeyboardActions {
            toCommonValue().it()
        }
    } ?: PlatformKeyboardActions()

fun PlatformKeyboardActionScope.toCommonValue(): KeyboardActionScope =
    object : KeyboardActionScope {
        override fun defaultKeyboardAction(imeAction: ImeAction) =
            [email protected](imeAction.toPlatformValue())
    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy