mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-07 19:14:12 +08:00
fix: disable not effect in Slider and TextField
This commit is contained in:
@@ -63,7 +63,9 @@ import com.highcapable.flexiui.LocalColors
|
||||
import com.highcapable.flexiui.LocalShapes
|
||||
import com.highcapable.flexiui.LocalSizes
|
||||
import com.highcapable.flexiui.utils.borderOrNot
|
||||
import com.highcapable.flexiui.utils.status
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@Immutable
|
||||
data class SliderColors(
|
||||
val trackInactiveColor: Color,
|
||||
@@ -165,9 +167,10 @@ fun Slider(
|
||||
)
|
||||
}
|
||||
Box(
|
||||
modifier = modifier.hoverable(interactionSource)
|
||||
modifier = modifier.status(enabled)
|
||||
.hoverable(interactionSource, enabled)
|
||||
.pointerInput(Unit) {
|
||||
detectTapGestures(
|
||||
if (enabled) detectTapGestures(
|
||||
onTap = { offset ->
|
||||
val tapedOffsetX = offset.x - thumbRadius.toPx()
|
||||
offsetX = tapedOffsetX.coerceIn(0f, maxOffset)
|
||||
|
@@ -267,7 +267,7 @@ private fun Modifier.textField(
|
||||
enabled: Boolean,
|
||||
interactionSource: MutableInteractionSource
|
||||
) = status(enabled)
|
||||
.hoverable(interactionSource)
|
||||
.hoverable(interactionSource, enabled)
|
||||
.clip(style.shape)
|
||||
.background(colors.backgroundColor, style.shape)
|
||||
.borderOrNot(border, style.shape)
|
||||
|
Reference in New Issue
Block a user