Skip to content

Commit

Permalink
fix start date delay bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
commandiron committed Oct 31, 2022
1 parent e44cbf9 commit 6b273a2
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import dev.chrisbanes.snapper.*
@Composable
fun WheelPicker(
modifier: Modifier = Modifier,
lazyListState: LazyListState = rememberLazyListState(),
size: DpSize = DpSize(128.dp, 128.dp),
startIndex: Int = 0,
lazyListState: LazyListState = rememberLazyListState(
initialFirstVisibleItemIndex = startIndex
),
count: Int,
selectorEnabled: Boolean = false,
selectorShape: Shape = RoundedCornerShape(0.dp),
Expand All @@ -48,11 +50,6 @@ fun WheelPicker(
}
}
}
LaunchedEffect(key1 = startIndex){
lazyListState.scrollToItem(startIndex)
snappedIndex.value = startIndex
onScrollFinished(if(snappedIndex.value < count) snappedIndex.value else count - 1)
}
Box(
modifier = modifier,
contentAlignment = Alignment.Center
Expand Down

0 comments on commit 6b273a2

Please sign in to comment.