commonMain.com.kizitonwose.calendar.compose.CalendarLayoutInfo.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
import androidx.compose.foundation.lazy.LazyListItemInfo
import androidx.compose.foundation.lazy.LazyListLayoutInfo
import com.kizitonwose.calendar.core.CalendarMonth
/**
* Contains useful information about the currently displayed layout state of the calendar.
* For example you can get the list of currently displayed months.
*
* Use [CalendarState.layoutInfo] to retrieve this.
* @see LazyListLayoutInfo
*/
public class CalendarLayoutInfo(info: LazyListLayoutInfo, private val month: (Int) -> CalendarMonth) :
LazyListLayoutInfo by info {
/**
* The list of [CalendarItemInfo] representing all the currently visible months.
*/
public val visibleMonthsInfo: List
get() = visibleItemsInfo.map {
CalendarItemInfo(it, month(it.index))
}
}
/**
* Contains useful information about an individual [CalendarMonth] on the calendar.
*
* @param month The month in the list.
*
* @see CalendarLayoutInfo
* @see LazyListItemInfo
*/
public class CalendarItemInfo(info: LazyListItemInfo, public val month: CalendarMonth) : LazyListItemInfo by info
© 2015 - 2024 Weber Informatics LLC | Privacy Policy