Pass locked rowHeightPx through CalendarPager to CalendarMonthPage
Add rowHeightPx parameter to CalendarPager and pass it through to CalendarMonthPage. Remove onRowHeightMeasured callback which is no longer needed since CalendarMonthPage now receives row height externally. Update CalendarMonthView to pass rowHeightPx to CalendarPager. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
7e2bb048f6
commit
266c3eede1
@ -169,6 +169,7 @@ fun CalendarMonthView(
|
||||
currentMonth = month
|
||||
},
|
||||
collapseProgress = viewModel.collapseProgress,
|
||||
rowHeightPx = rowHeightPx,
|
||||
onWeeksChanged = { weeks ->
|
||||
currentWeeksCount = weeks
|
||||
if (p < 0.01f) expandedWeeksCount = weeks
|
||||
|
||||
@ -27,6 +27,7 @@ private const val START_PAGE = Int.MAX_VALUE / 2
|
||||
* @param onDateClick 日期点击回调
|
||||
* @param onMonthChanged 月份切换回调,滑动到新月份时触发
|
||||
* @param collapseProgress 折叠进度,0f=展开,1f=折叠
|
||||
* @param rowHeightPx 从外层传入的锁定行高(像素),折叠过程中不变
|
||||
* @param modifier 外部布局修饰符
|
||||
*/
|
||||
@Composable
|
||||
@ -36,8 +37,8 @@ fun CalendarPager(
|
||||
onDateClick: (LocalDate) -> Unit,
|
||||
onMonthChanged: (year: Int, month: Int) -> Unit,
|
||||
collapseProgress: Float,
|
||||
rowHeightPx: Int,
|
||||
onWeeksChanged: ((Int) -> Unit)? = null,
|
||||
onRowHeightMeasured: ((Int) -> Unit)? = null,
|
||||
pagerState: PagerState,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
@ -79,7 +80,7 @@ fun CalendarPager(
|
||||
}
|
||||
},
|
||||
collapseProgress = collapseProgress,
|
||||
onRowHeightMeasured = if (page == pagerState.currentPage) onRowHeightMeasured else null
|
||||
rowHeightPx = rowHeightPx
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user