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

composeUiMain.com.huanshankeji.compose.foundation.layout.Intrinsic.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.layout

import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Stable
import com.huanshankeji.compose.ui.Modifier
import androidx.compose.foundation.layout.IntrinsicSize as PlatformIntrinsicSize

@Stable
actual fun Modifier.width(intrinsicSize: IntrinsicSize): Modifier =
    platformModify { width(intrinsicSize.toPlatformValue()) }

@Stable
actual fun Modifier.height(intrinsicSize: IntrinsicSize): Modifier =
    platformModify { height(intrinsicSize.toPlatformValue()) }

fun IntrinsicSize.toPlatformValue() =
    when (this) {
        IntrinsicSize.Min -> PlatformIntrinsicSize.Min
        IntrinsicSize.Max -> PlatformIntrinsicSize.Max
    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy