Skip to content

Commit

Permalink
Fix using deprecated Pager composable
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsinghmutualmobile committed Oct 25, 2023
1 parent d7122f6 commit c55f922
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ private val sensorStateList: List<SensorStateListener>
@Composable
fun SensorsListScreen() {
var isTopBarTitleCollapsed by remember { mutableStateOf(false) }
val pagerState = rememberPagerState()
val coroutineScope = rememberCoroutineScope()
val sensorStates by rememberUpdatedState(sensorStateList)
val pagerState = rememberPagerState { sensorStates.size }

// Trigger TopBar animation once
LaunchedEffect(Unit) {
Expand Down Expand Up @@ -243,7 +243,6 @@ fun SensorsListScreen() {
}
) {
HorizontalPager(
pageCount = sensorStates.size,
state = pagerState,
contentPadding = PaddingValues(32.dp),
beyondBoundsPageCount = 1,
Expand Down

0 comments on commit c55f922

Please sign in to comment.