Josh Eldridge
03/19/2024, 2:47 AMHorizontalPager
? I've been trying to figure out how to deal with height changes between items as it doesn't seem to consistently adjust the height of the current screen. Take this calendar view for example. Using layout inspector I can see there are 2 items pre-loaded on the sides and october is taking the smaller size and properly wrapping it's height. But sometimes like the second image, it takes the height of the largest side-loaded element.Josh Eldridge
03/19/2024, 2:49 AMcurioustechizen
03/19/2024, 3:52 AMJosh Eldridge
03/19/2024, 3:55 AMHorizontalPager(
state = pagerState,
verticalAlignment = <http://Alignment.Top|Alignment.Top>,
key = { index -> monthState.getKeyForPage(index) },
modifier = Modifier.animateContentSize().wrapContentHeight().onSizeChanged { Timber.d(it.toString()) }
)
{ page ->
MonthContent(
showAdjacentMonths = showAdjacentMonths,
selectedDate = selectedDate,
dateSelected = monthPagerDateSelected,
dateSubtexts = dateSubtexts,
currentMonth = monthState.getMonthForPage(page),
today = today,
daysOfWeek = daysOfWeek,
modifier = Modifier
)
}
Josh Eldridge
03/19/2024, 4:49 AMStylianos Gakis
03/19/2024, 5:10 AMJosh Eldridge
03/19/2024, 2:41 PMStylianos Gakis
03/19/2024, 2:51 PMJosh Eldridge
03/19/2024, 2:52 PManimateContentSize
feels smooth enough when it does work