File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
timepicker/src/main/java/com/dongchyeon/timepicker/ui Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import androidx.compose.material3.MaterialTheme
1111import androidx.compose.material3.Text
1212import androidx.compose.runtime.Composable
1313import androidx.compose.runtime.LaunchedEffect
14+ import androidx.compose.runtime.derivedStateOf
1415import androidx.compose.runtime.getValue
1516import androidx.compose.runtime.mutableIntStateOf
1617import androidx.compose.runtime.remember
@@ -116,7 +117,8 @@ internal fun PickerItem(
116117 .pointerInput(Unit ) { detectVerticalDragGestures { change, _ -> change.consume() } }
117118 ) {
118119 items(listScrollCount, key = { index -> index }) { index ->
119- val layoutInfo = listState.layoutInfo
120+ val layoutInfo by remember { derivedStateOf { listState.layoutInfo } }
121+
120122 val viewportCenterOffset = layoutInfo.viewportStartOffset +
121123 (layoutInfo.viewportEndOffset - layoutInfo.viewportStartOffset) / 2
122124
You can’t perform that action at this time.
0 commit comments