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

composeUiMain.com.huanshankeji.compose.foundation.text.input.ImeAction.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.input

import androidx.compose.ui.text.input.ImeAction as PlatformImeAction

fun ImeAction.toPlatformValue(): PlatformImeAction =
    when (this) {
        ImeAction.Default -> PlatformImeAction.Default
        ImeAction.None -> PlatformImeAction.None
        ImeAction.Go -> PlatformImeAction.Go
        ImeAction.Search -> PlatformImeAction.Search
        ImeAction.Send -> PlatformImeAction.Search
        ImeAction.Previous -> PlatformImeAction.Previous
        ImeAction.Next -> PlatformImeAction.Next
        ImeAction.Done -> PlatformImeAction.Done

        else -> throw IllegalArgumentException(toString())
    }

fun ImeAction?.toPlatformValue(): PlatformImeAction =
    this?.toPlatformValue() ?: PlatformImeAction.Default




© 2015 - 2025 Weber Informatics LLC | Privacy Policy