commonMain.com.kizitonwose.calendar.compose.weekcalendar.WeekCalendarLayoutInfo.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compose-multiplatform Show documentation
Show all versions of compose-multiplatform Show documentation
A highly customizable calendar library for Compose Multiplatform, backed by LazyRow/LazyColumn.
package com.kizitonwose.calendar.compose.weekcalendar
import androidx.compose.foundation.lazy.LazyListItemInfo
import androidx.compose.foundation.lazy.LazyListLayoutInfo
import com.kizitonwose.calendar.core.Week
/**
* Contains useful information about the currently displayed layout state of the calendar.
* For example you can get the list of currently displayed months.
*
* Use [WeekCalendarState.layoutInfo] to retrieve this.
*
* @see LazyListLayoutInfo
*/
public class WeekCalendarLayoutInfo(
info: LazyListLayoutInfo,
private val getIndexData: (Int) -> Week,
) : LazyListLayoutInfo by info {
/**
* The list of [WeekCalendarItemInfo] representing all the currently visible weeks.
*/
public val visibleWeeksInfo: List
get() = visibleItemsInfo.map { info ->
WeekCalendarItemInfo(info, getIndexData(info.index))
}
}
/**
* Contains useful information about an individual week on the calendar.
*
* @param week The week in the list.
* @see WeekCalendarLayoutInfo
* @see LazyListItemInfo
*/
public class WeekCalendarItemInfo(info: LazyListItemInfo, public val week: Week) :
LazyListItemInfo by info
© 2015 - 2024 Weber Informatics LLC | Privacy Policy