diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index f78415cb..1a5ebae3 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -14,8 +14,8 @@ on:
jobs:
build:
- runs-on: ubuntu-latest
- timeout-minutes: 30
+ runs-on: macos-latest
+ timeout-minutes: 60
steps:
- uses: actions/checkout@v4
@@ -46,8 +46,14 @@ jobs:
- name: Check lint
run: ./gradlew lintDebug --stacktrace
- - name: Build all build type and flavor permutations
- run: ./gradlew assemble --stacktrace
+ - name: Build android app
+ run: ./gradlew :sample:android:assemble
+
+ - name: Build desktop app
+ run: ./gradlew :sample:desktop:assemble
+
+ - name: Build iOS app
+ run: xcodebuild -project sample/iosApp/iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest'
- name: Clean secrets
if: always()
@@ -56,7 +62,7 @@ jobs:
test:
needs: build
runs-on: ubuntu-latest
- timeout-minutes: 30
+ timeout-minutes: 70
strategy:
matrix:
diff --git a/.gitignore b/.gitignore
index 0a4ede3b..622c40c1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,6 +50,7 @@ captures/
.idea/navEditor.xml
# User-specific configurations
+.idea/artifacts/
.idea/caches/
.idea/libraries/
.idea/shelf/
@@ -104,3 +105,5 @@ lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
+
+.kotlin/
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 691f78ba..0d9aecad 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -69,11 +69,6 @@
-
-
-
diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts
index 04b0a1ef..1e832b93 100644
--- a/build-logic/convention/build.gradle.kts
+++ b/build-logic/convention/build.gradle.kts
@@ -12,6 +12,8 @@ java {
dependencies {
implementation(libs.android.pluginGradle)
implementation(libs.kotlin.pluginGradle)
+ implementation(libs.compose.compiler.pluginGradle)
+ implementation(libs.metalava.pluginGradle)
}
gradlePlugin {
@@ -24,9 +26,21 @@ gradlePlugin {
id = "mmc.android.library"
implementationClass = "AndroidLibraryConventionPlugin"
}
- register("androidCompose") {
- id = "mmc.android.compose"
- implementationClass = "AndroidComposeConventionPlugin"
+ register("kotlinAndroid") {
+ id = "mmc.kotlin.android"
+ implementationClass = "KotlinAndroidConventionPlugin"
+ }
+ register("kotlinMultiplatform") {
+ id = "mmc.kotlin.multiplatform"
+ implementationClass = "KotlinMultiplatformConventionPlugin"
+ }
+ register("compose") {
+ id = "mmc.compose"
+ implementationClass = "ComposeMultiplatformConventionPlugin"
+ }
+ register("metalava") {
+ id = "mmc.metalava"
+ implementationClass = "MetalavaConventionPlugin"
}
}
}
diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
index e7021f83..db9deb9b 100644
--- a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
@@ -8,10 +8,8 @@ class AndroidApplicationConventionPlugin : Plugin {
with(target) {
with(pluginManager) {
apply("com.android.application")
- apply("org.jetbrains.kotlin.android")
}
configureAndroid()
- configureKotlin()
}
}
}
diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
index 3ece4dcb..11ce593f 100644
--- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
@@ -8,10 +8,8 @@ class AndroidLibraryConventionPlugin : Plugin {
with(target) {
with(pluginManager) {
apply("com.android.library")
- apply("org.jetbrains.kotlin.android")
}
configureAndroid()
- configureKotlin()
}
}
}
diff --git a/build-logic/convention/src/main/kotlin/AndroidComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/ComposeMultiplatformConventionPlugin.kt
similarity index 79%
rename from build-logic/convention/src/main/kotlin/AndroidComposeConventionPlugin.kt
rename to build-logic/convention/src/main/kotlin/ComposeMultiplatformConventionPlugin.kt
index faf74f22..05074af2 100644
--- a/build-logic/convention/src/main/kotlin/AndroidComposeConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/ComposeMultiplatformConventionPlugin.kt
@@ -2,7 +2,7 @@ import soup.compose.material.motion.buildlogic.configureCompose
import org.gradle.api.Plugin
import org.gradle.api.Project
-class AndroidComposeConventionPlugin : Plugin {
+class ComposeMultiplatformConventionPlugin : Plugin {
override fun apply(target: Project) {
with(target) {
configureCompose()
diff --git a/build-logic/convention/src/main/kotlin/KotlinAndroidConventionPlugin.kt b/build-logic/convention/src/main/kotlin/KotlinAndroidConventionPlugin.kt
new file mode 100644
index 00000000..9388523f
--- /dev/null
+++ b/build-logic/convention/src/main/kotlin/KotlinAndroidConventionPlugin.kt
@@ -0,0 +1,15 @@
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import soup.compose.material.motion.buildlogic.configureKotlin
+
+class KotlinAndroidConventionPlugin: Plugin {
+ override fun apply(target: Project) {
+ with(target) {
+ with(pluginManager) {
+ apply("org.jetbrains.kotlin.android")
+ }
+
+ configureKotlin()
+ }
+ }
+}
diff --git a/build-logic/convention/src/main/kotlin/KotlinMultiplatformConventionPlugin.kt b/build-logic/convention/src/main/kotlin/KotlinMultiplatformConventionPlugin.kt
new file mode 100644
index 00000000..488eb2ad
--- /dev/null
+++ b/build-logic/convention/src/main/kotlin/KotlinMultiplatformConventionPlugin.kt
@@ -0,0 +1,42 @@
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.kotlin.dsl.configure
+import org.gradle.kotlin.dsl.getByType
+import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
+import soup.compose.material.motion.buildlogic.configureKotlin
+
+class KotlinMultiplatformConventionPlugin : Plugin {
+ override fun apply(target: Project) {
+ with(target) {
+ pluginManager.apply("org.jetbrains.kotlin.multiplatform")
+
+ kotlin {
+ applyDefaultHierarchyTemplate()
+
+ if (pluginManager.hasPlugin("com.android.library")) {
+ androidTarget {
+ publishLibraryVariants("release")
+ }
+ }
+
+ jvm()
+
+ iosX64()
+ iosArm64()
+ iosSimulatorArm64()
+
+ macosX64()
+ macosArm64()
+
+ configureKotlin()
+ }
+ }
+ }
+}
+
+internal fun Project.kotlin(action: KotlinMultiplatformExtension.() -> Unit) {
+ extensions.configure(action)
+}
+
+internal val Project.kotlin: KotlinMultiplatformExtension
+ get() = extensions.getByType()
diff --git a/build-logic/convention/src/main/kotlin/MetalavaConventionPlugin.kt b/build-logic/convention/src/main/kotlin/MetalavaConventionPlugin.kt
new file mode 100644
index 00000000..c8d6135a
--- /dev/null
+++ b/build-logic/convention/src/main/kotlin/MetalavaConventionPlugin.kt
@@ -0,0 +1,24 @@
+import me.tylerbwong.gradle.metalava.extension.MetalavaExtension
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.kotlin.dsl.configure
+
+class MetalavaConventionPlugin : Plugin {
+ override fun apply(target: Project) = with(target) {
+ with(pluginManager) {
+ apply("me.tylerbwong.gradle.metalava")
+ }
+
+ metalava {
+ filename.set("api/current.api")
+ sourcePaths.setFrom(
+ target.kotlin.sourceSets
+ .filterNot { it.name.contains("test", ignoreCase = true) }
+ .flatMap { it.kotlin.sourceDirectories },
+ )
+ }
+ }
+}
+
+private fun Project.metalava(action: MetalavaExtension.() -> Unit) =
+ extensions.configure(action)
diff --git a/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Android.kt b/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Android.kt
index 1a89fbf5..84f898c8 100644
--- a/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Android.kt
+++ b/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Android.kt
@@ -17,8 +17,8 @@ fun Project.configureAndroid() {
}
compileOptions {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
}
}
}
diff --git a/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Compose.kt b/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Compose.kt
index 052ec873..07fce4b2 100644
--- a/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Compose.kt
+++ b/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Compose.kt
@@ -1,23 +1,15 @@
package soup.compose.material.motion.buildlogic
-import com.android.build.gradle.BaseExtension
import org.gradle.api.Project
-import org.gradle.api.artifacts.VersionCatalogsExtension
+import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.configure
-import org.gradle.kotlin.dsl.getByType
+import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
fun Project.configureCompose() {
- val libs = extensions.getByType().named("libs")
- android {
- buildFeatures.compose = true
+ pluginManager.apply("org.jetbrains.compose")
+ pluginManager.apply("org.jetbrains.kotlin.plugin.compose")
- composeOptions {
- kotlinCompilerExtensionVersion =
- libs.findVersion("compose-compiler").get().toString()
- }
+ extensions.configure {
+ enableStrongSkippingMode = false
}
}
-
-private fun Project.android(action: BaseExtension.() -> Unit) {
- extensions.configure(action)
-}
diff --git a/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Kotlin.kt b/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Kotlin.kt
index ae5ade8e..5dc9451d 100644
--- a/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Kotlin.kt
+++ b/build-logic/convention/src/main/kotlin/soup/compose/material/motion/buildlogic/Kotlin.kt
@@ -1,16 +1,19 @@
package soup.compose.material.motion.buildlogic
-import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+import org.jetbrains.kotlin.gradle.dsl.JvmTarget
+import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
fun Project.configureKotlin() {
- tasks.withType().configureEach {
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_1_8.toString()
+ tasks.withType>().configureEach {
+ compilerOptions {
+ if (this is KotlinJvmCompilerOptions) {
+ jvmTarget.set(JvmTarget.JVM_11)
+ }
- freeCompilerArgs = freeCompilerArgs + listOf(
+ freeCompilerArgs.addAll(
"-opt-in=kotlin.RequiresOptIn",
)
}
diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts
index 8d885091..ecbfa56f 100644
--- a/build-logic/settings.gradle.kts
+++ b/build-logic/settings.gradle.kts
@@ -2,6 +2,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
+ gradlePluginPortal()
}
versionCatalogs {
create("libs") {
diff --git a/build.gradle b/build.gradle
index 35008cb8..58dbae4b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,8 +1,10 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
- alias(libs.plugins.kotlin.android) apply false
- alias(libs.plugins.kotlin.serialization) apply false
+ alias(libs.plugins.kotlin.jvm) apply false
+ alias(libs.plugins.kotlin.multiplatform) apply false
+ alias(libs.plugins.jetbrains.compose) apply false
+ alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.metalava) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.jetbrains.dokka)
diff --git a/core/api/current.api b/core/api/current.api
index a782b98d..d829db96 100644
--- a/core/api/current.api
+++ b/core/api/current.api
@@ -10,18 +10,18 @@ package soup.compose.material.motion {
}
public final class MaterialFadeThroughKt {
- method @androidx.compose.runtime.Composable public static void MaterialFadeThrough(T? targetState, optional androidx.compose.ui.Modifier modifier, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void MaterialFadeThrough(T targetState, optional androidx.compose.ui.Modifier modifier, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
}
public final class MaterialMotionKt {
- method @androidx.compose.runtime.Composable public static void MaterialMotion(S? targetState, kotlin.jvm.functions.Function1 super androidx.compose.animation.AnimatedContentTransitionScope,androidx.compose.animation.ContentTransform> transitionSpec, optional androidx.compose.ui.Modifier modifier, optional boolean pop, optional androidx.compose.ui.Alignment contentAlignment, optional String label, optional kotlin.jvm.functions.Function1 super S,?> contentKey, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super S,kotlin.Unit> content);
method @androidx.compose.runtime.Composable public static void MaterialMotion(androidx.compose.animation.core.Transition, kotlin.jvm.functions.Function1 super androidx.compose.animation.AnimatedContentTransitionScope,androidx.compose.animation.ContentTransform> transitionSpec, optional androidx.compose.ui.Modifier modifier, optional boolean pop, optional androidx.compose.ui.Alignment contentAlignment, optional kotlin.jvm.functions.Function1 super S,?> contentKey, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super S,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void MaterialMotion(S targetState, kotlin.jvm.functions.Function1 super androidx.compose.animation.AnimatedContentTransitionScope,androidx.compose.animation.ContentTransform> transitionSpec, optional androidx.compose.ui.Modifier modifier, optional boolean pop, optional androidx.compose.ui.Alignment contentAlignment, optional String label, optional kotlin.jvm.functions.Function1 super S,?> contentKey, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super S,kotlin.Unit> content);
}
public final class MaterialSharedAxisKt {
- method @androidx.compose.runtime.Composable public static void MaterialSharedAxisX(T? targetState, boolean forward, optional androidx.compose.ui.Modifier modifier, optional float slideDistance, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
- method @androidx.compose.runtime.Composable public static void MaterialSharedAxisY(T? targetState, boolean forward, optional androidx.compose.ui.Modifier modifier, optional float slideDistance, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
- method @androidx.compose.runtime.Composable public static void MaterialSharedAxisZ(T? targetState, boolean forward, optional androidx.compose.ui.Modifier modifier, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void MaterialSharedAxisX(T targetState, boolean forward, optional androidx.compose.ui.Modifier modifier, optional float slideDistance, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void MaterialSharedAxisY(T targetState, boolean forward, optional androidx.compose.ui.Modifier modifier, optional float slideDistance, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void MaterialSharedAxisZ(T targetState, boolean forward, optional androidx.compose.ui.Modifier modifier, optional String label, kotlin.jvm.functions.Function2 super androidx.compose.animation.AnimatedVisibilityScope,? super T,kotlin.Unit> content);
}
public final class MotionConstants {
diff --git a/core/build.gradle b/core/build.gradle
index f118c66a..7674c320 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -1,54 +1,32 @@
plugins {
id("mmc.android.library")
- id("mmc.android.compose")
+ id("mmc.kotlin.multiplatform")
+ id("mmc.compose")
+ id("mmc.metalava")
alias(libs.plugins.maven.publish)
alias(libs.plugins.jetbrains.dokka)
- alias(libs.plugins.metalava)
}
-android {
- namespace 'soup.compose.material.motion'
- kotlinOptions {
- freeCompilerArgs += '-Xexplicit-api=warning'
- }
- lint {
- textReport true
- textOutput file('stdout')
- checkReleaseBuilds false
- }
- testOptions {
- unitTests {
- includeAndroidResources = true
+kotlin {
+ explicitApi()
+ sourceSets {
+ commonMain.dependencies {
+ implementation(compose.animation)
+ implementation(compose.ui)
+ implementation(libs.androidx.annotation)
}
- }
- packagingOptions {
- resources {
- excludes += ['/META-INF/AL2.0', '/META-INF/LGPL2.1']
+ androidInstrumentedTest.dependencies {
+ implementation(libs.androidx.test.core)
+ implementation(libs.androidx.test.rules)
+ implementation(libs.androidx.test.runner)
+ implementation(libs.compose.foundation)
+ implementation(libs.compose.ui.testJunit4)
+ implementation(libs.compose.ui.testManifest)
+ implementation(libs.androidx.tracing)
}
}
}
-metalava {
- sourcePaths.setFrom("src/main")
- filename.set("api/current.api")
- reportLintsAsErrors.set(true)
-}
-
-dependencies {
- implementation libs.kotlin.stdlib
- implementation libs.compose.animation
- implementation libs.compose.runtime
- implementation libs.compose.ui.ui
-
- // ======================
- // Test dependencies
- // ======================
-
- androidTestImplementation libs.androidx.test.core
- androidTestImplementation libs.androidx.test.rules
- androidTestImplementation libs.androidx.test.runner
- androidTestImplementation libs.compose.foundation
- androidTestImplementation libs.compose.ui.testJunit4
- debugImplementation libs.compose.ui.testManifest
- debugImplementation libs.androidx.tracing
+android {
+ namespace 'soup.compose.material.motion'
}
diff --git a/core/src/androidTest/java/soup/compose/material/motion/HoldTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/HoldTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/HoldTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/HoldTest.kt
diff --git a/core/src/androidTest/java/soup/compose/material/motion/MaterialElevationScaleTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialElevationScaleTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/MaterialElevationScaleTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialElevationScaleTest.kt
diff --git a/core/src/androidTest/java/soup/compose/material/motion/MaterialFadeTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialFadeTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/MaterialFadeTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialFadeTest.kt
diff --git a/core/src/androidTest/java/soup/compose/material/motion/MaterialFadeThroughTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialFadeThroughTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/MaterialFadeThroughTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialFadeThroughTest.kt
diff --git a/core/src/androidTest/java/soup/compose/material/motion/MaterialMotionTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialMotionTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/MaterialMotionTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialMotionTest.kt
diff --git a/core/src/androidTest/java/soup/compose/material/motion/MaterialSharedAxisXTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialSharedAxisXTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/MaterialSharedAxisXTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialSharedAxisXTest.kt
diff --git a/core/src/androidTest/java/soup/compose/material/motion/MaterialSharedAxisYTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialSharedAxisYTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/MaterialSharedAxisYTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialSharedAxisYTest.kt
diff --git a/core/src/androidTest/java/soup/compose/material/motion/MaterialSharedAxisZTest.kt b/core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialSharedAxisZTest.kt
similarity index 100%
rename from core/src/androidTest/java/soup/compose/material/motion/MaterialSharedAxisZTest.kt
rename to core/src/androidInstrumentedTest/kotlin/soup/compose/material/motion/MaterialSharedAxisZTest.kt
diff --git a/core/src/main/java/soup/compose/material/motion/CircularReveal.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/CircularReveal.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/CircularReveal.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/CircularReveal.kt
diff --git a/core/src/main/java/soup/compose/material/motion/MaterialFade.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/MaterialFade.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/MaterialFade.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/MaterialFade.kt
diff --git a/core/src/main/java/soup/compose/material/motion/MaterialFadeThrough.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/MaterialFadeThrough.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/MaterialFadeThrough.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/MaterialFadeThrough.kt
diff --git a/core/src/main/java/soup/compose/material/motion/MaterialMotion.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/MaterialMotion.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/MaterialMotion.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/MaterialMotion.kt
diff --git a/core/src/main/java/soup/compose/material/motion/MaterialSharedAxis.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/MaterialSharedAxis.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/MaterialSharedAxis.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/MaterialSharedAxis.kt
diff --git a/core/src/main/java/soup/compose/material/motion/MotionConstants.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/MotionConstants.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/MotionConstants.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/MotionConstants.kt
diff --git a/core/src/main/java/soup/compose/material/motion/animation/Hold.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/animation/Hold.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/animation/Hold.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/animation/Hold.kt
diff --git a/core/src/main/java/soup/compose/material/motion/animation/MaterialElevationScale.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialElevationScale.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/animation/MaterialElevationScale.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialElevationScale.kt
diff --git a/core/src/main/java/soup/compose/material/motion/animation/MaterialFade.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialFade.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/animation/MaterialFade.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialFade.kt
diff --git a/core/src/main/java/soup/compose/material/motion/animation/MaterialFadeThrough.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialFadeThrough.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/animation/MaterialFadeThrough.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialFadeThrough.kt
diff --git a/core/src/main/java/soup/compose/material/motion/animation/MaterialSharedAxis.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialSharedAxis.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/animation/MaterialSharedAxis.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/animation/MaterialSharedAxis.kt
diff --git a/core/src/main/java/soup/compose/material/motion/animation/Translate.kt b/core/src/commonMain/kotlin/soup/compose/material/motion/animation/Translate.kt
similarity index 100%
rename from core/src/main/java/soup/compose/material/motion/animation/Translate.kt
rename to core/src/commonMain/kotlin/soup/compose/material/motion/animation/Translate.kt
diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml
deleted file mode 100644
index 8072ee00..00000000
--- a/core/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/gradle.properties b/gradle.properties
index d4c49ce9..b3676353 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -18,6 +18,13 @@ android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
+# MPP
+kotlin.mpp.androidSourceSetLayoutVersion=2
+kotlin.mpp.enableCInteropCommonization=true
+
+org.jetbrains.compose.experimental.macos.enabled=true
+
+# Publish
SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 56dd8b83..ab2a53f8 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,34 +2,30 @@
agp = "8.4.1"
mavenPublish = "0.25.2"
-metalava = "0.3.3"
+metalava = "0.3.5"
# Kotlin
-kotlin = "1.9.0"
-serialization = "1.6.3"
+kotlin = "2.0.0"
dokka = "1.8.10"
# Compose
-activity = "1.9.0"
-navigation = "2.8.0-beta02"
compose = "1.7.0-beta02"
-compose-compiler = "1.5.2"
+compose-plugin = "1.6.10"
+navigation = "2.7.0-alpha07"
# AndroidX
-
-tracing = "1.1.0"
+androidx-annotation = "1.7.0"
+androidx-activity = "1.9.0"
+androidx-tracing = "1.1.0"
[libraries]
# Kotlin
-kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
-kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
+kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
# Compose
-compose-activity = { module = "androidx.activity:activity-compose", version.ref = "activity" }
-compose-navigation = { module = "androidx.navigation:navigation-compose", version.ref = "navigation" }
compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
compose-ui-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
@@ -40,9 +36,13 @@ compose-material = { module = "androidx.compose.material:material", version.ref
compose-materialIconsExtended = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" }
compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose" }
+jetbrains-navigation-compose = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "navigation" }
+
# AndroidX
-androidx-tracing = { module = "androidx.tracing:tracing", version.ref = "tracing" }
+androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
+androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" }
+androidx-tracing = { module = "androidx.tracing:tracing", version.ref = "androidx-tracing" }
# Test
@@ -53,12 +53,16 @@ androidx-test-runner = "androidx.test:runner:1.5.2"
# Dependencies of the included build-logic
android-pluginGradle = { module = "com.android.tools.build:gradle", version.ref = "agp" }
kotlin-pluginGradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
+compose-compiler-pluginGradle = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }
+metalava-pluginGradle = { module = "me.tylerbwong.gradle.metalava:plugin", version.ref = "metalava" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
-kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
+kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
+kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
+jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
+compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
metalava = { id = "me.tylerbwong.gradle.metalava", version.ref = "metalava" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
diff --git a/sample/android/build.gradle b/sample/android/build.gradle
index 1530df42..8fa05e11 100644
--- a/sample/android/build.gradle
+++ b/sample/android/build.gradle
@@ -1,7 +1,7 @@
plugins {
id("mmc.android.application")
- id("mmc.android.compose")
- alias(libs.plugins.kotlin.serialization)
+ id("mmc.kotlin.android")
+ id("mmc.compose")
}
android {
@@ -39,13 +39,6 @@ android {
dependencies {
implementation projects.core
-
- implementation libs.compose.ui.ui
- implementation libs.compose.ui.tooling
- implementation libs.compose.material
- implementation libs.compose.materialIconsExtended
- implementation libs.compose.activity
- implementation libs.compose.navigation
-
- implementation libs.kotlinx.serialization.json
+ implementation projects.sample.shared
+ implementation libs.androidx.activity.compose
}
diff --git a/sample/android/proguard-rules.pro b/sample/android/proguard-rules.pro
deleted file mode 100644
index 481bb434..00000000
--- a/sample/android/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/MainActivity.kt b/sample/android/src/main/kotlin/soup/compose/material/motion/sample/MainActivity.kt
similarity index 83%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/MainActivity.kt
rename to sample/android/src/main/kotlin/soup/compose/material/motion/sample/MainActivity.kt
index 9e9891fd..554fdd7c 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/MainActivity.kt
+++ b/sample/android/src/main/kotlin/soup/compose/material/motion/sample/MainActivity.kt
@@ -18,16 +18,13 @@ package soup.compose.material.motion.sample
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
-import soup.compose.material.motion.sample.ui.NavGraph
-import soup.compose.material.motion.sample.ui.theme.SampleTheme
+import soup.compose.material.motion.shared.App
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
- SampleTheme {
- NavGraph()
- }
+ App()
}
}
}
diff --git a/sample/desktop/build.gradle.kts b/sample/desktop/build.gradle.kts
new file mode 100644
index 00000000..69d9705a
--- /dev/null
+++ b/sample/desktop/build.gradle.kts
@@ -0,0 +1,21 @@
+plugins {
+ id("mmc.kotlin.multiplatform")
+ id("mmc.compose")
+}
+
+kotlin {
+ sourceSets {
+ val jvmMain by getting {
+ dependencies {
+ implementation(projects.sample.shared)
+ implementation(compose.desktop.currentOs)
+ }
+ }
+ }
+}
+
+compose.desktop {
+ application {
+ mainClass = "soup.compose.material.motion.sample.MainKt"
+ }
+}
diff --git a/sample/desktop/src/jvmMain/kotlin/soup/compose/material/motion/sample/Main.kt b/sample/desktop/src/jvmMain/kotlin/soup/compose/material/motion/sample/Main.kt
new file mode 100644
index 00000000..f1ab37ad
--- /dev/null
+++ b/sample/desktop/src/jvmMain/kotlin/soup/compose/material/motion/sample/Main.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2024 SOUP
+ *
+ * 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
+ *
+ * https://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 soup.compose.material.motion.sample
+
+import androidx.compose.ui.window.Window
+import androidx.compose.ui.window.application
+import soup.compose.material.motion.shared.App
+
+fun main() = application {
+ Window(
+ onCloseRequest = ::exitApplication,
+ title = "Sample",
+ ) {
+ App()
+ }
+}
diff --git a/sample/iosApp/Configuration/Config.xcconfig b/sample/iosApp/Configuration/Config.xcconfig
new file mode 100644
index 00000000..f594ca93
--- /dev/null
+++ b/sample/iosApp/Configuration/Config.xcconfig
@@ -0,0 +1,3 @@
+TEAM_ID=
+BUNDLE_ID=soup.compose.material.motion.sample.Sample
+APP_NAME=Sample
\ No newline at end of file
diff --git a/sample/iosApp/iosApp.xcodeproj/project.pbxproj b/sample/iosApp/iosApp.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..7f055915
--- /dev/null
+++ b/sample/iosApp/iosApp.xcodeproj/project.pbxproj
@@ -0,0 +1,403 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 56;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
+ 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
+ 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; };
+ 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
+ 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; };
+ 7555FF7B242A565900829871 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
+ 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ B92378962B6B1156000C7307 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 058557D7273AAEEB004C7B11 /* Preview Content */ = {
+ isa = PBXGroup;
+ children = (
+ 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */,
+ );
+ path = "Preview Content";
+ sourceTree = "";
+ };
+ 42799AB246E5F90AF97AA0EF /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ 7555FF72242A565900829871 = {
+ isa = PBXGroup;
+ children = (
+ AB1DB47929225F7C00F7AF9C /* Configuration */,
+ 7555FF7D242A565900829871 /* iosApp */,
+ 7555FF7C242A565900829871 /* Products */,
+ 42799AB246E5F90AF97AA0EF /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 7555FF7C242A565900829871 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 7555FF7B242A565900829871 /* Sample.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 7555FF7D242A565900829871 /* iosApp */ = {
+ isa = PBXGroup;
+ children = (
+ 058557BA273AAA24004C7B11 /* Assets.xcassets */,
+ 7555FF82242A565900829871 /* ContentView.swift */,
+ 7555FF8C242A565B00829871 /* Info.plist */,
+ 2152FB032600AC8F00CF470E /* iOSApp.swift */,
+ 058557D7273AAEEB004C7B11 /* Preview Content */,
+ );
+ path = iosApp;
+ sourceTree = "";
+ };
+ AB1DB47929225F7C00F7AF9C /* Configuration */ = {
+ isa = PBXGroup;
+ children = (
+ AB3632DC29227652001CCB65 /* Config.xcconfig */,
+ );
+ path = Configuration;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 7555FF7A242A565900829871 /* iosApp */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */;
+ buildPhases = (
+ F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */,
+ 7555FF77242A565900829871 /* Sources */,
+ B92378962B6B1156000C7307 /* Frameworks */,
+ 7555FF79242A565900829871 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = iosApp;
+ packageProductDependencies = (
+ );
+ productName = iosApp;
+ productReference = 7555FF7B242A565900829871 /* Sample.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 7555FF73242A565900829871 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastSwiftUpdateCheck = 1130;
+ LastUpgradeCheck = 1540;
+ ORGANIZATIONNAME = orgName;
+ TargetAttributes = {
+ 7555FF7A242A565900829871 = {
+ CreatedOnToolsVersion = 11.3.1;
+ };
+ };
+ };
+ buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */;
+ compatibilityVersion = "Xcode 14.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 7555FF72242A565900829871;
+ packageReferences = (
+ );
+ productRefGroup = 7555FF7C242A565900829871 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 7555FF7A242A565900829871 /* iosApp */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 7555FF79242A565900829871 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */,
+ 058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ F36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "Compile Kotlin Framework";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/../..\"\n./gradlew :sample:shared:embedAndSignAppleFrameworkForXcode\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 7555FF77242A565900829871 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */,
+ 7555FF83242A565900829871 /* ContentView.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 7555FFA3242A565B00829871 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.3;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ };
+ name = Debug;
+ };
+ 7555FFA4242A565B00829871 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.3;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 7555FFA6242A565B00829871 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
+ DEVELOPMENT_TEAM = "${TEAM_ID}";
+ ENABLE_PREVIEWS = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
+ );
+ INFOPLIST_FILE = iosApp/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.3;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-framework",
+ Shared,
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
+ PRODUCT_NAME = "${APP_NAME}";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 7555FFA7242A565B00829871 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
+ DEVELOPMENT_TEAM = "${TEAM_ID}";
+ ENABLE_PREVIEWS = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
+ );
+ INFOPLIST_FILE = iosApp/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.3;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-framework",
+ Shared,
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
+ PRODUCT_NAME = "${APP_NAME}";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7555FFA3242A565B00829871 /* Debug */,
+ 7555FFA4242A565B00829871 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7555FFA6242A565B00829871 /* Debug */,
+ 7555FFA7242A565B00829871 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 7555FF73242A565900829871 /* Project object */;
+}
\ No newline at end of file
diff --git a/sample/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/sample/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json
new file mode 100644
index 00000000..ee7e3ca0
--- /dev/null
+++ b/sample/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json
@@ -0,0 +1,11 @@
+{
+ "colors" : [
+ {
+ "idiom" : "universal"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
\ No newline at end of file
diff --git a/sample/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/sample/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 00000000..8edf56e7
--- /dev/null
+++ b/sample/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,14 @@
+{
+ "images" : [
+ {
+ "filename" : "app-icon-1024.png",
+ "idiom" : "universal",
+ "platform" : "ios",
+ "size" : "1024x1024"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/sample/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png b/sample/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png
new file mode 100644
index 00000000..53fc536f
Binary files /dev/null and b/sample/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png differ
diff --git a/sample/iosApp/iosApp/Assets.xcassets/Contents.json b/sample/iosApp/iosApp/Assets.xcassets/Contents.json
new file mode 100644
index 00000000..4aa7c535
--- /dev/null
+++ b/sample/iosApp/iosApp/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
\ No newline at end of file
diff --git a/sample/iosApp/iosApp/ContentView.swift b/sample/iosApp/iosApp/ContentView.swift
new file mode 100644
index 00000000..81bf76ff
--- /dev/null
+++ b/sample/iosApp/iosApp/ContentView.swift
@@ -0,0 +1,21 @@
+import UIKit
+import SwiftUI
+import Shared
+
+struct ComposeView: UIViewControllerRepresentable {
+ func makeUIViewController(context: Context) -> UIViewController {
+ MainViewControllerKt.MainViewController()
+ }
+
+ func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
+}
+
+struct ContentView: View {
+ var body: some View {
+ ComposeView()
+ .ignoresSafeArea(.keyboard) // Compose has own keyboard handler
+ }
+}
+
+
+
diff --git a/sample/iosApp/iosApp/Info.plist b/sample/iosApp/iosApp/Info.plist
new file mode 100644
index 00000000..412e3781
--- /dev/null
+++ b/sample/iosApp/iosApp/Info.plist
@@ -0,0 +1,50 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ $(PRODUCT_BUNDLE_PACKAGE_TYPE)
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+ LSRequiresIPhoneOS
+
+ CADisableMinimumFrameDurationOnPhone
+
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+
+ UILaunchScreen
+
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/sample/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/sample/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json
new file mode 100644
index 00000000..4aa7c535
--- /dev/null
+++ b/sample/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
\ No newline at end of file
diff --git a/sample/iosApp/iosApp/iOSApp.swift b/sample/iosApp/iosApp/iOSApp.swift
new file mode 100644
index 00000000..0648e860
--- /dev/null
+++ b/sample/iosApp/iosApp/iOSApp.swift
@@ -0,0 +1,10 @@
+import SwiftUI
+
+@main
+struct iOSApp: App {
+ var body: some Scene {
+ WindowGroup {
+ ContentView()
+ }
+ }
+}
\ No newline at end of file
diff --git a/sample/shared/build.gradle.kts b/sample/shared/build.gradle.kts
new file mode 100644
index 00000000..0cca678c
--- /dev/null
+++ b/sample/shared/build.gradle.kts
@@ -0,0 +1,39 @@
+plugins {
+ id("mmc.android.library")
+ id("mmc.kotlin.multiplatform")
+ id("mmc.compose")
+}
+
+android {
+ namespace = "soup.compose.material.motion.shared"
+}
+
+kotlin {
+ listOf(
+ iosX64(),
+ iosArm64(),
+ iosSimulatorArm64()
+ ).forEach { iosTarget ->
+ iosTarget.binaries.framework {
+ baseName = "Shared"
+ isStatic = true
+ }
+ }
+
+ sourceSets {
+ commonMain.dependencies {
+ implementation(projects.core)
+
+ implementation(compose.ui)
+ implementation(compose.material)
+ implementation(compose.materialIconsExtended)
+ implementation(compose.components.resources)
+ implementation(compose.components.uiToolingPreview)
+
+ implementation(libs.jetbrains.navigation.compose)
+ }
+ androidMain.dependencies {
+ implementation(libs.androidx.activity.compose)
+ }
+ }
+}
diff --git a/sample/shared/src/androidMain/kotlin/BackHandler.kt b/sample/shared/src/androidMain/kotlin/BackHandler.kt
new file mode 100644
index 00000000..5e86b82f
--- /dev/null
+++ b/sample/shared/src/androidMain/kotlin/BackHandler.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2024 SOUP
+ *
+ * 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
+ *
+ * https://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.
+ */
+import androidx.compose.runtime.Composable
+
+@Composable
+actual fun BackHandler(enabled: Boolean, onBack: () -> Unit) {
+ androidx.activity.compose.BackHandler(enabled = enabled, onBack = onBack)
+}
diff --git a/sample/android/src/main/res/drawable-nodpi/album_amy_shamblen_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_amy_shamblen_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_amy_shamblen_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_amy_shamblen_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_david_clode_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_david_clode_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_david_clode_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_david_clode_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_efe_kurnaz_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_efe_kurnaz_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_efe_kurnaz_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_efe_kurnaz_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_ellen_qin_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_ellen_qin_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_ellen_qin_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_ellen_qin_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_emile_seguin_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_emile_seguin_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_emile_seguin_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_emile_seguin_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_jean_philippe_delberghe_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_jean_philippe_delberghe_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_jean_philippe_delberghe_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_jean_philippe_delberghe_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_karina_vorozheeva_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_karina_vorozheeva_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_karina_vorozheeva_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_karina_vorozheeva_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_kristopher_roller_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_kristopher_roller_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_kristopher_roller_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_kristopher_roller_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_pawel_czerwinski_unsplash.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_pawel_czerwinski_unsplash.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_pawel_czerwinski_unsplash.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_pawel_czerwinski_unsplash.jpeg
diff --git a/sample/android/src/main/res/drawable-nodpi/album_pawel_czerwinski_unsplash_2.jpeg b/sample/shared/src/commonMain/composeResources/drawable/album_pawel_czerwinski_unsplash_2.jpeg
similarity index 100%
rename from sample/android/src/main/res/drawable-nodpi/album_pawel_czerwinski_unsplash_2.jpeg
rename to sample/shared/src/commonMain/composeResources/drawable/album_pawel_czerwinski_unsplash_2.jpeg
diff --git a/sample/shared/src/commonMain/kotlin/BackHandler.kt b/sample/shared/src/commonMain/kotlin/BackHandler.kt
new file mode 100644
index 00000000..9b14cb03
--- /dev/null
+++ b/sample/shared/src/commonMain/kotlin/BackHandler.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2024 SOUP
+ *
+ * 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
+ *
+ * https://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.
+ */
+import androidx.compose.runtime.Composable
+
+@Composable
+expect fun BackHandler(enabled: Boolean = true, onBack: () -> Unit)
diff --git a/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/App.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/App.kt
new file mode 100644
index 00000000..239c7576
--- /dev/null
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/App.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2024 SOUP
+ *
+ * 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
+ *
+ * https://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 soup.compose.material.motion.shared
+
+import androidx.compose.runtime.Composable
+import soup.compose.material.motion.shared.theme.SampleTheme
+
+@Composable
+fun App() {
+ SampleTheme {
+ NavGraph()
+ }
+}
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/HomeScreen.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/HomeScreen.kt
similarity index 95%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/HomeScreen.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/HomeScreen.kt
index b36fd28f..35334360 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/HomeScreen.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/HomeScreen.kt
@@ -13,9 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui
+package soup.compose.material.motion.shared
-import android.content.res.Configuration
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
@@ -33,9 +32,9 @@ import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
-import soup.compose.material.motion.sample.ui.theme.SampleTheme
+import org.jetbrains.compose.ui.tooling.preview.Preview
+import soup.compose.material.motion.shared.theme.SampleTheme
private data class Demo(
val title: String,
@@ -192,8 +191,7 @@ private fun HomeDemoItem(
}
}
-@Preview(name = "Light", showBackground = true)
-@Preview(name = "Dark", showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
+@Preview
@Composable
private fun DefaultPreview() {
SampleTheme {
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/NavGraph.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/NavGraph.kt
similarity index 81%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/NavGraph.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/NavGraph.kt
index c54839a3..ff243cbc 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/NavGraph.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/NavGraph.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui
+package soup.compose.material.motion.shared
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
@@ -23,14 +23,14 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import soup.compose.material.motion.animation.materialSharedAxisZIn
import soup.compose.material.motion.animation.materialSharedAxisZOut
-import soup.compose.material.motion.sample.ui.circularreveal.CircularRevealScreen
-import soup.compose.material.motion.sample.ui.demo.DemoScreen
-import soup.compose.material.motion.sample.ui.material.elevationscale.MaterialElevationScaleScreen
-import soup.compose.material.motion.sample.ui.material.fade.MaterialFadeScreen
-import soup.compose.material.motion.sample.ui.material.fadethrough.MaterialFadeThroughScreen
-import soup.compose.material.motion.sample.ui.material.hold.HoldScreen
-import soup.compose.material.motion.sample.ui.material.sharedaxis.MaterialSharedAxisScreen
-import soup.compose.material.motion.sample.ui.navigation.AnimatedNavHostScreen
+import soup.compose.material.motion.shared.circularreveal.CircularRevealScreen
+import soup.compose.material.motion.shared.demo.DemoScreen
+import soup.compose.material.motion.shared.material.elevationscale.MaterialElevationScaleScreen
+import soup.compose.material.motion.shared.material.fade.MaterialFadeScreen
+import soup.compose.material.motion.shared.material.fadethrough.MaterialFadeThroughScreen
+import soup.compose.material.motion.shared.material.hold.HoldScreen
+import soup.compose.material.motion.shared.material.sharedaxis.MaterialSharedAxisScreen
+import soup.compose.material.motion.shared.navigation.AnimatedNavHostScreen
enum class Destination(val route: String) {
Home("Home"),
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/circularreveal/CircularRevealScreen.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/circularreveal/CircularRevealScreen.kt
similarity index 90%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/circularreveal/CircularRevealScreen.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/circularreveal/CircularRevealScreen.kt
index 08384cdf..0f8363f2 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/circularreveal/CircularRevealScreen.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/circularreveal/CircularRevealScreen.kt
@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.circularreveal
+package soup.compose.material.motion.shared.circularreveal
-import android.content.res.Configuration
-import androidx.activity.compose.BackHandler
+import BackHandler
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
@@ -32,11 +31,11 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
-import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
+import org.jetbrains.compose.ui.tooling.preview.Preview
import soup.compose.material.motion.circularReveal
-import soup.compose.material.motion.sample.ui.common.DefaultScaffold
-import soup.compose.material.motion.sample.ui.theme.SampleTheme
+import soup.compose.material.motion.shared.common.DefaultScaffold
+import soup.compose.material.motion.shared.theme.SampleTheme
private data class Position(
val label: String,
@@ -146,8 +145,7 @@ fun CircularRevealScreen(upPress: () -> Unit) {
}
}
-@Preview(name = "Light", showBackground = true)
-@Preview(name = "Dark", showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
+@Preview
@Composable
private fun DefaultPreview() {
SampleTheme {
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/BottomTabsContents.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/BottomTabsContents.kt
similarity index 98%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/BottomTabsContents.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/BottomTabsContents.kt
index 367bfff7..51b0e86e 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/BottomTabsContents.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/BottomTabsContents.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.common
+package soup.compose.material.motion.shared.common
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/DefaultScaffold.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/DefaultScaffold.kt
similarity index 89%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/DefaultScaffold.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/DefaultScaffold.kt
index dd8e16c1..08022255 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/DefaultScaffold.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/DefaultScaffold.kt
@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.common
+package soup.compose.material.motion.shared.common
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.material.Scaffold
import androidx.compose.runtime.Composable
-import soup.compose.material.motion.sample.ui.widget.DefaultTopAppBar
+import soup.compose.material.motion.shared.widget.DefaultTopAppBar
@Composable
fun DefaultScaffold(
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/DefaultTopAppBar.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/DefaultTopAppBar.kt
similarity index 95%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/DefaultTopAppBar.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/DefaultTopAppBar.kt
index 54c4a49d..1f0345d1 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/DefaultTopAppBar.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/DefaultTopAppBar.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.widget
+package soup.compose.material.motion.shared.widget
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/ForwardBackwardContents.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/ForwardBackwardContents.kt
similarity index 99%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/ForwardBackwardContents.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/ForwardBackwardContents.kt
index d5905fac..c021a85c 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/common/ForwardBackwardContents.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/common/ForwardBackwardContents.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.common
+package soup.compose.material.motion.shared.common
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/AlbumContents.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/AlbumContents.kt
similarity index 97%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/AlbumContents.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/AlbumContents.kt
index 1cf4d101..a94c62a4 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/AlbumContents.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/AlbumContents.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.demo
+package soup.compose.material.motion.shared.demo
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
@@ -55,11 +55,11 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.layout.ContentScale
-import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
+import org.jetbrains.compose.resources.painterResource
import soup.compose.material.motion.MaterialFade
-import soup.compose.material.motion.sample.ui.theme.Purple200
+import soup.compose.material.motion.shared.theme.Purple200
@Composable
fun AlbumScaffold(
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/AlbumScreen.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/AlbumScreen.kt
similarity index 98%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/AlbumScreen.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/AlbumScreen.kt
index a6be723d..f3f34da1 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/AlbumScreen.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/AlbumScreen.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.demo
+package soup.compose.material.motion.shared.demo
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.requiredHeight
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/DemoScreen.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/DemoScreen.kt
similarity index 85%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/DemoScreen.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/DemoScreen.kt
index 8f7df66a..8c35ee0e 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/DemoScreen.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/DemoScreen.kt
@@ -13,22 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.demo
+package soup.compose.material.motion.shared.demo
-import android.content.res.Configuration
-import androidx.activity.compose.BackHandler
+import BackHandler
import androidx.compose.runtime.Composable
-import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navArgument
+import org.jetbrains.compose.ui.tooling.preview.Preview
import soup.compose.material.motion.animation.holdIn
import soup.compose.material.motion.animation.holdOut
import soup.compose.material.motion.animation.translateYIn
import soup.compose.material.motion.animation.translateYOut
-import soup.compose.material.motion.sample.ui.theme.SampleTheme
+import soup.compose.material.motion.shared.theme.SampleTheme
@Composable
fun DemoScreen(upPress: () -> Unit) {
@@ -43,6 +42,7 @@ fun DemoScreen(upPress: () -> Unit) {
upPress()
}
LibraryScreen(
+ upPress = upPress,
onItemClick = {
navController.navigate("album/${it.id}")
},
@@ -66,8 +66,7 @@ fun DemoScreen(upPress: () -> Unit) {
}
}
-@Preview(name = "Light", showBackground = true)
-@Preview(name = "Dark", showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
+@Preview
@Composable
private fun DefaultPreview() {
SampleTheme {
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/LibraryContents.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/LibraryContents.kt
similarity index 98%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/LibraryContents.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/LibraryContents.kt
index 71784e08..9623bac9 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/LibraryContents.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/LibraryContents.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.demo
+package soup.compose.material.motion.shared.demo
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
@@ -45,8 +45,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
-import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
+import org.jetbrains.compose.resources.painterResource
@Composable
fun LibraryGridContents(
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/LibraryScreen.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/LibraryScreen.kt
similarity index 90%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/LibraryScreen.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/LibraryScreen.kt
index cc785ce0..564f438b 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/LibraryScreen.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/LibraryScreen.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.demo
+package soup.compose.material.motion.shared.demo
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
@@ -26,6 +26,7 @@ import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ViewList
+import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.SortByAlpha
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
@@ -37,7 +38,7 @@ import soup.compose.material.motion.MaterialMotion
import soup.compose.material.motion.animation.materialFadeThrough
import soup.compose.material.motion.animation.materialSharedAxisY
import soup.compose.material.motion.animation.rememberSlideDistance
-import soup.compose.material.motion.sample.ui.demo.LibraryState.Companion.Saver
+import soup.compose.material.motion.shared.demo.LibraryState.Companion.Saver
private enum class SortType {
A_TO_Z, Z_TO_A
@@ -83,7 +84,10 @@ private data class LibraryState(
}
@Composable
-fun LibraryScreen(onItemClick: (MusicData.Album) -> Unit) {
+fun LibraryScreen(
+ upPress: () -> Unit,
+ onItemClick: (MusicData.Album) -> Unit,
+) {
val (state, onStateChanged) = rememberSaveable(stateSaver = Saver) {
mutableStateOf(LibraryState(SortType.A_TO_Z, ListType.Grid))
}
@@ -105,6 +109,7 @@ fun LibraryScreen(onItemClick: (MusicData.Album) -> Unit) {
)
}
LibraryScaffold(
+ upPress = upPress,
onSortTypeToggle = {
val newType = when (state.sortType) {
SortType.A_TO_Z -> SortType.Z_TO_A
@@ -139,6 +144,7 @@ fun LibraryScreen(onItemClick: (MusicData.Album) -> Unit) {
@Composable
fun LibraryScaffold(
+ upPress: () -> Unit,
onSortTypeToggle: () -> Unit,
onListTypeToggle: () -> Unit,
content: @Composable (PaddingValues) -> Unit,
@@ -147,6 +153,14 @@ fun LibraryScaffold(
topBar = {
TopAppBar(
title = { Text(text = "Library") },
+ navigationIcon = {
+ IconButton(onClick = upPress) {
+ Icon(
+ Icons.Default.Close,
+ contentDescription = null,
+ )
+ }
+ },
actions = {
IconButton(onClick = onSortTypeToggle) {
Icon(
diff --git a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/MusicData.kt b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/MusicData.kt
similarity index 66%
rename from sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/MusicData.kt
rename to sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/MusicData.kt
index dee022fe..3b135d84 100644
--- a/sample/android/src/main/java/soup/compose/material/motion/sample/ui/demo/MusicData.kt
+++ b/sample/shared/src/commonMain/kotlin/soup/compose/material/motion/shared/demo/MusicData.kt
@@ -13,10 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package soup.compose.material.motion.sample.ui.demo
+package soup.compose.material.motion.shared.demo
-import androidx.annotation.DrawableRes
-import soup.compose.material.motion.sample.R
+import material_motion_compose.sample.shared.generated.resources.Res
+import material_motion_compose.sample.shared.generated.resources.album_amy_shamblen_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_david_clode_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_efe_kurnaz_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_ellen_qin_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_emile_seguin_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_jean_philippe_delberghe_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_karina_vorozheeva_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_kristopher_roller_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_pawel_czerwinski_unsplash
+import material_motion_compose.sample.shared.generated.resources.album_pawel_czerwinski_unsplash_2
+import org.jetbrains.compose.resources.DrawableResource
/** A static store of data to be used in the transition's main music player flow example. */
object MusicData {
@@ -43,7 +53,7 @@ object MusicData {
0L,
"Metamorphosis",
"Sandra Adams",
- R.drawable.album_efe_kurnaz_unsplash,
+ Res.drawable.album_efe_kurnaz_unsplash,
tracks,
"52 mins",
),
@@ -51,7 +61,7 @@ object MusicData {
1L,
"Continuity",
"Ali Connors",
- R.drawable.album_pawel_czerwinski_unsplash,
+ Res.drawable.album_pawel_czerwinski_unsplash,
tracks,
"92 mins",
),
@@ -59,7 +69,7 @@ object MusicData {
2L,
"Break Point",
"David Park",
- R.drawable.album_jean_philippe_delberghe_unsplash,
+ Res.drawable.album_jean_philippe_delberghe_unsplash,
tracks,
"45 mins",
),
@@ -67,7 +77,7 @@ object MusicData {
3L,
"Headspace",
"Charlie z.",
- R.drawable.album_karina_vorozheeva_unsplash,
+ Res.drawable.album_karina_vorozheeva_unsplash,
tracks,
"65 mins",
),
@@ -75,7 +85,7 @@ object MusicData {
4L,
"New Neighbors",
"Trevor Hansen",
- R.drawable.album_amy_shamblen_unsplash,
+ Res.drawable.album_amy_shamblen_unsplash,
tracks,
"73 mins",
),
@@ -83,7 +93,7 @@ object MusicData {
5L,
"Spaced Out",
"Jonas Eckhart",
- R.drawable.album_pawel_czerwinski_unsplash_2,
+ Res.drawable.album_pawel_czerwinski_unsplash_2,
tracks,
"4 mins",
),
@@ -91,7 +101,7 @@ object MusicData {
6L,
"Holding on",
"Elizabeth Park",
- R.drawable.album_kristopher_roller_unsplash,
+ Res.drawable.album_kristopher_roller_unsplash,
tracks,
"40 mins",
),
@@ -99,7 +109,7 @@ object MusicData {
7L,
"Persistence",
"Britta Holt",
- R.drawable.album_emile_seguin_unsplash,
+ Res.drawable.album_emile_seguin_unsplash,
tracks,
"39 mins",
),
@@ -107,7 +117,7 @@ object MusicData {
8L,
"At the Top",
"Annie Chiu",
- R.drawable.album_ellen_qin_unsplash,
+ Res.drawable.album_ellen_qin_unsplash,
tracks,
"46 mins",
),
@@ -115,7 +125,7 @@ object MusicData {
9L,
"On Dry Land",
"Alfonso Gonzalez",
- R.drawable.album_david_clode_unsplash,
+ Res.drawable.album_david_clode_unsplash,
tracks,
"55 mins",
),
@@ -130,7 +140,7 @@ object MusicData {
val id: Long,
val title: String,
val artist: String,
- @DrawableRes val cover: Int,
+ val cover: DrawableResource,
val tracks: List