Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.github.composefluent.component

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import kotlinx.datetime.LocalTime

@Composable
actual fun TimePicker(
value: LocalTime?,
onValueChange: (LocalTime?) -> Unit,
modifier: Modifier,
is12hour: Boolean,
disabled: Boolean
) {
TimePickerImpl(
value = value,
onValueChange = onValueChange,
modifier = modifier,
is12hour = is12hour,
disabled = disabled,
userScrollEnabled = true
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.layout
Expand Down Expand Up @@ -67,13 +68,14 @@ internal fun FontIcon(
modifier: Modifier = Modifier,
iconSize: TextUnit = FontIconSize.Standard.value.sp,
fallback: (@Composable () -> Unit)? = null,
tint: Color = LocalContentColor.current.copy(LocalContentAlpha.current)
) {
if (LocalFontIconFontFamily.current != null || fallback == null) {
Text(
text = glyph.toString(),
fontFamily = LocalFontIconFontFamily.current,
fontSize = iconSize,
color = LocalContentColor.current.copy(LocalContentAlpha.current),
color = tint,
modifier = Modifier.then(modifier)
.height(with(LocalDensity.current) { iconSize.toDp() }),
onTextLayout = {
Expand All @@ -91,7 +93,8 @@ internal fun FontIcon(
contentDescription: String?,
modifier: Modifier = Modifier,
iconSize: FontIconSize = FontIconSize.Standard,
fallbackSize: FontIconSize = iconSize
fallbackSize: FontIconSize = iconSize,
tint: Color = LocalContentColor.current.copy(LocalContentAlpha.current)
) {
FontIcon(
glyph = glyph,
Expand All @@ -104,6 +107,7 @@ internal fun FontIcon(
Icon(
imageVector = vector(),
contentDescription = contentDescription,
tint = tint,
modifier = modifier
.layout { measurable, constraints ->
val size = fallbackSize.value.dp.roundToPx()
Expand All @@ -120,7 +124,8 @@ internal fun FontIcon(
}
)
}
}
},
tint = tint
)
}

Expand Down Expand Up @@ -196,15 +201,17 @@ fun FontIcon(
contentDescription: String?,
modifier: Modifier = Modifier,
size: FontIconSize = FontIconSize.Standard,
fallbackSize: FontIconSize = FontIconSize(size.value + 2f)
fallbackSize: FontIconSize = FontIconSize(size.value + 2f),
tint: Color = LocalContentColor.current.copy(LocalContentAlpha.current)
) {
FontIcon(
glyph = type.glyph,
vector = type.vector,
contentDescription = contentDescription,
iconSize = size,
fallbackSize = fallbackSize,
modifier = modifier
modifier = modifier,
tint = tint
)
}

Expand Down
Loading