I'm using the pageSize attribute with a fixed width of 282.dp but when scrolling after the last item the scroll takes while after returning to the normal position and if another vertical scroll happens it will stuck as stretched out (due to scrolling effect)
my pager composable
@Composable
fun DealsPager(
deals: List<Deal>,
rentalDuration: String,
onClickDeal: (deal) -> Unit
) {
val pagerState = rememberPagerState()
HorizontalPager(
pageCount = deals.size,
state = pagerState,
pageSize = PageSize.Fixed(282.dp), // here is the problem cause
pageSpacing = 16.dp,
contentPadding = PaddingValues(horizontal = 16.dp)
) {
DealItem(
deal = deals[it],
duration = rentalDuration,
testTag = "deal list item $it",
onClick = onClickDeal
)
}
}
if I try to remove the pageSize is works fine and I need a way that it works normally with fixed size for item so more than one item shown per page