Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose Multiplatform #89

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
487261f
refactor core module to multiplatform
DatL4g Mar 29, 2024
58908fb
multiplatform core module
DatL4g Mar 29, 2024
1d38e02
fix old android targets
DatL4g Mar 29, 2024
2f65c32
prepare calendar multiplatform
DatL4g Mar 29, 2024
392641f
calendar multiplatform compatible
DatL4g Mar 29, 2024
afa6178
rating multiplatform compatible
DatL4g Mar 30, 2024
5393ed2
option multiplatform compatible
DatL4g Mar 30, 2024
50dcb48
list multiplatform compatible
DatL4g Mar 30, 2024
83dde05
multiplatform landscape check
DatL4g Mar 30, 2024
8e11b75
prepare snapshot release
DatL4g Mar 30, 2024
75d6893
fix snapshot release
DatL4g Mar 30, 2024
0cd7fa2
added release workflow
DatL4g Mar 30, 2024
da08075
api core library
DatL4g Mar 30, 2024
8ecc373
make states fully serializable
DatL4g Mar 30, 2024
14e7852
added missing java serialization
DatL4g Mar 30, 2024
981caa0
skip workflows
DatL4g Mar 30, 2024
3da43ed
fix calendar module
DatL4g Mar 30, 2024
4efdbde
fix calendar module
DatL4g Mar 30, 2024
879f669
fix calendar resources
DatL4g Mar 30, 2024
87bb4a0
fix calendar arrow size
DatL4g Mar 30, 2024
ba08232
added default selection for rating
DatL4g Apr 3, 2024
a8ba838
fix resources
DatL4g Apr 3, 2024
b795aa9
added possibility to deselect rating and rating of 0 is valid
DatL4g Apr 4, 2024
47a5cca
migrate state module
DatL4g Apr 4, 2024
8d3262e
migrate input module
DatL4g Apr 4, 2024
adeb1c0
migrate info module
DatL4g Apr 4, 2024
6f30cb1
migrate color module
DatL4g Apr 4, 2024
446bdd0
migrate emoji module
DatL4g Apr 11, 2024
37bc03c
migrate emoji module
DatL4g Apr 11, 2024
2a6a658
migrate date_time module
DatL4g Apr 11, 2024
dcc5d95
migrate date_time module
DatL4g Apr 11, 2024
7b2940a
migrate date_time module
DatL4g Apr 11, 2024
0d1f94e
migrate duration module
DatL4g Apr 12, 2024
38d3372
migrate clock module
DatL4g Apr 12, 2024
1d5bfa7
added missing configuration
DatL4g Apr 12, 2024
b29bc84
changed readme as core module is not required to add manually anymore
DatL4g Apr 12, 2024
02dbb78
added wasm target
DatL4g Apr 12, 2024
a6a90ff
added missing wasm implementations
DatL4g Apr 12, 2024
5f185b5
chore(deps): ⬆️ Upgraded Compose versions
maicol07 Apr 15, 2024
fb7d802
refactor: Moved dependency management from buildSrc to Version Catalog
maicol07 Apr 16, 2024
1c81161
Merge pull request #1 from maicol07/main
DatL4g Apr 16, 2024
da9f1f1
updated compose
DatL4g Apr 17, 2024
3886da0
ignore some fields from java serialization
DatL4g Apr 18, 2024
8c34770
roll back compose version
DatL4g Apr 18, 2024
e53bb5f
update to latest compose version
DatL4g Apr 29, 2024
cee7dbe
update to latest compose version
DatL4g Apr 30, 2024
90b23af
option invoke click listener
DatL4g Apr 30, 2024
01e57b0
option icon size
DatL4g May 12, 2024
b022d95
rating body max width
DatL4g May 12, 2024
dd2451a
revert sizing
DatL4g May 12, 2024
f16d2d3
revert LocalDate calculations and fix visual error
DatL4g May 13, 2024
dce4cd0
removed unused file
DatL4g May 13, 2024
f21cd3d
apply system locale on jvm
DatL4g May 14, 2024
24de041
added missing localization
DatL4g May 14, 2024
27692e6
added body for option
DatL4g May 14, 2024
ed2ba8c
added missing body dependency injection
DatL4g May 14, 2024
d2848f5
updated compose
DatL4g May 17, 2024
01f3361
updated dependencies
DatL4g May 22, 2024
3518cc7
fix crash on android
DatL4g May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
update to latest compose version
  • Loading branch information
DatL4g committed Apr 29, 2024
commit e53bb5f9fbee9f99b7338d77a931e5e3013b9f6b
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: gradle/gradle-build-action@v3

- name: Publish release
run: ./gradlew publishAllPublicationsToMavenCentralRepository
run: ./gradlew publishAllPublicationsToMavenCentralRepository -x lint -x lintVitalRelease
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
17 changes: 5 additions & 12 deletions calendar/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

/*
* Copyright (C) 2022-2024. Maximilian Keppeler (https://www.maxkeppeler.com)
Expand Down Expand Up @@ -37,6 +36,11 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
lint {
checkGeneratedSources = false
checkReleaseBuilds = false
abortOnError = false
}
}

kotlin {
Expand All @@ -58,13 +62,6 @@ kotlin {
binaries.executable()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = Modules.CALENDAR.moduleName
browser()
binaries.executable()
}

applyDefaultHierarchyTemplate()

sourceSets {
Expand All @@ -89,10 +86,6 @@ kotlin {
nativeMain.orNull?.dependsOn(this)
jsMain.orNull?.dependsOn(this)
}

val wasmJsMain by getting {
dependsOn(nonJvmMain)
}
}
}

Expand Down
13 changes: 5 additions & 8 deletions clock/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

/*
* Copyright (C) 2022-2024. Maximilian Keppeler (https://www.maxkeppeler.com)
Expand Down Expand Up @@ -37,6 +36,11 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
lint {
checkGeneratedSources = false
checkReleaseBuilds = false
abortOnError = false
}
}

kotlin {
Expand All @@ -58,13 +62,6 @@ kotlin {
binaries.executable()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = Modules.CLOCK.moduleName
browser()
binaries.executable()
}

applyDefaultHierarchyTemplate()

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.maxkeppeler.sheets.clock.models

import androidx.compose.runtime.Stable
import com.maxkeppeker.sheets.core.icons.LibIcons
import com.maxkeppeker.sheets.core.models.base.BaseConfigs
import com.maxkeppeker.sheets.core.models.base.LibOrientation
Expand All @@ -29,6 +30,7 @@ import kotlinx.datetime.LocalTime
* @param icons The style of icons that are used for dialog/ view-specific icons.
* @param orientation The orientation of the view or null for auto orientation.
*/
@Stable
data class ClockConfig(
val defaultTime: LocalTime? = null,
val boundary: ClosedRange<LocalTime>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

package com.maxkeppeler.sheets.clock.models

import androidx.compose.runtime.Stable
import com.maxkeppeker.sheets.core.models.base.BaseSelection
import com.maxkeppeker.sheets.core.models.base.SelectionButton
import com.maxkeppeker.sheets.core.utils.BaseConstants

/**
* The selection configuration for the clock dialog.
*/
@Stable
sealed class ClockSelection : BaseSelection() {

/**
Expand All @@ -36,7 +38,8 @@ sealed class ClockSelection : BaseSelection() {
* @param positiveButton The button that will be used as a positive button.
* @param onPositiveClick The listener that returns the selected hours and minutes.
*/
class HoursMinutes(
@Stable
data class HoursMinutes(
override val withButtonView: Boolean = false,
override val extraButton: SelectionButton? = null,
override val onExtraButtonClick: (() -> Unit)? = null,
Expand All @@ -56,7 +59,8 @@ sealed class ClockSelection : BaseSelection() {
* @param positiveButton The button that will be used as a positive button.
* @param onPositiveClick The listener that returns the selected hours, minutes and seconds.
*/
class HoursMinutesSeconds(
@Stable
data class HoursMinutesSeconds(
override val withButtonView: Boolean = false,
override val extraButton: SelectionButton? = null,
override val onExtraButtonClick: (() -> Unit)? = null,
Expand Down
13 changes: 5 additions & 8 deletions color/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.android.library)
Expand All @@ -21,6 +20,11 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
lint {
checkGeneratedSources = false
checkReleaseBuilds = false
abortOnError = false
}
}

kotlin {
Expand All @@ -42,13 +46,6 @@ kotlin {
binaries.executable()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = Modules.COLOR.moduleName
browser()
binaries.executable()
}

applyDefaultHierarchyTemplate()

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.maxkeppeler.sheets.color.models

import androidx.compose.runtime.Stable
import com.maxkeppeker.sheets.core.icons.LibIcons
import com.maxkeppeker.sheets.core.models.base.BaseConfigs
import com.maxkeppeker.sheets.core.utils.BaseConstants.DEFAULT_ICON_STYLE
Expand All @@ -27,6 +28,7 @@ import com.maxkeppeker.sheets.core.utils.BaseConstants.DEFAULT_ICON_STYLE
* @param allowCustomColorAlphaValues Allow alpha values in the custom color picker.
* @param icons The style of icons that are used for dialog/ view-specific icons.
*/
@Stable
data class ColorConfig(
val displayMode: ColorSelectionMode? = null,
val defaultDisplayMode: ColorSelectionMode? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.maxkeppeler.sheets.color.models

import androidx.compose.runtime.Stable
import com.maxkeppeker.sheets.core.models.base.BaseSelection
import com.maxkeppeker.sheets.core.models.base.SelectionButton
import com.maxkeppeker.sheets.core.utils.BaseConstants
Expand All @@ -33,6 +34,7 @@ import com.maxkeppeker.sheets.core.utils.BaseConstants
* @param onSelectNone The listener that is invoked when no color is selected.
* @param onSelectColor The listener that returns the selected color.
*/
@Stable
data class ColorSelection(
val selectedColor: SingleColor? = null,
override val withButtonView: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
*/
package com.maxkeppeler.sheets.color.models

import androidx.compose.runtime.Stable
import kotlinx.serialization.Serializable

/**
* Defined display modes for the calendar.
*/
@Stable
@Serializable
enum class ColorSelectionMode {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.maxkeppeler.sheets.color.models

import androidx.compose.runtime.Stable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb

Expand All @@ -25,6 +26,7 @@ import androidx.compose.ui.graphics.toArgb
* @param colorRes Res of color value.
* @param colorHex Color value as Hex-String.
*/
@Stable
data class SingleColor(
val colorInt: Int? = null,
val colorHex: String? = null,
Expand Down
18 changes: 5 additions & 13 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

/*
* Copyright (C) 2022-2024. Maximilian Keppeler (https://www.maxkeppeler.com)
Expand Down Expand Up @@ -37,6 +36,11 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
lint {
checkGeneratedSources = false
checkReleaseBuilds = false
abortOnError = false
}
}

kotlin {
Expand All @@ -58,13 +62,6 @@ kotlin {
binaries.executable()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = Modules.CORE.moduleName
browser()
binaries.executable()
}

applyDefaultHierarchyTemplate()

sourceSets {
Expand Down Expand Up @@ -98,11 +95,6 @@ kotlin {
nativeMain.orNull?.dependsOn(this)
jsMain.orNull?.dependsOn(this)
}

val wasmJsMain by getting {
dependsOn(nonJvmMain)
dependsOn(nonMacosMain)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

package com.maxkeppeker.sheets.core.icons

import androidx.compose.runtime.Stable
import androidx.compose.ui.graphics.vector.ImageVector
import com.maxkeppeker.sheets.core.utils.JvmSerializable
import kotlinx.serialization.Serializable

@Stable
sealed class LibIcons : JvmSerializable {

abstract var EmojiEmotions: ImageVector
Expand Down Expand Up @@ -35,7 +37,8 @@ sealed class LibIcons : JvmSerializable {
* [Filled icons](https://material.io/resources/icons/?style=baseline) (previously the only
* available theme, also known as the baseline theme) are the default icon theme.
*/
object Filled : LibIcons() {
@Stable
data object Filled : LibIcons() {
override var EmojiEmotions = com.maxkeppeker.sheets.core.icons.filled.EmojiEmotions
override var EmojiNature = com.maxkeppeker.sheets.core.icons.filled.EmojiNature
override var EmojiFoodBeverage = com.maxkeppeker.sheets.core.icons.filled.EmojiFoodBeverage
Expand Down Expand Up @@ -64,7 +67,8 @@ sealed class LibIcons : JvmSerializable {
* [Outlined icons](https://material.io/resources/icons/?style=outline) make use of a thin
* stroke and empty space inside for a lighter appearance.
*/
object Outlined : LibIcons() {
@Stable
data object Outlined : LibIcons() {
override var EmojiEmotions = com.maxkeppeker.sheets.core.icons.outlined.EmojiEmotions
override var EmojiNature = com.maxkeppeker.sheets.core.icons.outlined.EmojiNature
override var EmojiFoodBeverage = com.maxkeppeker.sheets.core.icons.outlined.EmojiFoodBeverage
Expand Down Expand Up @@ -94,7 +98,8 @@ sealed class LibIcons : JvmSerializable {
* pairs well with brands that use heavier typography, curved logos, or circular elements to
* express their style.
*/
object Rounded : LibIcons() {
@Stable
data object Rounded : LibIcons() {
override var EmojiEmotions = com.maxkeppeker.sheets.core.icons.rounded.EmojiEmotions
override var EmojiNature = com.maxkeppeker.sheets.core.icons.rounded.EmojiNature
override var EmojiFoodBeverage = com.maxkeppeker.sheets.core.icons.rounded.EmojiFoodBeverage
Expand Down Expand Up @@ -124,7 +129,8 @@ sealed class LibIcons : JvmSerializable {
* straight edges, for a crisp style that remains legible even at smaller scales. These
* rectangular shapes can support brand styles that are not well-reflected by rounded shapes.
*/
object TwoTone : LibIcons() {
@Stable
data object TwoTone : LibIcons() {
override var EmojiEmotions = com.maxkeppeker.sheets.core.icons.twotone.EmojiEmotions
override var EmojiNature = com.maxkeppeker.sheets.core.icons.twotone.EmojiNature
override var EmojiFoodBeverage = com.maxkeppeker.sheets.core.icons.twotone.EmojiFoodBeverage
Expand Down Expand Up @@ -154,7 +160,8 @@ sealed class LibIcons : JvmSerializable {
* straight edges, for a crisp style that remains legible even at smaller scales. These
* rectangular shapes can support brand styles that are not well-reflected by rounded shapes.
*/
object Sharp : LibIcons() {
@Stable
data object Sharp : LibIcons() {
override var EmojiEmotions = com.maxkeppeker.sheets.core.icons.sharp.EmojiEmotions
override var EmojiNature = com.maxkeppeker.sheets.core.icons.sharp.EmojiNature
override var EmojiFoodBeverage = com.maxkeppeker.sheets.core.icons.sharp.EmojiFoodBeverage
Expand Down
13 changes: 5 additions & 8 deletions date_time/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

/*
* Copyright (C) 2022-2024. Maximilian Keppeler (https://www.maxkeppeler.com)
Expand Down Expand Up @@ -37,6 +36,11 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
lint {
checkGeneratedSources = false
checkReleaseBuilds = false
abortOnError = false
}
}

kotlin {
Expand All @@ -58,13 +62,6 @@ kotlin {
binaries.executable()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = Modules.DATE_TIME.moduleName
browser()
binaries.executable()
}

applyDefaultHierarchyTemplate()

sourceSets {
Expand Down