From db3e5aeacec2629a270f54fd1d287f49abb612ae Mon Sep 17 00:00:00 2001 From: Kizito Nwose Date: Sun, 19 Jan 2025 13:35:30 +0100 Subject: [PATCH 1/4] Update docs --- docs/Compose.md | 39 ++++++++++++++++++++++++++++++++++++--- docs/View.md | 12 ++++++------ 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/docs/Compose.md b/docs/Compose.md index 34f4fbbd..2e512f72 100644 --- a/docs/Compose.md +++ b/docs/Compose.md @@ -422,20 +422,53 @@ fun Day(day: CalendarDay) { - **isScrollInProgress**: Whether this calendar is currently scrolling by gesture, fling, or programmatically. +**`YearCalendarState` properties for `HorizontalYearCalendar` and `VerticalYearCalendar`:** + +- **firstVisibleYear**: The first year that is visible on the calendar. + +- **lastVisibleYear**: The last year that is visible on the calendar. + +- **layoutInfo**: A subclass of `LazyListLayoutInfo` calculated during the last layout pass. For example, you can use it to calculate what items are currently visible. + +- **isScrollInProgress**: Whether this calendar is currently scrolling by gesture, fling, or programmatically. + + ### State methods -**`CalendarState` methods:** +**`CalendarState`** + +- **scrollToDate(date: LocalDate)**: Instantly scroll to a date on the calendar without an animation. + +- **animateScrollToDate(date: LocalDate)**: Scroll to a date on the calendar with smooth scrolling animation. -- **scrollToMonth(month: YearMonth)**: Instantly scroll to a specific month on the calendar without an animation. +- **scrollToMonth(month: YearMonth)**: Instantly scroll to a month on the calendar without an animation. - **animateScrollToMonth(month: YearMonth)**: Scroll to a month on the calendar with smooth scrolling animation. -**`WeekCalendarState` methods:** +**`WeekCalendarState`** + +- **scrollToDate(date: LocalDate)**: Instantly scroll to a date on the calendar without an animation. + +- **animateScrollToDate(date: LocalDate)**: Scroll to a date on the calendar with smooth scrolling animation. - **scrollToWeek(date: LocalDate)**: Instantly scroll to the week containing the given date on the calendar without an animation. - **animateScrollToWeek(date: LocalDate)**: Scroll to the week containing the given date on the calendar with smooth scrolling animation. +**`YearCalendarState`** + +- **scrollToDate(date: LocalDate)**: Instantly scroll to a date on the calendar without an animation. + +- **animateScrollToDate(date: LocalDate)**: Scroll to a date on the calendar with smooth scrolling animation. + +- **scrollToMonth(month: YearMonth)**: Instantly scroll to a month on the calendar without an animation. + +- **animateScrollToMonth(month: YearMonth)**: Scroll to a month on the calendar with smooth scrolling animation. + +- **scrollToYear(year: Year)**: Instantly scroll to a year on the calendar without an animation. + +- **animateScrollToYear(year: Year)**: Scroll to a year on the calendar with smooth scrolling animation. + There's no need to repeat the documentation here. Please see the relevant class for all properties and methods available with proper documentation. ### Date clicks diff --git a/docs/View.md b/docs/View.md index 1dad7016..fab9a5ec 100644 --- a/docs/View.md +++ b/docs/View.md @@ -411,7 +411,7 @@ calendarView.dayBinder = object : MonthDayBinder { All the respective XML attributes listed above are also available as properties of the CalendarView and WeekCalendarView classes so they can be set via code. So in addition to those, we have: -**`CalendarView` properties:** +**`CalendarView`** - **monthScrollListener**: Called when the calendar scrolls to a new month. Mostly beneficial if `scrollPaged` is `true`. @@ -423,7 +423,7 @@ All the respective XML attributes listed above are also available as properties - **monthMargins**: The margins, in pixels to be applied on each month view. This can be used to add a space between two months. -**`WeekCalendarView` properties:** +**`WeekCalendarView`** - **weekScrollListener**: Called when the calendar scrolls to a new week. Mostly beneficial if `scrollPaged` is `true`. @@ -435,7 +435,7 @@ All the respective XML attributes listed above are also available as properties - **weekMargins**: The margins, in pixels to be applied on each week view. This can be used to add a space between two weeks. -**`YearCalendarView` properties:** +**`YearCalendarView`** - **yearScrollListener**: Called when the calendar scrolls to a new year. Mostly beneficial if `scrollPaged` is `true`. @@ -457,7 +457,7 @@ All the respective XML attributes listed above are also available as properties ### Methods -**`CalendarView` methods:** +**`CalendarView`** - **scrollToDate(date: LocalDate)**: Scroll to a specific date on the calendar. Use `smoothScrollToDate()` to get a smooth scrolling animation. @@ -475,7 +475,7 @@ All the respective XML attributes listed above are also available as properties - **updateMonthData()**: Update the calendar's start month or end month or the first day of week after the initial setup. The currently visible month is preserved. The calendar can handle really large date ranges so you may want to setup the calendar with a large date range instead of updating the range frequently. -**`WeekCalendarView` methods:** +**`WeekCalendarView`** - **scrollToDate(date: LocalDate)**: Scroll to a specific date on the calendar. Use `smoothScrollToDate()` to get a smooth scrolling animation. @@ -493,7 +493,7 @@ All the respective XML attributes listed above are also available as properties - **updateWeekData()**: Update the calendar's start date or end date or the first day of week after the initial setup. The currently visible week is preserved. The calendar can handle really large date ranges so you may want to setup the calendar with a large date range instead of updating the range frequently. -**`YearCalendarView` methods:** +**`YearCalendarView`** - **scrollToDate(date: LocalDate)**: Scroll to a specific date on the calendar. Use `smoothScrollToDate()` to get a smooth scrolling animation. From 71c4426e9c1a1fd44b5e8e5ae1b34d889861c6f7 Mon Sep 17 00:00:00 2001 From: Kizito Nwose Date: Sun, 19 Jan 2025 13:37:29 +0100 Subject: [PATCH 2/4] Prepare version 2.6.2 --- .../src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt b/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt index eff577f7..d59e5a2f 100644 --- a/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt +++ b/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt @@ -11,8 +11,8 @@ object Config { } object Version { - val android = "2.6.2-SNAPSHOT" - val multiplatfrom = "2.6.2-SNAPSHOT" + val android = "2.6.2" + val multiplatfrom = "2.6.2" fun String.isNoPublish() = this == VERSION_NO_PUBLISH } From 93ebdb8213eaa2482341acede99233492efc73c1 Mon Sep 17 00:00:00 2001 From: Kizito Nwose Date: Sun, 19 Jan 2025 13:38:57 +0100 Subject: [PATCH 3/4] Prepare next development version --- .../src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt b/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt index d59e5a2f..f87ab9e2 100644 --- a/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt +++ b/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt @@ -11,8 +11,8 @@ object Config { } object Version { - val android = "2.6.2" - val multiplatfrom = "2.6.2" + val android = "2.6.3-SNAPSHOT" + val multiplatfrom = "2.6.3-SNAPSHOT" fun String.isNoPublish() = this == VERSION_NO_PUBLISH } From 12c8b524edf6ac9a85bf6b33f97c505577adb31f Mon Sep 17 00:00:00 2001 From: Kizito Nwose Date: Sun, 19 Jan 2025 13:43:55 +0100 Subject: [PATCH 4/4] Update docs --- docs/Compose.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/Compose.md b/docs/Compose.md index 2e512f72..1f270efe 100644 --- a/docs/Compose.md +++ b/docs/Compose.md @@ -432,7 +432,6 @@ fun Day(day: CalendarDay) { - **isScrollInProgress**: Whether this calendar is currently scrolling by gesture, fling, or programmatically. - ### State methods **`CalendarState`**