File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
app/src/main/java/to/bitkit/ui/shared/util Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11package to.bitkit.ui.shared.util
22
3+ import androidx.compose.animation.core.animateFloatAsState
34import androidx.compose.foundation.background
45import androidx.compose.foundation.clickable
56import androidx.compose.foundation.interaction.MutableInteractionSource
@@ -24,9 +25,10 @@ fun Modifier.clickableAlpha(
2425): Modifier = composed {
2526 val interactionSource = remember { MutableInteractionSource () }
2627 val isPressed by interactionSource.collectIsPressedAsState()
28+ val alpha by animateFloatAsState(targetValue = if (isPressed) 0.7f else 1f )
2729
2830 this
29- .graphicsLayer { this .alpha = if (isPressed) 0.7f else 1f }
31+ .graphicsLayer { this .alpha = alpha }
3032 .clickable(
3133 enabled = onClick != null ,
3234 onClick = { onClick?.invoke() },
@@ -35,7 +37,6 @@ fun Modifier.clickableAlpha(
3537 )
3638}
3739
38-
3940fun Modifier.gradientBackground (): Modifier {
4041 return this .background(
4142 brush = Brush .verticalGradient(
You can’t perform that action at this time.
0 commit comments