From 2752c7cd6cca2e02c6a0347ef35e1fefcd2cd8b4 Mon Sep 17 00:00:00 2001 From: michaelbel Date: Tue, 26 Nov 2024 21:41:28 +0300 Subject: [PATCH] Update project --- .../movies/ui/shortcuts/MoviesShortcuts.kt | 5 +---- .../movies/ui/shortcuts/MoviesShortcutsLinks.kt | 4 ++++ .../main/navigation/MainNavigation.android.kt | 4 ++-- .../michaelbel/movies/main/MainContent.ios.kt | 8 +++++--- .../movies/main/MainContent.desktop.kt | 8 +++++--- ...gsNavigation.kt => SettingsNavController.kt} | 0 .../movies/settings/SettingsNavGraphBuilder.kt} | 6 ++---- .../movies/settings/SettingsNavigation.ios.kt | 17 ----------------- .../settings/SettingsNavigation.desktop.kt | 17 ----------------- 9 files changed, 19 insertions(+), 50 deletions(-) create mode 100644 core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcutsLinks.kt rename feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/{SettingsNavigation.kt => SettingsNavController.kt} (100%) rename feature/settings/src/{androidMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.android.kt => commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavGraphBuilder.kt} (81%) delete mode 100644 feature/settings/src/iosMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.ios.kt delete mode 100644 feature/settings/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcuts.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcuts.kt index f63681fc5..0bbba444c 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcuts.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcuts.kt @@ -6,16 +6,13 @@ import androidx.core.content.pm.ShortcutInfoCompat import androidx.core.content.pm.ShortcutManagerCompat import androidx.core.graphics.drawable.IconCompat import androidx.core.net.toUri +import org.michaelbel.movies.ui.R import org.michaelbel.movies.ui.appicon.shortcutSearchIconRes import org.michaelbel.movies.ui.appicon.shortcutSettingsIconRes -import org.michaelbel.movies.ui.R private const val SEARCH_SHORTCUT_ID = "searchShortcutId" private const val SETTINGS_SHORTCUT_ID = "settingsShortcutId" -const val INTENT_ACTION_SEARCH = "movies_shortcut://search" -const val INTENT_ACTION_SETTINGS = "movies_shortcut://settings" - /** * See [App Shortcuts Design Guidelines](https://commondatastorage.googleapis.com/androiddevelopers/shareables/design/app-shortcuts-design-guidelines.pdf) */ diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcutsLinks.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcutsLinks.kt new file mode 100644 index 000000000..acb287c5f --- /dev/null +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/shortcuts/MoviesShortcutsLinks.kt @@ -0,0 +1,4 @@ +package org.michaelbel.movies.ui.shortcuts + +const val INTENT_ACTION_SEARCH = "movies_shortcut://search" +const val INTENT_ACTION_SETTINGS = "movies_shortcut://settings" \ No newline at end of file diff --git a/feature/main-impl/src/androidMain/kotlin/org/michaelbel/movies/main/navigation/MainNavigation.android.kt b/feature/main-impl/src/androidMain/kotlin/org/michaelbel/movies/main/navigation/MainNavigation.android.kt index 812b9b9b4..a992fb256 100644 --- a/feature/main-impl/src/androidMain/kotlin/org/michaelbel/movies/main/navigation/MainNavigation.android.kt +++ b/feature/main-impl/src/androidMain/kotlin/org/michaelbel/movies/main/navigation/MainNavigation.android.kt @@ -30,7 +30,7 @@ import org.koin.androidx.compose.koinViewModel import org.michaelbel.movies.feed.FeedDestination import org.michaelbel.movies.feed.feedGraph import org.michaelbel.movies.settings.SettingsDestination -import org.michaelbel.movies.settings.settingsGraph +import org.michaelbel.movies.settings.settingsGraph2 import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.ktx.ObserveAsEvents @@ -119,7 +119,7 @@ fun NavGraphBuilder.mainGraph( navigateToSettings = navigateToSettings, navigateToDetails = navigateToDetails ) - settingsGraph( + settingsGraph2( navigateBack = {}, onRequestReview = onRequestReview, onRequestUpdate = onRequestUpdate diff --git a/feature/main-impl/src/iosMain/kotlin/org/michaelbel/movies/main/MainContent.ios.kt b/feature/main-impl/src/iosMain/kotlin/org/michaelbel/movies/main/MainContent.ios.kt index fda32bf86..b7a89e276 100644 --- a/feature/main-impl/src/iosMain/kotlin/org/michaelbel/movies/main/MainContent.ios.kt +++ b/feature/main-impl/src/iosMain/kotlin/org/michaelbel/movies/main/MainContent.ios.kt @@ -17,7 +17,7 @@ import org.michaelbel.movies.gallery.navigateToGallery import org.michaelbel.movies.search.navigateToSearch import org.michaelbel.movies.search.searchGraph import org.michaelbel.movies.settings.navigateToSettings -import org.michaelbel.movies.settings.settingsGraph +import org.michaelbel.movies.settings.settingsGraph2 @Composable fun MainContent( @@ -51,8 +51,10 @@ fun MainContent( navigateBack = navHostController::popBackStack, navigateToDetails = navHostController::navigateToDetails, ) - settingsGraph( - navigateBack = navHostController::popBackStack + settingsGraph2( + navigateBack = navHostController::popBackStack, + onRequestReview = {}, + onRequestUpdate = {} ) } } \ No newline at end of file diff --git a/feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt b/feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt index fda32bf86..b7a89e276 100644 --- a/feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt +++ b/feature/main-impl/src/jvmMain/kotlin/org/michaelbel/movies/main/MainContent.desktop.kt @@ -17,7 +17,7 @@ import org.michaelbel.movies.gallery.navigateToGallery import org.michaelbel.movies.search.navigateToSearch import org.michaelbel.movies.search.searchGraph import org.michaelbel.movies.settings.navigateToSettings -import org.michaelbel.movies.settings.settingsGraph +import org.michaelbel.movies.settings.settingsGraph2 @Composable fun MainContent( @@ -51,8 +51,10 @@ fun MainContent( navigateBack = navHostController::popBackStack, navigateToDetails = navHostController::navigateToDetails, ) - settingsGraph( - navigateBack = navHostController::popBackStack + settingsGraph2( + navigateBack = navHostController::popBackStack, + onRequestReview = {}, + onRequestUpdate = {} ) } } \ No newline at end of file diff --git a/feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.kt b/feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavController.kt similarity index 100% rename from feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.kt rename to feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavController.kt diff --git a/feature/settings/src/androidMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.android.kt b/feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavGraphBuilder.kt similarity index 81% rename from feature/settings/src/androidMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.android.kt rename to feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavGraphBuilder.kt index a25c09650..73b8d606e 100644 --- a/feature/settings/src/androidMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.android.kt +++ b/feature/settings/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsNavGraphBuilder.kt @@ -6,15 +6,13 @@ import androidx.navigation.navDeepLink import org.michaelbel.movies.settings.ui.SettingsRoute import org.michaelbel.movies.ui.shortcuts.INTENT_ACTION_SETTINGS -fun NavGraphBuilder.settingsGraph( +fun NavGraphBuilder.settingsGraph2( navigateBack: () -> Unit, onRequestReview: () -> Unit, onRequestUpdate: () -> Unit ) { composable( - deepLinks = listOf( - navDeepLink { uriPattern = INTENT_ACTION_SETTINGS } - ) + deepLinks = listOf(navDeepLink { uriPattern = INTENT_ACTION_SETTINGS }) ) { SettingsRoute( onBackClick = navigateBack, diff --git a/feature/settings/src/iosMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.ios.kt b/feature/settings/src/iosMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.ios.kt deleted file mode 100644 index 1d62812ae..000000000 --- a/feature/settings/src/iosMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.ios.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.michaelbel.movies.settings - -import androidx.navigation.NavGraphBuilder -import androidx.navigation.compose.composable -import org.michaelbel.movies.settings.ui.SettingsRoute - -fun NavGraphBuilder.settingsGraph( - navigateBack: () -> Unit -) { - composable { - SettingsRoute( - onBackClick = navigateBack, - onRequestReview = {}, - onRequestUpdate = {} - ) - } -} \ No newline at end of file diff --git a/feature/settings/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt b/feature/settings/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt deleted file mode 100644 index 1d62812ae..000000000 --- a/feature/settings/src/jvmMain/kotlin/org/michaelbel/movies/settings/SettingsNavigation.desktop.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.michaelbel.movies.settings - -import androidx.navigation.NavGraphBuilder -import androidx.navigation.compose.composable -import org.michaelbel.movies.settings.ui.SettingsRoute - -fun NavGraphBuilder.settingsGraph( - navigateBack: () -> Unit -) { - composable { - SettingsRoute( - onBackClick = navigateBack, - onRequestReview = {}, - onRequestUpdate = {} - ) - } -} \ No newline at end of file