From 769834bf8c1fa2e2279aa6b4af45fb0603b55d0a Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Sun, 16 Oct 2022 00:15:20 +0200 Subject: [PATCH] [API Change] Changes in API + Added Apache License (#88) * [API Change] Changes in API + Added Apache License --- .../sample/ExampleInstrumentedTest.kt | 20 ++++++++- .../java/com/himanshoe/sample/MainActivity.kt | 15 +++++++ .../java/com/himanshoe/sample/Navigator.kt | 15 +++++++ .../com/himanshoe/sample/demo/KalendarDemo.kt | 15 +++++++ .../sample/demo/KalendarEndlossDemo.kt | 15 +++++++ .../com/himanshoe/sample/ExampleUnitTest.kt | 15 +++++++ buildSrc/src/main/kotlin/Dependencies.kt | 11 +---- gradle.properties | 4 +- kalendar-endlos/build.gradle.kts | 1 - .../endlos/ExampleInstrumentedTest.kt | 20 ++++++++- .../com/himanshoe/kalendar/endlos/Kalendar.kt | 25 ++++++++--- .../kalendar/endlos/KalendarEndloss.kt | 15 +++++++ .../kalendar/endlos/KalendarMonth.kt | 15 +++++++ .../kalendar/endlos/KalendarViewModel.kt | 21 ---------- .../kalendar/endlos/color/KalendarColors.kt | 15 +++++++ .../endlos/component/day/KalendarDay.kt | 15 +++++++ .../component/day/config/KalendarDayColors.kt | 15 +++++++ .../component/day/config/KalendarDayState.kt | 15 +++++++ .../endlos/component/header/KalendarHeader.kt | 15 +++++++ .../header/config/KalendarHeaderConfig.kt | 15 +++++++ .../component/text/KalendarNormalText.kt | 15 +++++++ .../endlos/component/text/KalendarSubTitle.kt | 15 +++++++ .../endlos/component/text/KalendarTitle.kt | 15 +++++++ .../text/config/KalendarTextColor.kt | 15 +++++++ .../text/config/KalendarTextConfig.kt | 15 +++++++ .../component/text/config/KalendarTextSize.kt | 15 +++++++ .../kalendar/endlos/model/KalendarDay.kt | 15 +++++++ .../kalendar/endlos/model/KalendarEvent.kt | 15 +++++++ .../endlos/paging/KalendarPagingController.kt | 41 +++++++++++++++++++ .../{ => paging}/KalendarPagingSource.kt | 19 ++++++++- .../kalendar/endlos/ExampleUnitTest.kt | 15 +++++++ .../kalendar/ExampleInstrumentedTest.kt | 20 ++++++++- kalendar/src/main/AndroidManifest.xml | 2 +- .../java/com/himanshoe/kalendar/Kalendar.kt | 15 +++++++ .../kalendar/color/KalendarColors.kt | 15 +++++++ .../component/button/KalendarIconButton.kt | 15 +++++++ .../kalendar/component/day/KalendarDay.kt | 15 +++++++ .../component/day/config/KalendarDayColors.kt | 15 +++++++ .../component/day/config/KalendarDayState.kt | 15 +++++++ .../component/header/KalendarHeader.kt | 15 +++++++ .../header/config/KalendarHeaderConfig.kt | 15 +++++++ .../component/text/KalendarNormalText.kt | 15 +++++++ .../component/text/KalendarSubTitle.kt | 15 +++++++ .../kalendar/component/text/KalendarTitle.kt | 15 +++++++ .../text/config/KalendarTextColor.kt | 15 +++++++ .../text/config/KalendarTextConfig.kt | 15 +++++++ .../component/text/config/KalendarTextSize.kt | 15 +++++++ .../himanshoe/kalendar/model/KalendarDay.kt | 15 +++++++ .../himanshoe/kalendar/model/KalendarEvent.kt | 15 +++++++ .../himanshoe/kalendar/model/KalendarType.kt | 15 +++++++ .../kalendar/ui/firey/KalendarFirey.kt | 15 +++++++ .../kalendar/ui/oceanic/KalendarOceanic.kt | 15 +++++++ .../kalendar/ui/oceanic/data/WeekDates.kt | 15 +++++++ .../com/himanshoe/kalendar/ExampleUnitTest.kt | 15 +++++++ 54 files changed, 784 insertions(+), 45 deletions(-) delete mode 100644 kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarViewModel.kt create mode 100644 kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/paging/KalendarPagingController.kt rename kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/{ => paging}/KalendarPagingSource.kt (63%) diff --git a/app/src/androidTest/java/com/himanshoe/sample/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/himanshoe/sample/ExampleInstrumentedTest.kt index 50d6487..0dbe64a 100644 --- a/app/src/androidTest/java/com/himanshoe/sample/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/com/himanshoe/sample/ExampleInstrumentedTest.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.sample import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -17,6 +32,9 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.himanshoe.sample", appContext.packageName) + assertEquals( + "com.himanshoe.sample", + appContext.packageName + ) } } diff --git a/app/src/main/java/com/himanshoe/sample/MainActivity.kt b/app/src/main/java/com/himanshoe/sample/MainActivity.kt index 49c101c..2e0fb91 100644 --- a/app/src/main/java/com/himanshoe/sample/MainActivity.kt +++ b/app/src/main/java/com/himanshoe/sample/MainActivity.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.sample import android.os.Bundle diff --git a/app/src/main/java/com/himanshoe/sample/Navigator.kt b/app/src/main/java/com/himanshoe/sample/Navigator.kt index 939daba..ea62961 100644 --- a/app/src/main/java/com/himanshoe/sample/Navigator.kt +++ b/app/src/main/java/com/himanshoe/sample/Navigator.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.sample import androidx.compose.runtime.Composable diff --git a/app/src/main/java/com/himanshoe/sample/demo/KalendarDemo.kt b/app/src/main/java/com/himanshoe/sample/demo/KalendarDemo.kt index 429e447..0caea6d 100644 --- a/app/src/main/java/com/himanshoe/sample/demo/KalendarDemo.kt +++ b/app/src/main/java/com/himanshoe/sample/demo/KalendarDemo.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.sample.demo import androidx.compose.foundation.background diff --git a/app/src/main/java/com/himanshoe/sample/demo/KalendarEndlossDemo.kt b/app/src/main/java/com/himanshoe/sample/demo/KalendarEndlossDemo.kt index 50703cd..72bca35 100644 --- a/app/src/main/java/com/himanshoe/sample/demo/KalendarEndlossDemo.kt +++ b/app/src/main/java/com/himanshoe/sample/demo/KalendarEndlossDemo.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.sample.demo import androidx.compose.foundation.background diff --git a/app/src/test/java/com/himanshoe/sample/ExampleUnitTest.kt b/app/src/test/java/com/himanshoe/sample/ExampleUnitTest.kt index 5b9c893..9c50099 100644 --- a/app/src/test/java/com/himanshoe/sample/ExampleUnitTest.kt +++ b/app/src/test/java/com/himanshoe/sample/ExampleUnitTest.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.sample import org.junit.Assert.assertEquals diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 148e0ba..9ed6a37 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -16,7 +16,6 @@ object Deps { val uiToolingPreview by lazy { "androidx.compose.ui:ui-tooling-preview:${Versions.compose}" } val material by lazy { "androidx.compose.material:material:${Versions.compose}" } val activity by lazy { "androidx.activity:activity-compose:${Versions.activity}" } - val viewmodel by lazy { "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.1" } val pagination by lazy { "androidx.paging:paging-compose:1.0.0-alpha14"} } @@ -44,10 +43,6 @@ object Deps { } } - object Desugar { - val jdk by lazy { "com.android.tools:desugar_jdk_libs:1.1.5" } - } - object Gradle { val kotlinGradlePlugin by lazy { "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" } val androidGradlePlugin by lazy { "com.android.tools.build:gradle:${Versions.androidGradlePlugin}" } @@ -55,8 +50,4 @@ object Deps { val ktlintGradlePlugin by lazy { "org.jlleitschuh.gradle:ktlint-gradle:${Versions.ktlint}" } val detektGradlePlugin by lazy { "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${Versions.detekt}" } } -} - -object ProjectPath { - const val kalendar = ":kalendar" -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index cac7c68..6009ec1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,8 +11,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app"s APK +# AndroidX +packaged with your app"s APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX diff --git a/kalendar-endlos/build.gradle.kts b/kalendar-endlos/build.gradle.kts index 246c3a0..8e26341 100644 --- a/kalendar-endlos/build.gradle.kts +++ b/kalendar-endlos/build.gradle.kts @@ -46,7 +46,6 @@ dependencies { implementation(Deps.Compose.activity) debugApi(Deps.Compose.uiTooling) - implementation(Deps.Compose.viewmodel) implementation(Deps.Compose.pagination) testImplementation(Deps.Test.jUnit) diff --git a/kalendar-endlos/src/androidTest/java/com/himanshoe/kalendar/endlos/ExampleInstrumentedTest.kt b/kalendar-endlos/src/androidTest/java/com/himanshoe/kalendar/endlos/ExampleInstrumentedTest.kt index 866adba..24ec64e 100644 --- a/kalendar-endlos/src/androidTest/java/com/himanshoe/kalendar/endlos/ExampleInstrumentedTest.kt +++ b/kalendar-endlos/src/androidTest/java/com/himanshoe/kalendar/endlos/ExampleInstrumentedTest.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -17,6 +32,9 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.himanshoe.kalendar.endlos.test", appContext.packageName) + assertEquals( + "com.himanshoe.kalendar.endlos.test", + appContext.packageName + ) } } diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/Kalendar.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/Kalendar.kt index 848616c..4ca90d1 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/Kalendar.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/Kalendar.kt @@ -1,8 +1,22 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.lifecycle.viewmodel.compose.viewModel import androidx.paging.compose.collectAsLazyPagingItems import com.himanshoe.kalendar.endlos.color.KalendarColors import com.himanshoe.kalendar.endlos.color.KalendarThemeColor @@ -10,6 +24,7 @@ import com.himanshoe.kalendar.endlos.component.day.config.KalendarDayColors import com.himanshoe.kalendar.endlos.component.day.config.KalendarDayDefaultColors import com.himanshoe.kalendar.endlos.model.KalendarDay import com.himanshoe.kalendar.endlos.model.KalendarEvent +import com.himanshoe.kalendar.endlos.paging.rememberKalendarPagingController @Composable fun Kalendar( @@ -19,10 +34,10 @@ fun Kalendar( onCurrentDayClick: (KalendarDay, List) -> Unit = { _, _ -> }, kalendarDayColors: KalendarDayColors = KalendarDayDefaultColors.defaultColors(), ) { - val kalendarViewModel: KalendarViewModel = viewModel() + val kalendarPagingController = rememberKalendarPagingController() KalendarEndloss( modifier = modifier, - kalendarItems = kalendarViewModel.getDates().collectAsLazyPagingItems(), + kalendarItems = kalendarPagingController.dates.collectAsLazyPagingItems(), kalendarEvents = kalendarEvents, onCurrentDayClick = onCurrentDayClick, kalendarDayColors = kalendarDayColors, @@ -38,10 +53,10 @@ fun Kalendar( onCurrentDayClick: (KalendarDay, List) -> Unit = { _, _ -> }, kalendarDayColors: KalendarDayColors = KalendarDayDefaultColors.defaultColors(), ) { - val kalendarViewModel: KalendarViewModel = viewModel() + val kalendarPagingController = rememberKalendarPagingController() KalendarEndloss( modifier = modifier, - kalendarItems = kalendarViewModel.getDates().collectAsLazyPagingItems(), + kalendarItems = kalendarPagingController.dates.collectAsLazyPagingItems(), kalendarEvents = kalendarEvents, onCurrentDayClick = onCurrentDayClick, kalendarDayColors = kalendarDayColors, diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarEndloss.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarEndloss.kt index c0893df..fc73a7b 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarEndloss.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarEndloss.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos import androidx.compose.foundation.background diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarMonth.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarMonth.kt index 1c9da55..78bb727 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarMonth.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarMonth.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos import androidx.compose.foundation.layout.Arrangement diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarViewModel.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarViewModel.kt deleted file mode 100644 index a3a3b0b..0000000 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarViewModel.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.himanshoe.kalendar.endlos - -import androidx.lifecycle.ViewModel -import androidx.paging.Pager -import androidx.paging.PagingConfig -import androidx.paging.PagingData -import kotlinx.coroutines.flow.Flow -import kotlinx.datetime.LocalDate - -internal class KalendarViewModel : ViewModel() { - - fun getDates(): Flow> = Pager( - config = PagingConfig( - 12, - enablePlaceholders = true, - initialLoadSize = 12, - prefetchDistance = 5 - ), - pagingSourceFactory = { KalendarPagingSource() } - ).flow -} diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/color/KalendarColors.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/color/KalendarColors.kt index 2df5466..85939b3 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/color/KalendarColors.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/color/KalendarColors.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.color import androidx.compose.runtime.Stable diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/KalendarDay.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/KalendarDay.kt index 2349072..464b382 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/KalendarDay.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/KalendarDay.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.day import androidx.compose.foundation.BorderStroke diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayColors.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayColors.kt index f85ce42..938df62 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayColors.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayColors.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.day.config import androidx.compose.ui.graphics.Color diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayState.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayState.kt index 54dc275..d8a6b4b 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayState.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/day/config/KalendarDayState.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.day.config sealed interface KalendarDayState { diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/KalendarHeader.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/KalendarHeader.kt index 9e65a5c..58e0655 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/KalendarHeader.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/KalendarHeader.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component import androidx.compose.foundation.layout.fillMaxWidth diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/config/KalendarHeaderConfig.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/config/KalendarHeaderConfig.kt index 412c579..896a03c 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/config/KalendarHeaderConfig.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/header/config/KalendarHeaderConfig.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.header.config import com.himanshoe.kalendar.endlos.component.text.config.KalendarTextConfig diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarNormalText.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarNormalText.kt index 038e90d..a86af7c 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarNormalText.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarNormalText.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.text import androidx.compose.material.Text diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarSubTitle.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarSubTitle.kt index 84b12cf..dd66e91 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarSubTitle.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarSubTitle.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.text import androidx.compose.material.Text diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarTitle.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarTitle.kt index a075ce5..3b9c634 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarTitle.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/KalendarTitle.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.text import androidx.compose.material.Text diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextColor.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextColor.kt index d253b5a..dba0dd6 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextColor.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextColor.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.text.config import androidx.compose.ui.graphics.Color diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextConfig.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextConfig.kt index 363aefb..ee4f0e9 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextConfig.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextConfig.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.text.config data class KalendarTextConfig( diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextSize.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextSize.kt index 755ccfd..06976f0 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextSize.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/component/text/config/KalendarTextSize.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.component.text.config import androidx.compose.ui.unit.TextUnit diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarDay.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarDay.kt index d8dd476..f6d7b70 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarDay.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarDay.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.model import kotlinx.datetime.LocalDate diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarEvent.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarEvent.kt index 8562cbd..66f31d9 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarEvent.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/model/KalendarEvent.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos.model import kotlinx.datetime.LocalDate diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/paging/KalendarPagingController.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/paging/KalendarPagingController.kt new file mode 100644 index 0000000..cf1ed07 --- /dev/null +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/paging/KalendarPagingController.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.himanshoe.kalendar.endlos.paging + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.paging.Pager +import androidx.paging.PagingConfig +import androidx.paging.PagingData +import kotlinx.coroutines.flow.Flow +import kotlinx.datetime.LocalDate + +class KalendarPagingController { + + val dates: Flow> = Pager( + config = PagingConfig( + 12, enablePlaceholders = true, initialLoadSize = 12, prefetchDistance = 5 + ), + pagingSourceFactory = { KalendarPagingSource() } + ).flow +} + +@Composable +fun rememberKalendarPagingController(): KalendarPagingController { + return remember { + KalendarPagingController() + } +} diff --git a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarPagingSource.kt b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/paging/KalendarPagingSource.kt similarity index 63% rename from kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarPagingSource.kt rename to kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/paging/KalendarPagingSource.kt index e8a57c5..5ae2655 100644 --- a/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/KalendarPagingSource.kt +++ b/kalendar-endlos/src/main/java/com/himanshoe/kalendar/endlos/paging/KalendarPagingSource.kt @@ -1,4 +1,19 @@ -package com.himanshoe.kalendar.endlos +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.himanshoe.kalendar.endlos.paging import androidx.paging.PagingSource import androidx.paging.PagingState @@ -9,7 +24,7 @@ import kotlinx.datetime.TimeZone import kotlinx.datetime.plus import kotlinx.datetime.todayIn -class KalendarPagingSource : PagingSource() { +internal class KalendarPagingSource : PagingSource() { override fun getRefreshKey(state: PagingState): Int? { return state.anchorPosition?.let { anchorPosition -> diff --git a/kalendar-endlos/src/test/java/com/himanshoe/kalendar/endlos/ExampleUnitTest.kt b/kalendar-endlos/src/test/java/com/himanshoe/kalendar/endlos/ExampleUnitTest.kt index 8c5786c..1a7a607 100644 --- a/kalendar-endlos/src/test/java/com/himanshoe/kalendar/endlos/ExampleUnitTest.kt +++ b/kalendar-endlos/src/test/java/com/himanshoe/kalendar/endlos/ExampleUnitTest.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.endlos import org.junit.Assert.assertEquals diff --git a/kalendar/src/androidTest/java/com/himanshoe/kalendar/ExampleInstrumentedTest.kt b/kalendar/src/androidTest/java/com/himanshoe/kalendar/ExampleInstrumentedTest.kt index f30f4f3..0ce6498 100644 --- a/kalendar/src/androidTest/java/com/himanshoe/kalendar/ExampleInstrumentedTest.kt +++ b/kalendar/src/androidTest/java/com/himanshoe/kalendar/ExampleInstrumentedTest.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -17,6 +32,9 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.himanshoe.kalendar.test", appContext.packageName) + assertEquals( + "com.himanshoe.kalendar.test", + appContext.packageName + ) } } diff --git a/kalendar/src/main/AndroidManifest.xml b/kalendar/src/main/AndroidManifest.xml index 961020f..1ba7a2c 100644 --- a/kalendar/src/main/AndroidManifest.xml +++ b/kalendar/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + \ No newline at end of file diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/Kalendar.kt b/kalendar/src/main/java/com/himanshoe/kalendar/Kalendar.kt index 011fc5c..9859c27 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/Kalendar.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/Kalendar.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar import androidx.compose.foundation.layout.wrapContentHeight diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/color/KalendarColors.kt b/kalendar/src/main/java/com/himanshoe/kalendar/color/KalendarColors.kt index 3b0f7a8..2930c83 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/color/KalendarColors.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/color/KalendarColors.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.color import androidx.compose.runtime.Stable diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/button/KalendarIconButton.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/button/KalendarIconButton.kt index d508c2c..ca80f7b 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/button/KalendarIconButton.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/button/KalendarIconButton.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.button import androidx.compose.foundation.layout.wrapContentSize diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/day/KalendarDay.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/day/KalendarDay.kt index 7c07764..3ef05c0 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/day/KalendarDay.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/day/KalendarDay.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.day import androidx.compose.foundation.BorderStroke diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayColors.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayColors.kt index 1d5c1ff..fec2bbc 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayColors.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayColors.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.day.config import androidx.compose.ui.graphics.Color diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayState.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayState.kt index bb2a13a..aa9b358 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayState.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/day/config/KalendarDayState.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.day.config sealed interface KalendarDayState { diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/header/KalendarHeader.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/header/KalendarHeader.kt index 4cb11b2..8a643b5 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/header/KalendarHeader.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/header/KalendarHeader.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.header import androidx.compose.animation.AnimatedContent diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/header/config/KalendarHeaderConfig.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/header/config/KalendarHeaderConfig.kt index cd62539..ade50e5 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/header/config/KalendarHeaderConfig.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/header/config/KalendarHeaderConfig.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.header.config import com.himanshoe.kalendar.component.text.config.KalendarTextConfig diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarNormalText.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarNormalText.kt index 8876cdb..0ebd2da 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarNormalText.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarNormalText.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.text import androidx.compose.material.Text diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarSubTitle.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarSubTitle.kt index 88d01be..5d8723e 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarSubTitle.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarSubTitle.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.text import androidx.compose.material.Text diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarTitle.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarTitle.kt index 2843fb5..376054d 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarTitle.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/KalendarTitle.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.text import androidx.compose.material.Text diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextColor.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextColor.kt index 406217c..0a26340 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextColor.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextColor.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.text.config import androidx.compose.ui.graphics.Color diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextConfig.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextConfig.kt index 7e82c3b..8448146 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextConfig.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextConfig.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.text.config data class KalendarTextConfig( diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextSize.kt b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextSize.kt index 717203d..7477cbe 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextSize.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/component/text/config/KalendarTextSize.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.component.text.config import androidx.compose.ui.unit.TextUnit diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarDay.kt b/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarDay.kt index 94f1550..ab7f03a 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarDay.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarDay.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.model import kotlinx.datetime.LocalDate diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarEvent.kt b/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarEvent.kt index b371481..1159a36 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarEvent.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarEvent.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.model import kotlinx.datetime.LocalDate diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarType.kt b/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarType.kt index eeab505..9070eac 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarType.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/model/KalendarType.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.model sealed interface KalendarType { diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/ui/firey/KalendarFirey.kt b/kalendar/src/main/java/com/himanshoe/kalendar/ui/firey/KalendarFirey.kt index c29a851..db704d6 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/ui/firey/KalendarFirey.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/ui/firey/KalendarFirey.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.ui.firey import androidx.compose.foundation.background diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/KalendarOceanic.kt b/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/KalendarOceanic.kt index 9e55743..5760f06 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/KalendarOceanic.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/KalendarOceanic.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.ui.oceanic import androidx.compose.foundation.background diff --git a/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/data/WeekDates.kt b/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/data/WeekDates.kt index 25af7eb..3db857c 100644 --- a/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/data/WeekDates.kt +++ b/kalendar/src/main/java/com/himanshoe/kalendar/ui/oceanic/data/WeekDates.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar.ui.oceanic.data import kotlinx.datetime.DateTimeUnit diff --git a/kalendar/src/test/java/com/himanshoe/kalendar/ExampleUnitTest.kt b/kalendar/src/test/java/com/himanshoe/kalendar/ExampleUnitTest.kt index b649d9c..ee0e1b8 100644 --- a/kalendar/src/test/java/com/himanshoe/kalendar/ExampleUnitTest.kt +++ b/kalendar/src/test/java/com/himanshoe/kalendar/ExampleUnitTest.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2022 Kalendar Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.himanshoe.kalendar import org.junit.Assert.assertEquals