From 7362748264daa9b2c506f2c009f42eb4b14a3284 Mon Sep 17 00:00:00 2001 From: imashnake0 Date: Mon, 2 Dec 2024 02:28:57 -0500 Subject: [PATCH] Moved `SharedContentKey` --- .../com/imashnake/animite/features/home/HomeScreen.kt | 10 +++++----- .../com/imashnake/animite/features/media/MediaPage.kt | 10 +++++----- .../imashnake/animite/navigation}/SharedContentKey.kt | 8 +++++++- 3 files changed, 17 insertions(+), 11 deletions(-) rename {app/src/main/kotlin/com/imashnake/animite/dev => navigation/src/main/kotlin/com/imashnake/animite/navigation}/SharedContentKey.kt (51%) diff --git a/app/src/main/kotlin/com/imashnake/animite/features/home/HomeScreen.kt b/app/src/main/kotlin/com/imashnake/animite/features/home/HomeScreen.kt index 82ba27ef..386820f1 100644 --- a/app/src/main/kotlin/com/imashnake/animite/features/home/HomeScreen.kt +++ b/app/src/main/kotlin/com/imashnake/animite/features/home/HomeScreen.kt @@ -67,11 +67,11 @@ import com.imashnake.animite.core.ui.MediaSmallRow import com.imashnake.animite.core.ui.ProgressIndicator import com.imashnake.animite.core.ui.layouts.BannerLayout import com.imashnake.animite.core.ui.layouts.TranslucentStatusBarLayout -import com.imashnake.animite.dev.SharedContentKey -import com.imashnake.animite.dev.SharedContentKey.Component.Card -import com.imashnake.animite.dev.SharedContentKey.Component.Image -import com.imashnake.animite.dev.SharedContentKey.Component.Page -import com.imashnake.animite.dev.SharedContentKey.Component.Text +import com.imashnake.animite.navigation.SharedContentKey +import com.imashnake.animite.navigation.SharedContentKey.Component.Card +import com.imashnake.animite.navigation.SharedContentKey.Component.Image +import com.imashnake.animite.navigation.SharedContentKey.Component.Page +import com.imashnake.animite.navigation.SharedContentKey.Component.Text import com.imashnake.animite.features.media.MediaPage import com.imashnake.animite.core.R as coreR import com.imashnake.animite.navigation.R as navigationR diff --git a/app/src/main/kotlin/com/imashnake/animite/features/media/MediaPage.kt b/app/src/main/kotlin/com/imashnake/animite/features/media/MediaPage.kt index 936e2dea..b85791f3 100644 --- a/app/src/main/kotlin/com/imashnake/animite/features/media/MediaPage.kt +++ b/app/src/main/kotlin/com/imashnake/animite/features/media/MediaPage.kt @@ -81,11 +81,11 @@ import com.imashnake.animite.core.ui.NestedScrollableContent import com.imashnake.animite.core.ui.StatsRow import com.imashnake.animite.core.ui.layouts.BannerLayout import com.imashnake.animite.core.ui.layouts.TranslucentStatusBarLayout -import com.imashnake.animite.dev.SharedContentKey -import com.imashnake.animite.dev.SharedContentKey.Component.Card -import com.imashnake.animite.dev.SharedContentKey.Component.Image -import com.imashnake.animite.dev.SharedContentKey.Component.Page -import com.imashnake.animite.dev.SharedContentKey.Component.Text +import com.imashnake.animite.navigation.SharedContentKey +import com.imashnake.animite.navigation.SharedContentKey.Component.Card +import com.imashnake.animite.navigation.SharedContentKey.Component.Image +import com.imashnake.animite.navigation.SharedContentKey.Component.Page +import com.imashnake.animite.navigation.SharedContentKey.Component.Text import kotlinx.serialization.Serializable import com.imashnake.animite.core.R as coreR diff --git a/app/src/main/kotlin/com/imashnake/animite/dev/SharedContentKey.kt b/navigation/src/main/kotlin/com/imashnake/animite/navigation/SharedContentKey.kt similarity index 51% rename from app/src/main/kotlin/com/imashnake/animite/dev/SharedContentKey.kt rename to navigation/src/main/kotlin/com/imashnake/animite/navigation/SharedContentKey.kt index 818b05f1..760f4498 100644 --- a/app/src/main/kotlin/com/imashnake/animite/dev/SharedContentKey.kt +++ b/navigation/src/main/kotlin/com/imashnake/animite/navigation/SharedContentKey.kt @@ -1,5 +1,11 @@ -package com.imashnake.animite.dev +package com.imashnake.animite.navigation +/** + * Builds a key via [toString] for shared element transitions from [Component] to [Component]. + * + * @see [androidx.compose.animation.SharedTransitionScope.rememberSharedContentState] + * @see [androidx.compose.animation.SharedTransitionScope.SharedContentState.key] + */ data class SharedContentKey( val id: Int? = null, val source: String? = null,