diff --git a/README.md b/README.md index a099bd6..3b5e5b4 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,18 @@ If you are interested to create your own UI, you can use the component `OpenFeed `Composable` takes OpenFeedback Model UI in input and you can use `OpenFeedbackViewModel` in the viewmodel artifact to get the data from the Firebase host. +## Metrics + +If you change Compose contracts or model ui, you can run the following command to check if +Composable or models are still stable: + +```shell +./gradlew assembleRelease -PcomposeCompilerReports=true -PcomposeCompilerMetrics=true +``` + +Then, you can check the `build/compose_compiler` folder where we are using Compose UI to check +metrics. + ## Installation The SDK is available on mavenCentral: diff --git a/build-logic/src/main/kotlin/main.kt b/build-logic/src/main/kotlin/main.kt index 600cf2e..edc255c 100644 --- a/build-logic/src/main/kotlin/main.kt +++ b/build-logic/src/main/kotlin/main.kt @@ -1,6 +1,5 @@ import com.android.build.api.dsl.CommonExtension import com.gradleup.librarian.gradle.* -import org.gradle.api.JavaVersion import org.gradle.api.Project import org.jetbrains.kotlin.gradle.dsl.KotlinCompile import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension @@ -17,9 +16,19 @@ private fun Project.configureAndroid(namespace: String) { } } -private fun Project.configureKotlin() { +private fun Project.configureKotlin(composeMetrics: Boolean) { tasks.withType(KotlinCompile::class.java) { it.kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes" + if (composeMetrics) { + if (project.findProperty("composeCompilerReports") == "true") { + it.kotlinOptions.freeCompilerArgs += "-P" + it.kotlinOptions.freeCompilerArgs += "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.buildDir.absolutePath}/compose_compiler" + } + if (project.findProperty("composeCompilerMetrics") == "true") { + it.kotlinOptions.freeCompilerArgs += "-P" + it.kotlinOptions.freeCompilerArgs += "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.buildDir.absolutePath}/compose_compiler" + } + } } } @@ -48,17 +57,16 @@ fun Project.library( configureAndroid(namespace = namespace) configureKMP() - configureKotlin() + configureKotlin(compose) kotlin(kotlinMultiplatformExtension) librarianModule(publish) } - fun Project.androidApp( namespace: String, ) { configureAndroid(namespace = namespace) - configureKotlin() + configureKotlin(composeMetrics = true) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index aed7718..9dc34cd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,6 +7,7 @@ jetbrains-compose = "1.6.11" jetbrains-kotlin = "2.0.0" jetbrains-kotlin-coroutines = "1.8.1" jetbrains-kotlinx-datetime = "0.6.0" +jetbrains-kotlinx-collections-immutable = "0.3.7" jetbrains-kotlinx-serialization = "1.7.0" jetbrains-kotlinx-binary = "0.15.0-Beta.3" touchlab-kermit = "2.0.4" @@ -31,6 +32,7 @@ jetbrains-kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin- jetbrains-kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "jetbrains-kotlin" } jetbrains-kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "jetbrains-kotlin-coroutines" } jetbrains-kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "jetbrains-kotlinx-datetime" } +jetbrains-kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "jetbrains-kotlinx-collections-immutable" } jetbrains-kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "jetbrains-kotlinx-serialization" } jetbrains-kotlinx-binary-compatibility-validator = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "jetbrains-kotlinx-binary" } diff --git a/openfeedback-m3/build.gradle.kts b/openfeedback-m3/build.gradle.kts index aab1ac6..5f4e1fa 100644 --- a/openfeedback-m3/build.gradle.kts +++ b/openfeedback-m3/build.gradle.kts @@ -1,12 +1,11 @@ plugins { id("com.android.library") id("org.jetbrains.kotlin.plugin.serialization") - id("org.jetbrains.compose") - id("org.jetbrains.kotlin.plugin.compose") } library( namespace = "io.openfeedback.m3", + compose = true, publish = true, ) { kotlinMultiplatformExtension -> kotlinMultiplatformExtension.sourceSets { diff --git a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentItemsPreview.kt b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentItemsPreview.kt index 2bd96f1..4fd25ff 100644 --- a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentItemsPreview.kt +++ b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentItemsPreview.kt @@ -5,19 +5,20 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview import io.openfeedback.ui.models.UIComment import io.openfeedback.ui.models.UIDot +import kotlinx.collections.immutable.persistentListOf @Preview @Composable private fun CommentItemsPreview() { MaterialTheme { CommentItems( - comments = listOf( + comments = persistentListOf( UIComment( id = "", message = "Nice comment", createdAt = "08 August 2023", upVotes = 8, - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true, fromUser = false ), @@ -26,7 +27,7 @@ private fun CommentItemsPreview() { message = "Another comment", createdAt = "08 August 2023", upVotes = 0, - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true, fromUser = false ) diff --git a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentPreview.kt b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentPreview.kt index 1ade668..450bd33 100644 --- a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentPreview.kt +++ b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentPreview.kt @@ -5,6 +5,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview import io.openfeedback.ui.models.UIComment import io.openfeedback.ui.models.UIDot +import kotlinx.collections.immutable.persistentListOf @Preview @Composable @@ -16,7 +17,7 @@ private fun CommentPreview() { message = "Super talk and great speakers!", createdAt = "08 August 2023", upVotes = 8, - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true, fromUser = false ), diff --git a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/OpenFeedbackLayoutPreview.kt b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/OpenFeedbackLayoutPreview.kt index 8043e29..1e21e63 100644 --- a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/OpenFeedbackLayoutPreview.kt +++ b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/OpenFeedbackLayoutPreview.kt @@ -13,6 +13,7 @@ import io.openfeedback.ui.models.UIComment import io.openfeedback.ui.models.UIDot import io.openfeedback.ui.models.UISessionFeedback import io.openfeedback.ui.models.UIVoteItem +import kotlinx.collections.immutable.persistentListOf @OptIn(ExperimentalMaterial3Api::class) @Preview @@ -21,13 +22,13 @@ private fun OpenFeedbackLayoutPreview() { MaterialTheme { OpenFeedbackLayout( sessionFeedback = UISessionFeedback( - comments = listOf( + comments = persistentListOf( UIComment( id = "", message = "Nice comment", createdAt = "08 August 2023", upVotes = 8, - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true, fromUser = false ), @@ -36,26 +37,26 @@ private fun OpenFeedbackLayoutPreview() { message = "Another one", createdAt = "08 August 2023", upVotes = 0, - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true, fromUser = false ) ), - voteItems = listOf( + voteItems = persistentListOf( UIVoteItem( id = "", text = "Fun", - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true ), UIVoteItem( id = "", text = "Fun", - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true ) ), - colors = emptyList() + colors = persistentListOf() ), horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp), diff --git a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteCardPreview.kt b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteCardPreview.kt index 6f6e9e0..ab4590a 100644 --- a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteCardPreview.kt +++ b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteCardPreview.kt @@ -9,6 +9,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import io.openfeedback.ui.models.UIDot import io.openfeedback.ui.models.UIVoteItem +import kotlinx.collections.immutable.persistentListOf @OptIn(ExperimentalMaterial3Api::class) @Preview @@ -19,7 +20,7 @@ private fun VoteCardPreview() { voteModel = UIVoteItem( id = "", text = "Fun", - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true ), onClick = {}, diff --git a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteItemsPreview.kt b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteItemsPreview.kt index 92ef9ac..ea8fe8e 100644 --- a/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteItemsPreview.kt +++ b/openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteItemsPreview.kt @@ -11,6 +11,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import io.openfeedback.ui.models.UIDot import io.openfeedback.ui.models.UIVoteItem +import kotlinx.collections.immutable.persistentListOf @OptIn(ExperimentalMaterial3Api::class) @Preview @@ -18,17 +19,17 @@ import io.openfeedback.ui.models.UIVoteItem private fun VoteItemsPreview() { MaterialTheme { VoteItems( - voteItems = listOf( + voteItems = persistentListOf( UIVoteItem( id = "", text = "Fun", - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true ), UIVoteItem( id = "", text = "Fun", - dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), + dots = persistentListOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), votedByUser = true ) ), diff --git a/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/CommentItems.kt b/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/CommentItems.kt index d95e98c..98073ba 100644 --- a/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/CommentItems.kt +++ b/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/CommentItems.kt @@ -10,10 +10,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import io.openfeedback.resources.LocalStrings import io.openfeedback.ui.models.UIComment +import kotlinx.collections.immutable.ImmutableList @Composable internal fun CommentItems( - comments: List, + comments: ImmutableList, modifier: Modifier = Modifier, verticalArrangement: Arrangement.Vertical = Arrangement.spacedBy(8.dp), commentInput: @Composable ColumnScope.() -> Unit, diff --git a/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/VoteItems.kt b/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/VoteItems.kt index 8eaedbc..0b814e4 100644 --- a/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/VoteItems.kt +++ b/openfeedback-m3/src/commonMain/kotlin/io/openfeedback/m3/VoteItems.kt @@ -9,11 +9,12 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import io.openfeedback.ui.models.UIVoteItem +import kotlinx.collections.immutable.ImmutableList @ExperimentalMaterial3Api @Composable internal fun VoteItems( - voteItems: List, + voteItems: ImmutableList, modifier: Modifier = Modifier, columnCount: Int = 2, horizontalArrangement: Arrangement.Horizontal = Arrangement.spacedBy(8.dp), diff --git a/openfeedback-ui-models/api/openfeedback-ui-models.api b/openfeedback-ui-models/api/openfeedback-ui-models.api index bac10d9..99279e8 100644 --- a/openfeedback-ui-models/api/openfeedback-ui-models.api +++ b/openfeedback-ui-models/api/openfeedback-ui-models.api @@ -1,18 +1,18 @@ public final class io/openfeedback/ui/models/UIComment { public static final field $stable I - public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/util/List;ZZ)V + public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlinx/collections/immutable/ImmutableList;ZZ)V public final fun component1 ()Ljava/lang/String; public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()I - public final fun component5 ()Ljava/util/List; + public final fun component5 ()Lkotlinx/collections/immutable/ImmutableList; public final fun component6 ()Z public final fun component7 ()Z - public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/util/List;ZZ)Lio/openfeedback/ui/models/UIComment; - public static synthetic fun copy$default (Lio/openfeedback/ui/models/UIComment;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/util/List;ZZILjava/lang/Object;)Lio/openfeedback/ui/models/UIComment; + public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlinx/collections/immutable/ImmutableList;ZZ)Lio/openfeedback/ui/models/UIComment; + public static synthetic fun copy$default (Lio/openfeedback/ui/models/UIComment;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlinx/collections/immutable/ImmutableList;ZZILjava/lang/Object;)Lio/openfeedback/ui/models/UIComment; public fun equals (Ljava/lang/Object;)Z public final fun getCreatedAt ()Ljava/lang/String; - public final fun getDots ()Ljava/util/List; + public final fun getDots ()Lkotlinx/collections/immutable/ImmutableList; public final fun getFromUser ()Z public final fun getId ()Ljava/lang/String; public final fun getMessage ()Ljava/lang/String; @@ -40,31 +40,31 @@ public final class io/openfeedback/ui/models/UIDot { public final class io/openfeedback/ui/models/UISessionFeedback { public static final field $stable I - public fun (Ljava/util/List;Ljava/util/List;Ljava/util/List;)V - public final fun component1 ()Ljava/util/List; - public final fun component2 ()Ljava/util/List; - public final fun component3 ()Ljava/util/List; - public final fun copy (Ljava/util/List;Ljava/util/List;Ljava/util/List;)Lio/openfeedback/ui/models/UISessionFeedback; - public static synthetic fun copy$default (Lio/openfeedback/ui/models/UISessionFeedback;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lio/openfeedback/ui/models/UISessionFeedback; + public fun (Lkotlinx/collections/immutable/ImmutableList;Lkotlinx/collections/immutable/ImmutableList;Lkotlinx/collections/immutable/ImmutableList;)V + public final fun component1 ()Lkotlinx/collections/immutable/ImmutableList; + public final fun component2 ()Lkotlinx/collections/immutable/ImmutableList; + public final fun component3 ()Lkotlinx/collections/immutable/ImmutableList; + public final fun copy (Lkotlinx/collections/immutable/ImmutableList;Lkotlinx/collections/immutable/ImmutableList;Lkotlinx/collections/immutable/ImmutableList;)Lio/openfeedback/ui/models/UISessionFeedback; + public static synthetic fun copy$default (Lio/openfeedback/ui/models/UISessionFeedback;Lkotlinx/collections/immutable/ImmutableList;Lkotlinx/collections/immutable/ImmutableList;Lkotlinx/collections/immutable/ImmutableList;ILjava/lang/Object;)Lio/openfeedback/ui/models/UISessionFeedback; public fun equals (Ljava/lang/Object;)Z - public final fun getColors ()Ljava/util/List; - public final fun getComments ()Ljava/util/List; - public final fun getVoteItems ()Ljava/util/List; + public final fun getColors ()Lkotlinx/collections/immutable/ImmutableList; + public final fun getComments ()Lkotlinx/collections/immutable/ImmutableList; + public final fun getVoteItems ()Lkotlinx/collections/immutable/ImmutableList; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class io/openfeedback/ui/models/UIVoteItem { public static final field $stable I - public fun (Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Z)V + public fun (Ljava/lang/String;Ljava/lang/String;Lkotlinx/collections/immutable/ImmutableList;Z)V public final fun component1 ()Ljava/lang/String; public final fun component2 ()Ljava/lang/String; - public final fun component3 ()Ljava/util/List; + public final fun component3 ()Lkotlinx/collections/immutable/ImmutableList; public final fun component4 ()Z - public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Z)Lio/openfeedback/ui/models/UIVoteItem; - public static synthetic fun copy$default (Lio/openfeedback/ui/models/UIVoteItem;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZILjava/lang/Object;)Lio/openfeedback/ui/models/UIVoteItem; + public final fun copy (Ljava/lang/String;Ljava/lang/String;Lkotlinx/collections/immutable/ImmutableList;Z)Lio/openfeedback/ui/models/UIVoteItem; + public static synthetic fun copy$default (Lio/openfeedback/ui/models/UIVoteItem;Ljava/lang/String;Ljava/lang/String;Lkotlinx/collections/immutable/ImmutableList;ZILjava/lang/Object;)Lio/openfeedback/ui/models/UIVoteItem; public fun equals (Ljava/lang/Object;)Z - public final fun getDots ()Ljava/util/List; + public final fun getDots ()Lkotlinx/collections/immutable/ImmutableList; public final fun getId ()Ljava/lang/String; public final fun getText ()Ljava/lang/String; public final fun getVotedByUser ()Z diff --git a/openfeedback-ui-models/api/openfeedback-ui-models.klib.api b/openfeedback-ui-models/api/openfeedback-ui-models.klib.api index 899fd32..6a3a277 100644 --- a/openfeedback-ui-models/api/openfeedback-ui-models.klib.api +++ b/openfeedback-ui-models/api/openfeedback-ui-models.klib.api @@ -7,12 +7,12 @@ // Library unique name: final class io.openfeedback.ui.models/UIComment { // io.openfeedback.ui.models/UIComment|null[0] - constructor (kotlin/String, kotlin/String, kotlin/String, kotlin/Int, kotlin.collections/List, kotlin/Boolean, kotlin/Boolean) // io.openfeedback.ui.models/UIComment.|(kotlin.String;kotlin.String;kotlin.String;kotlin.Int;kotlin.collections.List;kotlin.Boolean;kotlin.Boolean){}[0] + constructor (kotlin/String, kotlin/String, kotlin/String, kotlin/Int, kotlinx.collections.immutable/ImmutableList, kotlin/Boolean, kotlin/Boolean) // io.openfeedback.ui.models/UIComment.|(kotlin.String;kotlin.String;kotlin.String;kotlin.Int;kotlinx.collections.immutable.ImmutableList;kotlin.Boolean;kotlin.Boolean){}[0] final val createdAt // io.openfeedback.ui.models/UIComment.createdAt|{}createdAt[0] final fun (): kotlin/String // io.openfeedback.ui.models/UIComment.createdAt.|(){}[0] final val dots // io.openfeedback.ui.models/UIComment.dots|{}dots[0] - final fun (): kotlin.collections/List // io.openfeedback.ui.models/UIComment.dots.|(){}[0] + final fun (): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UIComment.dots.|(){}[0] final val fromUser // io.openfeedback.ui.models/UIComment.fromUser|{}fromUser[0] final fun (): kotlin/Boolean // io.openfeedback.ui.models/UIComment.fromUser.|(){}[0] final val id // io.openfeedback.ui.models/UIComment.id|{}id[0] @@ -28,10 +28,10 @@ final class io.openfeedback.ui.models/UIComment { // io.openfeedback.ui.models/U final fun component2(): kotlin/String // io.openfeedback.ui.models/UIComment.component2|component2(){}[0] final fun component3(): kotlin/String // io.openfeedback.ui.models/UIComment.component3|component3(){}[0] final fun component4(): kotlin/Int // io.openfeedback.ui.models/UIComment.component4|component4(){}[0] - final fun component5(): kotlin.collections/List // io.openfeedback.ui.models/UIComment.component5|component5(){}[0] + final fun component5(): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UIComment.component5|component5(){}[0] final fun component6(): kotlin/Boolean // io.openfeedback.ui.models/UIComment.component6|component6(){}[0] final fun component7(): kotlin/Boolean // io.openfeedback.ui.models/UIComment.component7|component7(){}[0] - final fun copy(kotlin/String = ..., kotlin/String = ..., kotlin/String = ..., kotlin/Int = ..., kotlin.collections/List = ..., kotlin/Boolean = ..., kotlin/Boolean = ...): io.openfeedback.ui.models/UIComment // io.openfeedback.ui.models/UIComment.copy|copy(kotlin.String;kotlin.String;kotlin.String;kotlin.Int;kotlin.collections.List;kotlin.Boolean;kotlin.Boolean){}[0] + final fun copy(kotlin/String = ..., kotlin/String = ..., kotlin/String = ..., kotlin/Int = ..., kotlinx.collections.immutable/ImmutableList = ..., kotlin/Boolean = ..., kotlin/Boolean = ...): io.openfeedback.ui.models/UIComment // io.openfeedback.ui.models/UIComment.copy|copy(kotlin.String;kotlin.String;kotlin.String;kotlin.Int;kotlinx.collections.immutable.ImmutableList;kotlin.Boolean;kotlin.Boolean){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // io.openfeedback.ui.models/UIComment.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // io.openfeedback.ui.models/UIComment.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // io.openfeedback.ui.models/UIComment.toString|toString(){}[0] @@ -57,29 +57,29 @@ final class io.openfeedback.ui.models/UIDot { // io.openfeedback.ui.models/UIDot } final class io.openfeedback.ui.models/UISessionFeedback { // io.openfeedback.ui.models/UISessionFeedback|null[0] - constructor (kotlin.collections/List, kotlin.collections/List, kotlin.collections/List) // io.openfeedback.ui.models/UISessionFeedback.|(kotlin.collections.List;kotlin.collections.List;kotlin.collections.List){}[0] + constructor (kotlinx.collections.immutable/ImmutableList, kotlinx.collections.immutable/ImmutableList, kotlinx.collections.immutable/ImmutableList) // io.openfeedback.ui.models/UISessionFeedback.|(kotlinx.collections.immutable.ImmutableList;kotlinx.collections.immutable.ImmutableList;kotlinx.collections.immutable.ImmutableList){}[0] final val colors // io.openfeedback.ui.models/UISessionFeedback.colors|{}colors[0] - final fun (): kotlin.collections/List // io.openfeedback.ui.models/UISessionFeedback.colors.|(){}[0] + final fun (): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UISessionFeedback.colors.|(){}[0] final val comments // io.openfeedback.ui.models/UISessionFeedback.comments|{}comments[0] - final fun (): kotlin.collections/List // io.openfeedback.ui.models/UISessionFeedback.comments.|(){}[0] + final fun (): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UISessionFeedback.comments.|(){}[0] final val voteItems // io.openfeedback.ui.models/UISessionFeedback.voteItems|{}voteItems[0] - final fun (): kotlin.collections/List // io.openfeedback.ui.models/UISessionFeedback.voteItems.|(){}[0] + final fun (): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UISessionFeedback.voteItems.|(){}[0] - final fun component1(): kotlin.collections/List // io.openfeedback.ui.models/UISessionFeedback.component1|component1(){}[0] - final fun component2(): kotlin.collections/List // io.openfeedback.ui.models/UISessionFeedback.component2|component2(){}[0] - final fun component3(): kotlin.collections/List // io.openfeedback.ui.models/UISessionFeedback.component3|component3(){}[0] - final fun copy(kotlin.collections/List = ..., kotlin.collections/List = ..., kotlin.collections/List = ...): io.openfeedback.ui.models/UISessionFeedback // io.openfeedback.ui.models/UISessionFeedback.copy|copy(kotlin.collections.List;kotlin.collections.List;kotlin.collections.List){}[0] + final fun component1(): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UISessionFeedback.component1|component1(){}[0] + final fun component2(): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UISessionFeedback.component2|component2(){}[0] + final fun component3(): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UISessionFeedback.component3|component3(){}[0] + final fun copy(kotlinx.collections.immutable/ImmutableList = ..., kotlinx.collections.immutable/ImmutableList = ..., kotlinx.collections.immutable/ImmutableList = ...): io.openfeedback.ui.models/UISessionFeedback // io.openfeedback.ui.models/UISessionFeedback.copy|copy(kotlinx.collections.immutable.ImmutableList;kotlinx.collections.immutable.ImmutableList;kotlinx.collections.immutable.ImmutableList){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // io.openfeedback.ui.models/UISessionFeedback.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // io.openfeedback.ui.models/UISessionFeedback.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // io.openfeedback.ui.models/UISessionFeedback.toString|toString(){}[0] } final class io.openfeedback.ui.models/UIVoteItem { // io.openfeedback.ui.models/UIVoteItem|null[0] - constructor (kotlin/String, kotlin/String, kotlin.collections/List, kotlin/Boolean) // io.openfeedback.ui.models/UIVoteItem.|(kotlin.String;kotlin.String;kotlin.collections.List;kotlin.Boolean){}[0] + constructor (kotlin/String, kotlin/String, kotlinx.collections.immutable/ImmutableList, kotlin/Boolean) // io.openfeedback.ui.models/UIVoteItem.|(kotlin.String;kotlin.String;kotlinx.collections.immutable.ImmutableList;kotlin.Boolean){}[0] final val dots // io.openfeedback.ui.models/UIVoteItem.dots|{}dots[0] - final fun (): kotlin.collections/List // io.openfeedback.ui.models/UIVoteItem.dots.|(){}[0] + final fun (): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UIVoteItem.dots.|(){}[0] final val id // io.openfeedback.ui.models/UIVoteItem.id|{}id[0] final fun (): kotlin/String // io.openfeedback.ui.models/UIVoteItem.id.|(){}[0] final val text // io.openfeedback.ui.models/UIVoteItem.text|{}text[0] @@ -89,9 +89,9 @@ final class io.openfeedback.ui.models/UIVoteItem { // io.openfeedback.ui.models/ final fun component1(): kotlin/String // io.openfeedback.ui.models/UIVoteItem.component1|component1(){}[0] final fun component2(): kotlin/String // io.openfeedback.ui.models/UIVoteItem.component2|component2(){}[0] - final fun component3(): kotlin.collections/List // io.openfeedback.ui.models/UIVoteItem.component3|component3(){}[0] + final fun component3(): kotlinx.collections.immutable/ImmutableList // io.openfeedback.ui.models/UIVoteItem.component3|component3(){}[0] final fun component4(): kotlin/Boolean // io.openfeedback.ui.models/UIVoteItem.component4|component4(){}[0] - final fun copy(kotlin/String = ..., kotlin/String = ..., kotlin.collections/List = ..., kotlin/Boolean = ...): io.openfeedback.ui.models/UIVoteItem // io.openfeedback.ui.models/UIVoteItem.copy|copy(kotlin.String;kotlin.String;kotlin.collections.List;kotlin.Boolean){}[0] + final fun copy(kotlin/String = ..., kotlin/String = ..., kotlinx.collections.immutable/ImmutableList = ..., kotlin/Boolean = ...): io.openfeedback.ui.models/UIVoteItem // io.openfeedback.ui.models/UIVoteItem.copy|copy(kotlin.String;kotlin.String;kotlinx.collections.immutable.ImmutableList;kotlin.Boolean){}[0] final fun equals(kotlin/Any?): kotlin/Boolean // io.openfeedback.ui.models/UIVoteItem.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // io.openfeedback.ui.models/UIVoteItem.hashCode|hashCode(){}[0] final fun toString(): kotlin/String // io.openfeedback.ui.models/UIVoteItem.toString|toString(){}[0] diff --git a/openfeedback-ui-models/build.gradle.kts b/openfeedback-ui-models/build.gradle.kts index aaf16ef..0a318b1 100644 --- a/openfeedback-ui-models/build.gradle.kts +++ b/openfeedback-ui-models/build.gradle.kts @@ -13,6 +13,7 @@ library( dependencies { implementation(kotlinMultiplatformExtension.compose.runtime) api(libs.vanniktech.multiplatform.locale) + api(libs.jetbrains.kotlinx.collections.immutable) } } } diff --git a/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIComment.kt b/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIComment.kt index eb83a40..1e6eb34 100644 --- a/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIComment.kt +++ b/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIComment.kt @@ -1,6 +1,7 @@ package io.openfeedback.ui.models import androidx.compose.runtime.Immutable +import kotlinx.collections.immutable.ImmutableList @Immutable data class UIComment( @@ -8,7 +9,7 @@ data class UIComment( val message: String, val createdAt: String, val upVotes: Int, - val dots: List, + val dots: ImmutableList, val votedByUser: Boolean, val fromUser: Boolean ) diff --git a/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UISessionFeedback.kt b/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UISessionFeedback.kt index e2de4be..57f02b5 100644 --- a/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UISessionFeedback.kt +++ b/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UISessionFeedback.kt @@ -1,10 +1,11 @@ package io.openfeedback.ui.models import androidx.compose.runtime.Immutable +import kotlinx.collections.immutable.ImmutableList @Immutable data class UISessionFeedback( - val comments: List, - val voteItems: List, - val colors: List, + val comments: ImmutableList, + val voteItems: ImmutableList, + val colors: ImmutableList, ) diff --git a/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIVoteItem.kt b/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIVoteItem.kt index b2688f7..293d986 100644 --- a/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIVoteItem.kt +++ b/openfeedback-ui-models/src/commonMain/kotlin/io/openfeedback/ui/models/UIVoteItem.kt @@ -1,11 +1,12 @@ package io.openfeedback.ui.models import androidx.compose.runtime.Immutable +import kotlinx.collections.immutable.ImmutableList @Immutable data class UIVoteItem( val id: String, val text: String, - val dots: List, + val dots: ImmutableList, val votedByUser: Boolean ) diff --git a/openfeedback-viewmodel/api/openfeedback-viewmodel.api b/openfeedback-viewmodel/api/openfeedback-viewmodel.api index 2b64b64..a7a0218 100644 --- a/openfeedback-viewmodel/api/openfeedback-viewmodel.api +++ b/openfeedback-viewmodel/api/openfeedback-viewmodel.api @@ -1,5 +1,5 @@ public final class io/openfeedback/OpenFeedbackKt { - public static final fun OpenFeedback (Ljava/lang/String;Ljava/lang/String;Landroidx/compose/ui/Modifier;ILcom/vanniktech/locale/Locale;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/openfeedback/viewmodels/OpenFeedbackViewModel;Landroidx/compose/runtime/Composer;II)V + public static final fun OpenFeedback (Ljava/lang/String;Ljava/lang/String;Landroidx/compose/ui/Modifier;ILjava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;Lio/openfeedback/viewmodels/OpenFeedbackViewModel;Landroidx/compose/runtime/Composer;II)V } public final class io/openfeedback/viewmodels/OpenFeedbackFirebaseConfig { @@ -56,7 +56,7 @@ public final class io/openfeedback/viewmodels/OpenFeedbackUiState$Success : io/o public final class io/openfeedback/viewmodels/OpenFeedbackViewModel : androidx/lifecycle/ViewModel { public static final field $stable I public static final field Companion Lio/openfeedback/viewmodels/OpenFeedbackViewModel$Companion; - public synthetic fun (Ldev/gitlive/firebase/FirebaseApp;Ljava/lang/String;Ljava/lang/String;Lcom/vanniktech/locale/Locale;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/gitlive/firebase/FirebaseApp;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun getUiState ()Lkotlinx/coroutines/flow/StateFlow; public final fun submitComment (Ljava/lang/String;)Lkotlinx/coroutines/Job; public final fun upVote (Lio/openfeedback/ui/models/UIComment;)Lkotlinx/coroutines/Job; @@ -64,6 +64,6 @@ public final class io/openfeedback/viewmodels/OpenFeedbackViewModel : androidx/l } public final class io/openfeedback/viewmodels/OpenFeedbackViewModel$Companion { - public final fun provideFactory (Ldev/gitlive/firebase/FirebaseApp;Ljava/lang/String;Ljava/lang/String;Lcom/vanniktech/locale/Locale;)Landroidx/lifecycle/ViewModelProvider$Factory; + public final fun provideFactory (Ldev/gitlive/firebase/FirebaseApp;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroidx/lifecycle/ViewModelProvider$Factory; } diff --git a/openfeedback-viewmodel/api/openfeedback-viewmodel.klib.api b/openfeedback-viewmodel/api/openfeedback-viewmodel.klib.api index 59e17a2..2bf9f26 100644 --- a/openfeedback-viewmodel/api/openfeedback-viewmodel.klib.api +++ b/openfeedback-viewmodel/api/openfeedback-viewmodel.klib.api @@ -47,7 +47,7 @@ final class io.openfeedback.viewmodels/OpenFeedbackViewModel : androidx.lifecycl final fun vote(io.openfeedback.ui.models/UIVoteItem): kotlinx.coroutines/Job // io.openfeedback.viewmodels/OpenFeedbackViewModel.vote|vote(io.openfeedback.ui.models.UIVoteItem){}[0] final object Companion { // io.openfeedback.viewmodels/OpenFeedbackViewModel.Companion|null[0] - final fun provideFactory(dev.gitlive.firebase/FirebaseApp, kotlin/String, kotlin/String, com.vanniktech.locale/Locale): androidx.lifecycle/ViewModelProvider.Factory // io.openfeedback.viewmodels/OpenFeedbackViewModel.Companion.provideFactory|provideFactory(dev.gitlive.firebase.FirebaseApp;kotlin.String;kotlin.String;com.vanniktech.locale.Locale){}[0] + final fun provideFactory(dev.gitlive.firebase/FirebaseApp, kotlin/String, kotlin/String, kotlin/String): androidx.lifecycle/ViewModelProvider.Factory // io.openfeedback.viewmodels/OpenFeedbackViewModel.Companion.provideFactory|provideFactory(dev.gitlive.firebase.FirebaseApp;kotlin.String;kotlin.String;kotlin.String){}[0] } } @@ -76,4 +76,4 @@ final val io.openfeedback.viewmodels/io_openfeedback_viewmodels_OpenFeedbackView final fun io.openfeedback.viewmodels/getFirebaseApp(kotlin/String?): dev.gitlive.firebase/FirebaseApp // io.openfeedback.viewmodels/getFirebaseApp|getFirebaseApp(kotlin.String?){}[0] final fun io.openfeedback.viewmodels/initializeOpenFeedback(io.openfeedback.viewmodels/OpenFeedbackFirebaseConfig) // io.openfeedback.viewmodels/initializeOpenFeedback|initializeOpenFeedback(io.openfeedback.viewmodels.OpenFeedbackFirebaseConfig){}[0] -final fun io.openfeedback/OpenFeedback(kotlin/String, kotlin/String, androidx.compose.ui/Modifier?, kotlin/Int, com.vanniktech.locale/Locale?, kotlin/String?, kotlin/Function2?, io.openfeedback.viewmodels/OpenFeedbackViewModel?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback/OpenFeedback|OpenFeedback(kotlin.String;kotlin.String;androidx.compose.ui.Modifier?;kotlin.Int;com.vanniktech.locale.Locale?;kotlin.String?;kotlin.Function2?;io.openfeedback.viewmodels.OpenFeedbackViewModel?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0] +final fun io.openfeedback/OpenFeedback(kotlin/String, kotlin/String, androidx.compose.ui/Modifier?, kotlin/Int, kotlin/String?, kotlin/String?, kotlin/Function2?, io.openfeedback.viewmodels/OpenFeedbackViewModel?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback/OpenFeedback|OpenFeedback(kotlin.String;kotlin.String;androidx.compose.ui.Modifier?;kotlin.Int;kotlin.String?;kotlin.String?;kotlin.Function2?;io.openfeedback.viewmodels.OpenFeedbackViewModel?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0] diff --git a/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/OpenFeedback.kt b/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/OpenFeedback.kt index 73bf6b5..918759c 100644 --- a/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/OpenFeedback.kt +++ b/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/OpenFeedback.kt @@ -31,7 +31,7 @@ import io.openfeedback.viewmodels.getFirebaseApp * @param sessionId Firestore session id * @param modifier The modifier to be applied to the component. * @param columnCount Number of column to display for vote items. - * @param locale Locale of the user. + * @param languageCode Language code of the user. * @param appName Locale openfeedback name, used to restore openfeedback configuration. * @param loading Component to display when the view model fetch vote items. * @param viewModel ViewModel instance to fetch UI models and interact with feedback form. @@ -43,7 +43,7 @@ fun OpenFeedback( sessionId: String, modifier: Modifier = Modifier, columnCount: Int = 2, - locale: Locale = Locale.from(Locales.currentLocaleString()), + languageCode: String = Locale.from(Locales.currentLocaleString()).language.code, appName: String? = null, loading: @Composable () -> Unit = { Loading(modifier = modifier) }, viewModel: OpenFeedbackViewModel = viewModel( @@ -52,7 +52,7 @@ fun OpenFeedback( firebaseApp = getFirebaseApp(appName), projectId = projectId, sessionId = sessionId, - locale = locale + languageCode = languageCode ) ) ) { diff --git a/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/OpenFeedbackViewModel.kt b/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/OpenFeedbackViewModel.kt index 75fb03c..2d42e93 100644 --- a/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/OpenFeedbackViewModel.kt +++ b/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/OpenFeedbackViewModel.kt @@ -4,7 +4,6 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewmodel.CreationExtras -import com.vanniktech.locale.Locale import dev.gitlive.firebase.FirebaseApp import io.openfeedback.OpenFeedbackRepository import io.openfeedback.model.SessionData @@ -27,7 +26,7 @@ class OpenFeedbackViewModel private constructor( firebaseApp: FirebaseApp, projectId: String, sessionId: String, - locale: Locale + languageCode: String ) : ViewModel() { private val repository = OpenFeedbackRepository(firebaseApp, projectId, sessionId) @@ -54,13 +53,13 @@ class OpenFeedbackViewModel private constructor( .mapWithPreviousValue { prev, cur -> if (prev == null) { cur.toUISessionFeedback( - locale = locale, + languageCode = languageCode, oldVoteItems = null, oldComments = null ) } else { cur.toUISessionFeedback( - locale = locale, + languageCode = languageCode, oldVoteItems = prev.voteItems, oldComments = prev.comments ) @@ -89,10 +88,10 @@ class OpenFeedbackViewModel private constructor( firebaseApp: FirebaseApp, projectId: String, sessionId: String, - locale: Locale + languageCode: String ): ViewModelProvider.Factory = object : ViewModelProvider.Factory { override fun create(modelClass: KClass, extras: CreationExtras): T = - OpenFeedbackViewModel(firebaseApp, projectId, sessionId, locale) as T + OpenFeedbackViewModel(firebaseApp, projectId, sessionId, languageCode) as T } } } diff --git a/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/mappers/SessionDataToUiModels.kt b/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/mappers/SessionDataToUiModels.kt index 0871654..64798d2 100644 --- a/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/mappers/SessionDataToUiModels.kt +++ b/openfeedback-viewmodel/src/commonMain/kotlin/io/openfeedback/viewmodels/mappers/SessionDataToUiModels.kt @@ -6,6 +6,7 @@ import io.openfeedback.ui.models.UIComment import io.openfeedback.ui.models.UIDot import io.openfeedback.ui.models.UISessionFeedback import io.openfeedback.ui.models.UIVoteItem +import kotlinx.collections.immutable.toImmutableList import kotlinx.datetime.LocalDateTime import kotlinx.datetime.TimeZone import kotlinx.datetime.format @@ -18,13 +19,13 @@ import kotlin.random.Random /** * Map [SessionData] instance to [UISessionFeedback], stable model for Compose UI. * - * @param locale User locale. + * @param languageCode User language code. * @param oldVoteItems Old version of vote items. * @param oldComments old version of comments. * @return [UISessionFeedback] model. */ internal fun SessionData.toUISessionFeedback( - locale: Locale, + languageCode: String, oldVoteItems: List?, oldComments: List?, ): UISessionFeedback { @@ -45,11 +46,12 @@ internal fun SessionData.toUISessionFeedback( } UIVoteItem( id = voteItem.id, - text = voteItem.localizedName(locale.language.code), - dots = dots, + text = voteItem.localizedName(languageCode), + dots = dots.toImmutableList(), votedByUser = votedItemIds.contains(voteItem.id) ) - }, + } + .toImmutableList(), comments = sessionData.comments.map { commentItem -> val localDateTime = commentItem.createdAt.toLocalDateTime(TimeZone.currentSystemDefault()) @@ -66,12 +68,12 @@ internal fun SessionData.toUISessionFeedback( message = commentItem.text, createdAt = localDateTime.format(dateFormat), upVotes = commentItem.plus.toInt(), - dots = dots, + dots = dots.toImmutableList(), votedByUser = sessionData.votedCommentIds.contains(commentItem.id), fromUser = commentItem.userId == sessionData.userId ) - }, - colors = sessionData.project.chipColors + }.toImmutableList(), + colors = sessionData.project.chipColors.toImmutableList() ) } diff --git a/sample-app-shared/api/sample-app-shared.klib.api b/sample-app-shared/api/sample-app-shared.klib.api index c9e1efc..1fed5cb 100644 --- a/sample-app-shared/api/sample-app-shared.klib.api +++ b/sample-app-shared/api/sample-app-shared.klib.api @@ -5,7 +5,7 @@ // - Show manifest properties: true // - Show declarations: true -// Library unique name: +// Library unique name: final fun /OpenFeedbackTheme(kotlin/Boolean, kotlin/Function2, androidx.compose.runtime/Composer?, kotlin/Int) // /OpenFeedbackTheme|OpenFeedbackTheme(kotlin.Boolean;kotlin.Function2;androidx.compose.runtime.Composer?;kotlin.Int){}[0] final fun /SampleApp(kotlin/Boolean, kotlin/Any?, androidx.compose.runtime/Composer?, kotlin/Int) // /SampleApp|SampleApp(kotlin.Boolean;kotlin.Any?;androidx.compose.runtime.Composer?;kotlin.Int){}[0] final fun /ThemeSwitcher(kotlin/Boolean, kotlin/Function1, androidx.compose.runtime/Composer?, kotlin/Int) // /ThemeSwitcher|ThemeSwitcher(kotlin.Boolean;kotlin.Function1;androidx.compose.runtime.Composer?;kotlin.Int){}[0]