Skip to content

Commit

Permalink
update to compose 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
epicarchitect committed Oct 1, 2023
1 parent 22d241e commit a6e390e
Show file tree
Hide file tree
Showing 36 changed files with 405 additions and 725 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Compose Multiplatform library for displaying epic calendars.

```Kotlin
kotlin {
android()
androidTarget()
jvm("desktop")
iosX64()
iosArm64()
Expand All @@ -27,10 +27,10 @@ The library is published on MavenCentral.

```Kotlin
dependencies {
commonMainImplementation("io.github.epicarchitect:calendar-compose-basis:1.0.4")
commonMainImplementation("io.github.epicarchitect:calendar-compose-ranges:1.0.4") // includes basis
commonMainImplementation("io.github.epicarchitect:calendar-compose-pager:1.0.4") // includes basis
commonMainImplementation("io.github.epicarchitect:calendar-compose-datepicker:1.0.4") // includes pager + ranges
commonMainImplementation("io.github.epicarchitect:calendar-compose-basis:1.0.5")
commonMainImplementation("io.github.epicarchitect:calendar-compose-ranges:1.0.5") // includes basis
commonMainImplementation("io.github.epicarchitect:calendar-compose-pager:1.0.5") // includes basis
commonMainImplementation("io.github.epicarchitect:calendar-compose-datepicker:1.0.5") // includes pager + ranges
}
```

Expand Down
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/convention/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package convention

object Constants {
const val JVM_TARGET = 11
const val ANDROID_TARGET_SDK = 33
const val ANDROID_TARGET_SDK = 34
const val ANDROID_MIN_SDK = 26
const val EPICARCHITECT_GROUP_NAME = "io.github.epicarchitect"
const val EPIC_CALENDAR_VERSION = "1.0.4"
const val EPIC_CALENDAR_VERSION = "1.0.5"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

kotlin {
android()
androidTarget()
jvm("desktop")
iosX64()
iosArm64()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 12 23:34:14 NOVT 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
780 changes: 264 additions & 516 deletions kotlin-js-store/yarn.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package epicarchitect.calendar.compose.basis.state

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import epicarchitect.calendar.compose.basis.BasisDayOfMonthContent
import epicarchitect.calendar.compose.basis.BasisDayOfWeekContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import epicarchitect.calendar.compose.basis.BasisEpicCalendar
import epicarchitect.calendar.compose.basis.DefaultDayOfMonthContent
import epicarchitect.calendar.compose.basis.DefaultDayOfWeekContent
import epicarchitect.calendar.compose.basis.getByIndex
import epicarchitect.calendar.compose.basis.size
import epicarchitect.calendar.compose.basis.state.rememberBasisEpicCalendarState
import epicarchitect.calendar.compose.pager.config.LocalEpicCalendarPagerConfig
import epicarchitect.calendar.compose.pager.state.EpicCalendarPagerState
Expand Down Expand Up @@ -41,9 +40,6 @@ fun EpicCalendarPager(
HorizontalPager(
modifier = modifier,
state = state.pagerState,
pageCount = remember(state.monthRange) {
state.monthRange.size()
},
verticalAlignment = Alignment.Top
) { page ->
BasisEpicCalendar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package epicarchitect.calendar.compose.pager.state

import epicarchitect.calendar.compose.basis.EpicMonth
import kotlinx.datetime.Month
import kotlinx.datetime.TimeZone

fun defaultEpicCalendarPagerMonthRange() = EpicMonth(1900, Month.JANUARY)..EpicMonth(2100, Month.DECEMBER)
fun defaultEpicCalendarPagerMonthRange() =
EpicMonth(1900, Month.JANUARY)..EpicMonth(2100, Month.DECEMBER)
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import epicarchitect.calendar.compose.basis.addMonths
import epicarchitect.calendar.compose.basis.addYears
import epicarchitect.calendar.compose.basis.getByIndex
import epicarchitect.calendar.compose.basis.indexOf
import epicarchitect.calendar.compose.basis.size
import epicarchitect.calendar.compose.pager.config.EpicCalendarPagerConfig
import epicarchitect.calendar.compose.pager.config.LocalEpicCalendarPagerConfig

Expand Down Expand Up @@ -50,7 +51,9 @@ fun rememberEpicCalendarPagerState(
val pagerState = rememberPagerState(
initialPage = remember(monthRange, initialMonth) {
monthRange.indexOf(initialMonth) ?: 0
}
},
initialPageOffsetFraction = 0f,
pageCount = monthRange::size
)

return remember(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package epicarchitect.calendar.compose.ranges

import androidx.compose.ui.unit.IntOffset
import epicarchitect.calendar.compose.basis.EpicCalendarConstants
import epicarchitect.calendar.compose.basis.state.EpicCalendarGridInfo
import epicarchitect.calendar.compose.basis.atEndDay
import epicarchitect.calendar.compose.basis.atStartDay
import epicarchitect.calendar.compose.basis.epicMonth
import epicarchitect.calendar.compose.basis.index
import epicarchitect.calendar.compose.basis.state.EpicCalendarGridInfo
import kotlinx.datetime.LocalDate

internal fun calculateEpicRangeInfo(
Expand Down Expand Up @@ -42,8 +42,8 @@ internal fun calculateEpicRangeInfo(

gridInfo.nextMonth -> {
gridInfo.currentMonth.atStartDay().dayOfWeek.index() +
gridInfo.currentMonth.numberOfDays +
startDate.dayOfMonth - 1
gridInfo.currentMonth.numberOfDays +
startDate.dayOfMonth - 1
}

else -> {
Expand All @@ -70,8 +70,8 @@ internal fun calculateEpicRangeInfo(

gridInfo.nextMonth -> {
gridInfo.currentMonth.atStartDay().dayOfWeek.index() +
gridInfo.currentMonth.numberOfDays +
endDate.dayOfMonth - 1
gridInfo.currentMonth.numberOfDays +
endDate.dayOfMonth - 1
}

else -> {
Expand Down
10 changes: 5 additions & 5 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[libraries]
android-gradlePlugin = "com.android.tools.build:gradle:8.0.0"
kotlin-gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20"
compose-gradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:1.4.0"
kotlin-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.4.0"
android-activityCompose = "androidx.activity:activity-compose:1.7.1"
android-gradlePlugin = "com.android.tools.build:gradle:8.1.2"
kotlin-gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10"
compose-gradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:1.5.2"
kotlin-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.4.1"
android-activityCompose = "androidx.activity:activity-compose:1.7.2"
2 changes: 1 addition & 1 deletion sample/ios-app/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../shared"

SPEC CHECKSUMS:
shared: b7f8815660e2de50afa0ead586037195ce420ad9
shared: df03afde90acfa8db25727b36ecbd1eba27af1c6

PODFILE CHECKSUM: c059e725210354aad0967f93f1e9d1cdeea0af8c

Expand Down
3 changes: 3 additions & 0 deletions sample/ios-app/Pods/Local Podspecs/shared.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sample/ios-app/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a6e390e

Please sign in to comment.