周视图翻页改为 cross-fade 动画,消除切换空白间隙
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
741e3de7ff
commit
917ba2125f
@ -71,7 +71,12 @@ fun WeekPager(
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
) { page ->
|
) { page ->
|
||||||
val pageOffset = abs(pagerState.currentPageOffsetFraction)
|
val pageOffset = abs(pagerState.currentPageOffsetFraction)
|
||||||
val alpha = 1f - pageOffset.coerceIn(0f, 0.3f) / 0.3f
|
val isCurrentPage = page == pagerState.currentPage
|
||||||
|
val alpha = if (isCurrentPage) {
|
||||||
|
1f - pageOffset
|
||||||
|
} else {
|
||||||
|
pageOffset
|
||||||
|
}
|
||||||
val weekMonday = pageToWeekMonday(page, initialWeekMonday)
|
val weekMonday = pageToWeekMonday(page, initialWeekMonday)
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user