This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun Modifier.verticalScrollBar( | |
state: ScrollState, | |
color: Color = Color.Gray, | |
ratio: Float = 3f, | |
width: Dp = 8.dp, | |
alwaysOn: Boolean = false | |
): Modifier { | |
val targetAlpha = if (state.isScrollInProgress || alwaysOn) 1f else 0f | |
val duration = if (state.isScrollInProgress) 150 else 500 |