diff --git a/androidApp/src/main/kotlin/org/michaelbel/movies/di/AppKoinModule.kt b/androidApp/src/main/kotlin/org/michaelbel/movies/di/AppKoinModule.kt index ba6d2c99f..cf2ca8185 100644 --- a/androidApp/src/main/kotlin/org/michaelbel/movies/di/AppKoinModule.kt +++ b/androidApp/src/main/kotlin/org/michaelbel/movies/di/AppKoinModule.kt @@ -5,7 +5,7 @@ import org.michaelbel.movies.account.di.accountKoinModule import org.michaelbel.movies.auth.di.authKoinModule import org.michaelbel.movies.debug.di.debugKoinModule import org.michaelbel.movies.details.di.detailsKoinModule -import org.michaelbel.movies.feed.di.feedAndroidKoinModule +import org.michaelbel.movies.feed.di.feedKoinModule import org.michaelbel.movies.gallery.di.galleryKoinModule import org.michaelbel.movies.main.di.mainKoinModule import org.michaelbel.movies.platform.inject.flavorServiceKtorModule @@ -20,7 +20,7 @@ internal val appKoinModule = module { accountKoinModule, authKoinModule, detailsKoinModule, - feedAndroidKoinModule, + feedKoinModule, galleryKoinModule, searchKoinModule, settingsKoinModule, diff --git a/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt b/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt index 4401f4942..3ae5d8fd5 100644 --- a/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt +++ b/desktopApp/src/jvmMain/kotlin/org/michaelbel/movies/di/AppKoinModule.kt @@ -4,6 +4,7 @@ import org.koin.dsl.module import org.michaelbel.movies.account.di.accountKoinModule import org.michaelbel.movies.auth.di.authKoinModule import org.michaelbel.movies.details.di.detailsKoinModule +import org.michaelbel.movies.feed.di.feedKoinModule import org.michaelbel.movies.gallery.di.galleryKoinModule import org.michaelbel.movies.main.di.mainKoinModule import org.michaelbel.movies.platform.inject.flavorServiceKtorModule diff --git a/feature/feed-impl/build.gradle.kts b/feature/feed-impl/build.gradle.kts index 9d81eb9ea..5365ecf10 100644 --- a/feature/feed-impl/build.gradle.kts +++ b/feature/feed-impl/build.gradle.kts @@ -44,6 +44,7 @@ kotlin { implementation(compose.material) implementation(compose.material3) implementation(compose.runtime) + implementation(libs.koin.compose) } } } diff --git a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/di/FeedAndroidKoinModule.kt b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.android.kt similarity index 78% rename from feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/di/FeedAndroidKoinModule.kt rename to feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.android.kt index 4a9da0dbf..d2b9fd386 100644 --- a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/di/FeedAndroidKoinModule.kt +++ b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.android.kt @@ -2,14 +2,14 @@ package org.michaelbel.movies.feed.di import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.dsl.module -import org.michaelbel.movies.di.feedKoinModule import org.michaelbel.movies.feed.FeedViewModel +import org.michaelbel.movies.interactor.di.interactorKoinModule import org.michaelbel.movies.network.connectivity.di.networkManagerKoinModule import org.michaelbel.movies.notifications.di.notificationClientKoinModule -val feedAndroidKoinModule = module { +actual val feedKoinModule = module { includes( - feedKoinModule, + interactorKoinModule, notificationClientKoinModule, networkManagerKoinModule ) diff --git a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt index c873d589c..49834c6e2 100644 --- a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt +++ b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt @@ -34,14 +34,12 @@ import org.michaelbel.movies.common.appearance.FeedView import org.michaelbel.movies.common.exceptions.ApiKeyNotNullException import org.michaelbel.movies.common.exceptions.PageEmptyException import org.michaelbel.movies.common.list.MovieList +import org.michaelbel.movies.feed.ktx.titleText import org.michaelbel.movies.feed_impl.R -import org.michaelbel.movies.ktx.titleText import org.michaelbel.movies.network.config.isTmdbApiKeyEmpty import org.michaelbel.movies.network.connectivity.NetworkStatus import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo -import org.michaelbel.movies.ui.FeedEmpty -import org.michaelbel.movies.ui.FeedToolbar import org.michaelbel.movies.ui.compose.NotificationBottomSheet import org.michaelbel.movies.ui.compose.page.PageContent import org.michaelbel.movies.ui.compose.page.PageFailure diff --git a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/di/FeedKoinModule.kt b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/di/FeedKoinModule.kt deleted file mode 100644 index aa0438eb3..000000000 --- a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/di/FeedKoinModule.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.michaelbel.movies.di - -import org.koin.dsl.module -import org.michaelbel.movies.interactor.di.interactorKoinModule - -val feedKoinModule = module { - includes( - interactorKoinModule - ) -} \ No newline at end of file diff --git a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.kt b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.kt new file mode 100644 index 000000000..63bd3991f --- /dev/null +++ b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.kt @@ -0,0 +1,5 @@ +package org.michaelbel.movies.feed.di + +import org.koin.core.module.Module + +expect val feedKoinModule: Module \ No newline at end of file diff --git a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ktx/MovieListKtx.kt b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ktx/MovieListKtx.kt similarity index 81% rename from feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ktx/MovieListKtx.kt rename to feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ktx/MovieListKtx.kt index 471194403..dfbcd7d41 100644 --- a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ktx/MovieListKtx.kt +++ b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ktx/MovieListKtx.kt @@ -1,9 +1,6 @@ -@file:OptIn(ExperimentalResourceApi::class) - -package org.michaelbel.movies.ktx +package org.michaelbel.movies.feed.ktx import androidx.compose.runtime.Composable -import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.common.list.MovieList import org.michaelbel.movies.ui.strings.MoviesStrings diff --git a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ui/FeedEmpty.kt b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt similarity index 94% rename from feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ui/FeedEmpty.kt rename to feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt index a2be263db..8090abf97 100644 --- a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ui/FeedEmpty.kt +++ b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt @@ -1,6 +1,4 @@ -@file:OptIn(ExperimentalResourceApi::class) - -package org.michaelbel.movies.ui +package org.michaelbel.movies.feed.ui import androidx.compose.foundation.background import androidx.compose.foundation.layout.fillMaxSize @@ -13,7 +11,6 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension -import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon diff --git a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ui/FeedToolbar.kt b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt similarity index 96% rename from feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ui/FeedToolbar.kt rename to feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt index 34e184f49..94e1319cc 100644 --- a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/ui/FeedToolbar.kt +++ b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt @@ -1,6 +1,6 @@ -@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalResourceApi::class) +@file:OptIn(ExperimentalMaterial3Api::class) -package org.michaelbel.movies.ui +package org.michaelbel.movies.feed.ui import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -23,7 +23,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo diff --git a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt b/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt new file mode 100644 index 000000000..bdc49d87c --- /dev/null +++ b/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt @@ -0,0 +1,11 @@ +package org.michaelbel.movies.feed + +import org.michaelbel.movies.common.viewmodel.BaseViewModel +import org.michaelbel.movies.interactor.Interactor + +class FeedViewModel( + private val interactor: Interactor +): BaseViewModel() { + + +} \ No newline at end of file diff --git a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.desktop.kt b/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.desktop.kt new file mode 100644 index 000000000..97568f351 --- /dev/null +++ b/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/di/FeedKoinModule.desktop.kt @@ -0,0 +1,12 @@ +package org.michaelbel.movies.feed.di + +import org.koin.dsl.module +import org.michaelbel.movies.feed.FeedViewModel +import org.michaelbel.movies.interactor.di.interactorKoinModule + +actual val feedKoinModule = module { + includes( + interactorKoinModule + ) + single { FeedViewModel(get()) } +} \ No newline at end of file diff --git a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt b/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.kt similarity index 91% rename from feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt rename to feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.kt index c0a6e3fdf..b33e34280 100644 --- a/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt +++ b/feature/feed-impl/src/desktopMain/kotlin/org/michaelbel/movies/feed/ui/FeedRoute.kt @@ -9,8 +9,9 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import org.koin.compose.koinInject +import org.michaelbel.movies.feed.FeedViewModel import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo -import org.michaelbel.movies.ui.FeedToolbar @Composable fun FeedRoute( @@ -19,7 +20,8 @@ fun FeedRoute( onNavigateToAccount: () -> Unit, onNavigateToSettings: () -> Unit, onNavigateToDetails: (String, Int) -> Unit, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, + viewModel: FeedViewModel = koinInject() ) { FeedScreenContent( onNavigateToSearch = onNavigateToSearch,