From 80cfa2e8579ff18400c89f4ce43a34cae2ea9ddb Mon Sep 17 00:00:00 2001 From: michaelbel Date: Tue, 26 Nov 2024 21:44:17 +0300 Subject: [PATCH] Update project --- core/interactor/build.gradle.kts | 1 + .../impl/SettingsUiInteractorImpl.kt | 37 ++++++++++++++++++- .../movies/interactor/SettingsUiInteractor.kt | 18 +++++++++ .../impl/SettingsUiInteractorImpl.kt | 24 ++++++++++++ .../impl/SettingsUiInteractorImpl.kt | 24 ++++++++++++ .../movies/ui}/ktx/GenderStringKtx.android.kt | 6 +-- .../movies/ui}/ktx/GrammaticalGenderKtx.kt | 6 +-- .../movies/ui/ktx/TileKtx.android.kt | 2 +- .../res/values-ru-feminine/strings.xml | 0 .../res/values-ru-masculine/strings.xml | 0 .../res/values-ru-neuter/strings.xml | 0 .../src/androidMain/res/values-ru/strings.xml | 1 + .../ui/src/androidMain/res/values/strings.xml | 1 + .../movies/ui/ktx/GenderStringKtx.kt | 3 ++ .../org/michaelbel/movies/ui}/ktx/TileKtx.kt | 2 +- .../movies/ui}/ktx/GenderStringKtx.ios.kt | 4 +- .../michaelbel/movies/ui/ktx/TileKtx.ios.kt | 2 +- .../movies/ui}/ktx/GenderStringKtx.desktop.kt | 4 +- .../movies/ui/ktx/TileKtx.desktop.kt | 2 +- .../widget/ktx/AppWidgetManagerKtx.android.kt | 3 +- .../movies/widget}/ktx/AppWidgetManagerKtx.kt | 2 +- .../widget/ktx/AppWidgetManagerKtx.ios.kt | 2 +- .../widget/ktx/AppWidgetManagerKtx.desktop.kt | 2 +- .../gender/di/GrammaticalGenderKoinModule.kt | 11 ------ .../impl/GrammaticalGenderManagerImpl.kt | 19 ---------- .../iconAlias/di/IconAliasKoinModule.kt | 11 ------ .../iconAlias/impl/IconAliasManagerImpl.kt | 19 ---------- .../movies/settings/ktx/AppVersionDataKtx.kt | 27 -------------- .../movies/settings/model/Features.android.kt | 15 -------- .../src/androidMain/res/values-ru/strings.xml | 3 -- .../src/androidMain/res/values/strings.xml | 3 -- .../movies/settings/SettingsViewModel.kt | 4 -- .../movies/settings/di/SettingsKoinModule.kt | 6 +-- .../gender/GrammaticalGenderManager.kt | 10 ----- .../gender/di/GrammaticalGenderKoinModule.kt | 5 --- .../settings/iconAlias/IconAliasInteractor.kt | 10 ----- .../iconAlias/di/IconAliasKoinModule.kt | 5 --- .../movies/settings/ktx/GenderStringKtx.kt | 3 -- .../movies/settings/model/Features.kt | 7 ---- .../movies/settings/ui/SettingsRoute.kt | 21 +++++------ .../settings/ui/SettingsScreenContent.kt | 2 +- .../gender/di/GrammaticalGenderKoinModule.kt | 11 ------ .../impl/GrammaticalGenderManagerImpl.kt | 13 ------- .../iconAlias/di/IconAliasKoinModule.kt | 11 ------ .../iconAlias/impl/IconAliasManagerImpl.kt | 12 ------ .../movies/settings/model/Features.ios.kt | 13 ------- .../gender/di/GrammaticalGenderKoinModule.kt | 11 ------ .../impl/GrammaticalGenderManagerImpl.kt | 13 ------- .../iconAlias/di/IconAliasKoinModule.kt | 11 ------ .../iconAlias/impl/IconAliasManagerImpl.kt | 12 ------ .../movies/settings/model/Features.desktop.kt | 13 ------- 51 files changed, 137 insertions(+), 310 deletions(-) rename {feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings => core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui}/ktx/GenderStringKtx.android.kt (53%) rename {feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings => core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui}/ktx/GrammaticalGenderKtx.kt (79%) rename feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt => core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.android.kt (97%) rename {feature/settings-impl => core/ui}/src/androidMain/res/values-ru-feminine/strings.xml (100%) rename {feature/settings-impl => core/ui}/src/androidMain/res/values-ru-masculine/strings.xml (100%) rename {feature/settings-impl => core/ui}/src/androidMain/res/values-ru-neuter/strings.xml (100%) create mode 100644 core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.kt rename {feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings => core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui}/ktx/TileKtx.kt (74%) rename {feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings => core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui}/ktx/GenderStringKtx.ios.kt (71%) rename feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt => core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.ios.kt (77%) rename {feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings => core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui}/ktx/GenderStringKtx.desktop.kt (71%) rename feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt => core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.desktop.kt (77%) rename feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt => core/widget/src/androidMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.android.kt (87%) rename {feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings => core/widget/src/commonMain/kotlin/org/michaelbel/movies/widget}/ktx/AppWidgetManagerKtx.kt (72%) rename feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt => core/widget/src/iosMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.ios.kt (75%) rename feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt => core/widget/src/jvmMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.desktop.kt (75%) delete mode 100644 feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt delete mode 100644 feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt delete mode 100644 feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt delete mode 100644 feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt delete mode 100644 feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppVersionDataKtx.kt delete mode 100644 feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/model/Features.android.kt delete mode 100644 feature/settings-impl/src/androidMain/res/values-ru/strings.xml delete mode 100644 feature/settings-impl/src/androidMain/res/values/strings.xml delete mode 100644 feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/GrammaticalGenderManager.kt delete mode 100644 feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt delete mode 100644 feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/IconAliasInteractor.kt delete mode 100644 feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt delete mode 100644 feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.kt delete mode 100644 feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/model/Features.kt delete mode 100644 feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt delete mode 100644 feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt delete mode 100644 feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt delete mode 100644 feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt delete mode 100644 feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/model/Features.ios.kt delete mode 100644 feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt delete mode 100644 feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt delete mode 100644 feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt delete mode 100644 feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt delete mode 100644 feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt diff --git a/core/interactor/build.gradle.kts b/core/interactor/build.gradle.kts index f77f6b3fd..f88bd19f5 100644 --- a/core/interactor/build.gradle.kts +++ b/core/interactor/build.gradle.kts @@ -20,6 +20,7 @@ kotlin { commonMain.dependencies { api(project(":core:analytics")) api(project(":core:repository")) + api(project(":core:ui")) implementation(libs.bundles.room.paging.common) } } diff --git a/core/interactor/src/androidMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt b/core/interactor/src/androidMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt index b34378701..150b523cf 100644 --- a/core/interactor/src/androidMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt +++ b/core/interactor/src/androidMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt @@ -2,17 +2,29 @@ package org.michaelbel.movies.interactor.impl import android.Manifest import android.app.Activity +import android.content.Context import android.os.Build import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.ChecksSdkIntAtLeast +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import com.google.android.material.color.DynamicColors +import org.michaelbel.movies.common.SealedString import org.michaelbel.movies.common.ktx.appNotificationSettingsIntent import org.michaelbel.movies.interactor.SettingsUiInteractor +import org.michaelbel.movies.ui.appicon.IconAlias +import org.michaelbel.movies.ui.appicon.enabledIcon +import org.michaelbel.movies.ui.appicon.setIcon +import org.michaelbel.movies.ui.ktx.currentGrammaticalGender +import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets +import org.michaelbel.movies.ui.ktx.supportSetRequestedApplicationGrammaticalGender -class SettingsUiInteractorImpl: SettingsUiInteractor { +class SettingsUiInteractorImpl( + private val context: Context +): SettingsUiInteractor { override val isNavigationIconVisible: Boolean get() = false @@ -32,6 +44,12 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { override val isGenderFeatureEnabled: Boolean @ChecksSdkIntAtLeast(34) get() = Build.VERSION.SDK_INT >= 34 + override val isDynamicColorsFeatureEnabled: Boolean + get() = DynamicColors.isDynamicColorAvailable() + + override val isPaletteColorsFeatureEnabled: Boolean + get() = true + override val isNotificationsFeatureEnabled: Boolean @ChecksSdkIntAtLeast(33) get() = Build.VERSION.SDK_INT >= 33 @@ -62,6 +80,9 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { override val isAboutFeatureEnabled: Boolean get() = true + override val settingsWindowInsets: WindowInsets + @Composable get() = displayCutoutWindowInsets + override val bottomBarModifier: Modifier get() = Modifier @@ -105,4 +126,18 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { } } } + + override val enabledIcon: IconAlias + get() = context.enabledIcon + + override fun setIcon(iconAlias: IconAlias) { + context.setIcon(iconAlias) + } + + override val grammaticalGender: SealedString + get() = context.currentGrammaticalGender + + override fun setGrammaticalGender(grammaticalGender: Int) { + context.supportSetRequestedApplicationGrammaticalGender(grammaticalGender) + } } \ No newline at end of file diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SettingsUiInteractor.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SettingsUiInteractor.kt index 295ac3ec0..8b7aa8358 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SettingsUiInteractor.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SettingsUiInteractor.kt @@ -1,7 +1,10 @@ package org.michaelbel.movies.interactor +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import org.michaelbel.movies.common.SealedString +import org.michaelbel.movies.ui.appicon.IconAlias interface SettingsUiInteractor { @@ -17,6 +20,10 @@ interface SettingsUiInteractor { val isGenderFeatureEnabled: Boolean + val isDynamicColorsFeatureEnabled: Boolean + + val isPaletteColorsFeatureEnabled: Boolean + val isNotificationsFeatureEnabled: Boolean val isBiometricFeatureEnabled: Boolean @@ -37,6 +44,9 @@ interface SettingsUiInteractor { val isAboutFeatureEnabled: Boolean + @get:Composable + val settingsWindowInsets: WindowInsets + val bottomBarModifier: Modifier @Composable @@ -48,4 +58,12 @@ interface SettingsUiInteractor { onPermissionGranted: () -> Unit, onPermissionDenied: () -> Unit ): () -> Unit + + val enabledIcon: IconAlias + + fun setIcon(iconAlias: IconAlias) + + val grammaticalGender: SealedString + + fun setGrammaticalGender(grammaticalGender: Int) } \ No newline at end of file diff --git a/core/interactor/src/iosMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt b/core/interactor/src/iosMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt index 2fdf6e595..8852a6cdc 100644 --- a/core/interactor/src/iosMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt +++ b/core/interactor/src/iosMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt @@ -1,9 +1,14 @@ package org.michaelbel.movies.interactor.impl +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.michaelbel.movies.common.SealedString +import org.michaelbel.movies.common.gender.GrammaticalGender import org.michaelbel.movies.interactor.SettingsUiInteractor +import org.michaelbel.movies.ui.appicon.IconAlias class SettingsUiInteractorImpl: SettingsUiInteractor { @@ -25,6 +30,12 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { override val isGenderFeatureEnabled: Boolean get() = false + override val isDynamicColorsFeatureEnabled: Boolean + get() = false + + override val isPaletteColorsFeatureEnabled: Boolean + get() = false + override val isNotificationsFeatureEnabled: Boolean get() = false @@ -55,6 +66,9 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { override val isAboutFeatureEnabled: Boolean get() = true + override val settingsWindowInsets: WindowInsets + @Composable get() = WindowInsets(0.dp, 0.dp, 0.dp, 0.dp) + override val bottomBarModifier: Modifier get() = Modifier.navigationBarsPadding() @@ -71,4 +85,14 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { ): () -> Unit { return {} } + + override val enabledIcon: IconAlias + get() = IconAlias.Red + + override fun setIcon(iconAlias: IconAlias) {} + + override val grammaticalGender: SealedString + get() = GrammaticalGender.NotSpecified() + + override fun setGrammaticalGender(grammaticalGender: Int) {} } \ No newline at end of file diff --git a/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt b/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt index 3cd4a6520..fcf9f4cdc 100644 --- a/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt +++ b/core/interactor/src/jvmMain/kotlin/org/michaelbel/movies/interactor/impl/SettingsUiInteractorImpl.kt @@ -1,8 +1,13 @@ package org.michaelbel.movies.interactor.impl +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.michaelbel.movies.common.SealedString +import org.michaelbel.movies.common.gender.GrammaticalGender import org.michaelbel.movies.interactor.SettingsUiInteractor +import org.michaelbel.movies.ui.appicon.IconAlias class SettingsUiInteractorImpl: SettingsUiInteractor { @@ -24,6 +29,12 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { override val isGenderFeatureEnabled: Boolean get() = false + override val isDynamicColorsFeatureEnabled: Boolean + get() = false + + override val isPaletteColorsFeatureEnabled: Boolean + get() = false + override val isNotificationsFeatureEnabled: Boolean get() = false @@ -54,6 +65,9 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { override val isAboutFeatureEnabled: Boolean get() = true + override val settingsWindowInsets: WindowInsets + @Composable get() = WindowInsets(0.dp, 0.dp, 0.dp, 0.dp) + override val bottomBarModifier: Modifier get() = Modifier @@ -70,4 +84,14 @@ class SettingsUiInteractorImpl: SettingsUiInteractor { ): () -> Unit { return {} } + + override val enabledIcon: IconAlias + get() = IconAlias.Red + + override fun setIcon(iconAlias: IconAlias) {} + + override val grammaticalGender: SealedString + get() = GrammaticalGender.NotSpecified() + + override fun setGrammaticalGender(grammaticalGender: Int) {} } \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.android.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.android.kt similarity index 53% rename from feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.android.kt rename to core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.android.kt index 89a996c51..20e0595f6 100644 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.android.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.android.kt @@ -1,8 +1,8 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource -import org.michaelbel.movies.settings_impl.R +import org.michaelbel.movies.ui.R -internal actual val SettingsGenderText: String +actual val SettingsGenderText: String @Composable get() = stringResource(R.string.settings_gender) \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/GrammaticalGenderKtx.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/GrammaticalGenderKtx.kt similarity index 79% rename from feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/GrammaticalGenderKtx.kt rename to core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/GrammaticalGenderKtx.kt index 256023d7d..d3a4de72a 100644 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/GrammaticalGenderKtx.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/GrammaticalGenderKtx.kt @@ -1,11 +1,11 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import android.app.GrammaticalInflectionManager import android.content.Context import android.os.Build import org.michaelbel.movies.common.gender.GrammaticalGender -internal val Context.currentGrammaticalGender: GrammaticalGender +val Context.currentGrammaticalGender: GrammaticalGender get() { return if (Build.VERSION.SDK_INT >= 34) { val grammaticalInflectionManager = getSystemService(GrammaticalInflectionManager::class.java) @@ -16,7 +16,7 @@ internal val Context.currentGrammaticalGender: GrammaticalGender } } -internal fun Context.supportSetRequestedApplicationGrammaticalGender(grammaticalGender: Int) { +fun Context.supportSetRequestedApplicationGrammaticalGender(grammaticalGender: Int) { if (Build.VERSION.SDK_INT >= 34) { val grammaticalInflectionManager = getSystemService(GrammaticalInflectionManager::class.java) grammaticalInflectionManager.setRequestedApplicationGrammaticalGender(grammaticalGender) diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.android.kt similarity index 97% rename from feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt rename to core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.android.kt index eaa345162..cbcba7201 100644 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.android.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import android.app.StatusBarManager import android.content.ComponentName diff --git a/feature/settings-impl/src/androidMain/res/values-ru-feminine/strings.xml b/core/ui/src/androidMain/res/values-ru-feminine/strings.xml similarity index 100% rename from feature/settings-impl/src/androidMain/res/values-ru-feminine/strings.xml rename to core/ui/src/androidMain/res/values-ru-feminine/strings.xml diff --git a/feature/settings-impl/src/androidMain/res/values-ru-masculine/strings.xml b/core/ui/src/androidMain/res/values-ru-masculine/strings.xml similarity index 100% rename from feature/settings-impl/src/androidMain/res/values-ru-masculine/strings.xml rename to core/ui/src/androidMain/res/values-ru-masculine/strings.xml diff --git a/feature/settings-impl/src/androidMain/res/values-ru-neuter/strings.xml b/core/ui/src/androidMain/res/values-ru-neuter/strings.xml similarity index 100% rename from feature/settings-impl/src/androidMain/res/values-ru-neuter/strings.xml rename to core/ui/src/androidMain/res/values-ru-neuter/strings.xml diff --git a/core/ui/src/androidMain/res/values-ru/strings.xml b/core/ui/src/androidMain/res/values-ru/strings.xml index 38798a06b..ea0df1939 100644 --- a/core/ui/src/androidMain/res/values-ru/strings.xml +++ b/core/ui/src/androidMain/res/values-ru/strings.xml @@ -13,4 +13,5 @@ Поделиться через Movies Плитка добавлена + Род \ No newline at end of file diff --git a/core/ui/src/androidMain/res/values/strings.xml b/core/ui/src/androidMain/res/values/strings.xml index 8c981e698..52b4e8012 100644 --- a/core/ui/src/androidMain/res/values/strings.xml +++ b/core/ui/src/androidMain/res/values/strings.xml @@ -13,4 +13,5 @@ Share via Movies Movies Tile added + Gender \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.kt new file mode 100644 index 000000000..a620a8471 --- /dev/null +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.kt @@ -0,0 +1,3 @@ +package org.michaelbel.movies.ui.ktx + +expect val SettingsGenderText: String \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.kt similarity index 74% rename from feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt rename to core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.kt index 9d8263d65..b4d6a690a 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import androidx.compose.runtime.Composable diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.ios.kt b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.ios.kt similarity index 71% rename from feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.ios.kt rename to core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.ios.kt index 90d9691d4..aff636b34 100644 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.ios.kt +++ b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.ios.kt @@ -1,8 +1,8 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import androidx.compose.runtime.Composable import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.ui.strings.MoviesStrings -internal actual val SettingsGenderText: String +actual val SettingsGenderText: String @Composable get() = stringResource(MoviesStrings.settings_gender) \ No newline at end of file diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.ios.kt similarity index 77% rename from feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt rename to core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.ios.kt index b8ec46fda..03ed51dbc 100644 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt +++ b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.ios.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import androidx.compose.runtime.Composable diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.desktop.kt similarity index 71% rename from feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.desktop.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.desktop.kt index 90d9691d4..aff636b34 100644 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.desktop.kt +++ b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/GenderStringKtx.desktop.kt @@ -1,8 +1,8 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import androidx.compose.runtime.Composable import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.ui.strings.MoviesStrings -internal actual val SettingsGenderText: String +actual val SettingsGenderText: String @Composable get() = stringResource(MoviesStrings.settings_gender) \ No newline at end of file diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.desktop.kt similarity index 77% rename from feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt rename to core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.desktop.kt index b8ec46fda..03ed51dbc 100644 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/TileKtx.kt +++ b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/ktx/TileKtx.desktop.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.ui.ktx import androidx.compose.runtime.Composable diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt b/core/widget/src/androidMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.android.kt similarity index 87% rename from feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt rename to core/widget/src/androidMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.android.kt index fec33c14f..af9bbb3b1 100644 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt +++ b/core/widget/src/androidMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.android.kt @@ -1,11 +1,10 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.widget.ktx import android.appwidget.AppWidgetManager import android.os.Build import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalContext -import org.michaelbel.movies.widget.ktx.pin @Composable actual fun rememberAndPinAppWidgetProvider(): () -> Unit { diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt b/core/widget/src/commonMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.kt similarity index 72% rename from feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt rename to core/widget/src/commonMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.kt index c6c8228c6..24d73a71e 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt +++ b/core/widget/src/commonMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.widget.ktx import androidx.compose.runtime.Composable diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt b/core/widget/src/iosMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.ios.kt similarity index 75% rename from feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt rename to core/widget/src/iosMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.ios.kt index f4aff5033..607ae27b6 100644 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt +++ b/core/widget/src/iosMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.ios.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.widget.ktx import androidx.compose.runtime.Composable diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt b/core/widget/src/jvmMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.desktop.kt similarity index 75% rename from feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt rename to core/widget/src/jvmMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.desktop.kt index f4aff5033..607ae27b6 100644 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/AppWidgetManagerKtx.kt +++ b/core/widget/src/jvmMain/kotlin/org/michaelbel/movies/widget/ktx/AppWidgetManagerKtx.desktop.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.settings.ktx +package org.michaelbel.movies.widget.ktx import androidx.compose.runtime.Composable diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt b/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt deleted file mode 100644 index 927c92501..000000000 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.michaelbel.movies.settings.gender.di - -import org.koin.core.module.dsl.bind -import org.koin.core.module.dsl.singleOf -import org.koin.dsl.module -import org.michaelbel.movies.settings.gender.GrammaticalGenderManager -import org.michaelbel.movies.settings.gender.impl.GrammaticalGenderManagerImpl - -actual val grammaticalGenderKoinModule = module { - singleOf(::GrammaticalGenderManagerImpl) { bind() } -} \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt b/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt deleted file mode 100644 index c32d4ad7b..000000000 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.michaelbel.movies.settings.gender.impl - -import android.content.Context -import org.michaelbel.movies.common.SealedString -import org.michaelbel.movies.settings.gender.GrammaticalGenderManager -import org.michaelbel.movies.settings.ktx.currentGrammaticalGender -import org.michaelbel.movies.settings.ktx.supportSetRequestedApplicationGrammaticalGender - -class GrammaticalGenderManagerImpl( - private val context: Context -): GrammaticalGenderManager { - - override val grammaticalGender: SealedString - get() = context.currentGrammaticalGender - - override fun setGrammaticalGender(grammaticalGender: Int) { - context.supportSetRequestedApplicationGrammaticalGender(grammaticalGender) - } -} \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt b/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt deleted file mode 100644 index f48eb5db4..000000000 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias.di - -import org.koin.core.module.dsl.bind -import org.koin.core.module.dsl.singleOf -import org.koin.dsl.module -import org.michaelbel.movies.settings.iconAlias.IconAliasInteractor -import org.michaelbel.movies.settings.iconAlias.impl.IconAliasManagerImpl - -actual val iconAliasKoinModule = module { - singleOf(::IconAliasManagerImpl) { bind() } -} \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt b/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt deleted file mode 100644 index 55cc0b3a8..000000000 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias.impl - -import android.content.Context -import org.michaelbel.movies.settings.iconAlias.IconAliasInteractor -import org.michaelbel.movies.ui.appicon.IconAlias -import org.michaelbel.movies.ui.appicon.enabledIcon -import org.michaelbel.movies.ui.appicon.setIcon - -class IconAliasManagerImpl( - private val context: Context -): IconAliasInteractor { - - override val enabledIcon: IconAlias - get() = context.enabledIcon - - override fun setIcon(iconAlias: IconAlias) { - context.setIcon(iconAlias) - } -} \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppVersionDataKtx.kt b/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppVersionDataKtx.kt deleted file mode 100644 index 6bad0e6c2..000000000 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/AppVersionDataKtx.kt +++ /dev/null @@ -1,27 +0,0 @@ -@file:Suppress("DEPRECATION") - -package org.michaelbel.movies.settings.ktx - -import android.content.Context -import android.content.pm.PackageInfo -import android.content.pm.PackageManager -import android.os.Build -import org.michaelbel.movies.settings_impl.BuildConfig - -private val Context.packageInfo: PackageInfo - get() { - return if (Build.VERSION.SDK_INT >= 33) { - packageManager.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(0L)) - } else { - packageManager.getPackageInfo(packageName, 0) - } - } - -internal val Context.versionName: String - get() = packageInfo.versionName.orEmpty() - -internal val Context.versionCode: Long - get() = if (Build.VERSION.SDK_INT >= 28) packageInfo.longVersionCode else packageInfo.versionCode.toLong() - -internal val isDebug: Boolean - get() = BuildConfig.DEBUG \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/model/Features.android.kt b/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/model/Features.android.kt deleted file mode 100644 index d0577be27..000000000 --- a/feature/settings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/model/Features.android.kt +++ /dev/null @@ -1,15 +0,0 @@ -package org.michaelbel.movies.settings.model - -import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.runtime.Composable -import com.google.android.material.color.DynamicColors -import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets - -internal actual val isDynamicColorsFeatureEnabled: Boolean - get() = DynamicColors.isDynamicColorAvailable() - -internal actual val isPaletteColorsFeatureEnabled: Boolean - get() = DynamicColors.isDynamicColorAvailable() - -internal actual val settingsWindowInsets: WindowInsets - @Composable get() = displayCutoutWindowInsets \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/res/values-ru/strings.xml b/feature/settings-impl/src/androidMain/res/values-ru/strings.xml deleted file mode 100644 index bda9c1fbc..000000000 --- a/feature/settings-impl/src/androidMain/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Род - \ No newline at end of file diff --git a/feature/settings-impl/src/androidMain/res/values/strings.xml b/feature/settings-impl/src/androidMain/res/values/strings.xml deleted file mode 100644 index 8f84274e7..000000000 --- a/feature/settings-impl/src/androidMain/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Gender - \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt index bd7c7df43..c59d41935 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/SettingsViewModel.kt @@ -25,13 +25,9 @@ import org.michaelbel.movies.platform.Flavor import org.michaelbel.movies.platform.app.AppService import org.michaelbel.movies.platform.update.UpdateListener import org.michaelbel.movies.platform.update.UpdateService -import org.michaelbel.movies.settings.gender.GrammaticalGenderManager -import org.michaelbel.movies.settings.iconAlias.IconAliasInteractor class SettingsViewModel( biometricController: BiometricController2, - val grammaticalGenderManager: GrammaticalGenderManager, - val iconAliasManager: IconAliasInteractor, val aboutInteractor: AboutInteractor, val settingsUiInteractor: SettingsUiInteractor, private val notifyManager: NotifyManager, diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.kt index 1d2f8532f..2fc44e1d4 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/di/SettingsKoinModule.kt @@ -6,16 +6,12 @@ import org.michaelbel.movies.common.biometric.di.biometricKoinModule2 import org.michaelbel.movies.common.notify.di.notifyKoinModule import org.michaelbel.movies.interactor.di.interactorKoinModule import org.michaelbel.movies.settings.SettingsViewModel -import org.michaelbel.movies.settings.gender.di.grammaticalGenderKoinModule -import org.michaelbel.movies.settings.iconAlias.di.iconAliasKoinModule val settingsKoinModule = module { includes( biometricKoinModule2, notifyKoinModule, - grammaticalGenderKoinModule, - iconAliasKoinModule, interactorKoinModule ) - viewModel { SettingsViewModel(get(), get(), get(), get(), get(), get(), get(), get(), get()) } + viewModel { SettingsViewModel(get(), get(), get(), get(), get(), get(), get()) } } \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/GrammaticalGenderManager.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/GrammaticalGenderManager.kt deleted file mode 100644 index 90f3c2fa4..000000000 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/GrammaticalGenderManager.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.michaelbel.movies.settings.gender - -import org.michaelbel.movies.common.SealedString - -interface GrammaticalGenderManager { - - val grammaticalGender: SealedString - - fun setGrammaticalGender(grammaticalGender: Int) -} \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt deleted file mode 100644 index 710143c5f..000000000 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.michaelbel.movies.settings.gender.di - -import org.koin.core.module.Module - -expect val grammaticalGenderKoinModule: Module \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/IconAliasInteractor.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/IconAliasInteractor.kt deleted file mode 100644 index fede67158..000000000 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/IconAliasInteractor.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias - -import org.michaelbel.movies.ui.appicon.IconAlias - -interface IconAliasInteractor { - - val enabledIcon: IconAlias - - fun setIcon(iconAlias: IconAlias) -} \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt deleted file mode 100644 index 039904db8..000000000 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias.di - -import org.koin.core.module.Module - -expect val iconAliasKoinModule: Module \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.kt deleted file mode 100644 index 67e68b5f1..000000000 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/GenderStringKtx.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.michaelbel.movies.settings.ktx - -internal expect val SettingsGenderText: String \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/model/Features.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/model/Features.kt deleted file mode 100644 index 5307359be..000000000 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/model/Features.kt +++ /dev/null @@ -1,7 +0,0 @@ -package org.michaelbel.movies.settings.model - -import androidx.compose.foundation.layout.WindowInsets - -internal expect val isDynamicColorsFeatureEnabled: Boolean -internal expect val isPaletteColorsFeatureEnabled: Boolean -internal expect val settingsWindowInsets: WindowInsets \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.kt index c42ec197e..196cae184 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsRoute.kt @@ -19,17 +19,14 @@ import org.michaelbel.movies.common.gender.GrammaticalGender import org.michaelbel.movies.interactor.entity.AppLanguage import org.michaelbel.movies.settings.SettingsViewModel import org.michaelbel.movies.settings.ktx.iconSnackbarTextRes -import org.michaelbel.movies.settings.ktx.rememberAndPinAppWidgetProvider -import org.michaelbel.movies.settings.ktx.requestTileService import org.michaelbel.movies.settings.model.SettingsData -import org.michaelbel.movies.settings.model.isDynamicColorsFeatureEnabled -import org.michaelbel.movies.settings.model.isPaletteColorsFeatureEnabled -import org.michaelbel.movies.settings.model.settingsWindowInsets import org.michaelbel.movies.ui.appicon.IconAlias import org.michaelbel.movies.ui.ktx.collectAsStateCommon import org.michaelbel.movies.ui.ktx.isDebug +import org.michaelbel.movies.ui.ktx.requestTileService import org.michaelbel.movies.ui.lifecycle.OnResume import org.michaelbel.movies.ui.strings.MoviesStrings +import org.michaelbel.movies.widget.ktx.rememberAndPinAppWidgetProvider @Composable fun SettingsRoute( @@ -106,16 +103,16 @@ fun SettingsRoute( ), genderData = SettingsData.ListData( isFeatureEnabled = viewModel.settingsUiInteractor.isGenderFeatureEnabled, - current = viewModel.grammaticalGenderManager.grammaticalGender, - onSelect = { gender -> viewModel.grammaticalGenderManager.setGrammaticalGender(GrammaticalGender.value(gender)) } + current = viewModel.settingsUiInteractor.grammaticalGender, + onSelect = { gender -> viewModel.settingsUiInteractor.setGrammaticalGender(GrammaticalGender.value(gender)) } ), dynamicColorsData = SettingsData.ChangedData( - isFeatureEnabled = isDynamicColorsFeatureEnabled, + isFeatureEnabled = viewModel.settingsUiInteractor.isDynamicColorsFeatureEnabled, isEnabled = themeData.dynamicColors, onChange = viewModel::setDynamicColors ), paletteColorsData = SettingsData.PaletteColorsData( - isFeatureEnabled = isPaletteColorsFeatureEnabled, + isFeatureEnabled = viewModel.settingsUiInteractor.isPaletteColorsFeatureEnabled, isDynamicColorsEnabled = themeData.dynamicColors, paletteKey = themeData.paletteKey, seedColor = themeData.seedColor, @@ -151,7 +148,7 @@ fun SettingsRoute( ), appIconData = SettingsData.ListData( isFeatureEnabled = viewModel.settingsUiInteractor.isAppIconFeatureEnabled, - current = viewModel.iconAliasManager.enabledIcon, + current = viewModel.settingsUiInteractor.enabledIcon, onSelect = { icon -> val message = when (icon) { IconAlias.Red -> messageRed @@ -160,7 +157,7 @@ fun SettingsRoute( IconAlias.Amoled -> messageAmoled } onShowSnackbar(message) - viewModel.iconAliasManager.setIcon(icon) + viewModel.settingsUiInteractor.setIcon(icon) } ), screenshotData = SettingsData.ChangedData( @@ -188,7 +185,7 @@ fun SettingsRoute( isDebug = isDebug ) ), - windowInsets = settingsWindowInsets, + windowInsets = viewModel.settingsUiInteractor.settingsWindowInsets, snackbarHostState = snackbarHostState, isNavigationIconVisible = viewModel.settingsUiInteractor.isNavigationIconVisible, bottomBarModifier = viewModel.settingsUiInteractor.bottomBarModifier, diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt index 6379525a8..3b96bd5a1 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt @@ -36,7 +36,6 @@ import org.michaelbel.movies.common.gender.GrammaticalGender import org.michaelbel.movies.common.list.MovieList import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.interactor.entity.AppLanguage -import org.michaelbel.movies.settings.ktx.SettingsGenderText import org.michaelbel.movies.settings.ktx.stringText import org.michaelbel.movies.settings.model.SettingsData import org.michaelbel.movies.settings.ui.common.SettingAppIcon @@ -45,6 +44,7 @@ import org.michaelbel.movies.settings.ui.common.SettingSwitchItem import org.michaelbel.movies.settings.ui.common.SettingsDialog import org.michaelbel.movies.ui.appicon.IconAlias import org.michaelbel.movies.ui.icons.MoviesIcons +import org.michaelbel.movies.ui.ktx.SettingsGenderText import org.michaelbel.movies.ui.strings.MoviesStrings @Composable diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt b/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt deleted file mode 100644 index 927c92501..000000000 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.michaelbel.movies.settings.gender.di - -import org.koin.core.module.dsl.bind -import org.koin.core.module.dsl.singleOf -import org.koin.dsl.module -import org.michaelbel.movies.settings.gender.GrammaticalGenderManager -import org.michaelbel.movies.settings.gender.impl.GrammaticalGenderManagerImpl - -actual val grammaticalGenderKoinModule = module { - singleOf(::GrammaticalGenderManagerImpl) { bind() } -} \ No newline at end of file diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt b/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt deleted file mode 100644 index 5b21ac0fa..000000000 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.michaelbel.movies.settings.gender.impl - -import org.michaelbel.movies.common.SealedString -import org.michaelbel.movies.common.gender.GrammaticalGender -import org.michaelbel.movies.settings.gender.GrammaticalGenderManager - -class GrammaticalGenderManagerImpl: GrammaticalGenderManager { - - override val grammaticalGender: SealedString - get() = GrammaticalGender.NotSpecified() - - override fun setGrammaticalGender(grammaticalGender: Int) {} -} \ No newline at end of file diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt b/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt deleted file mode 100644 index f48eb5db4..000000000 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias.di - -import org.koin.core.module.dsl.bind -import org.koin.core.module.dsl.singleOf -import org.koin.dsl.module -import org.michaelbel.movies.settings.iconAlias.IconAliasInteractor -import org.michaelbel.movies.settings.iconAlias.impl.IconAliasManagerImpl - -actual val iconAliasKoinModule = module { - singleOf(::IconAliasManagerImpl) { bind() } -} \ No newline at end of file diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt b/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt deleted file mode 100644 index 41d8a6785..000000000 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias.impl - -import org.michaelbel.movies.settings.iconAlias.IconAliasInteractor -import org.michaelbel.movies.ui.appicon.IconAlias - -class IconAliasManagerImpl: IconAliasInteractor { - - override val enabledIcon: IconAlias - get() = IconAlias.Red - - override fun setIcon(iconAlias: IconAlias) {} -} \ No newline at end of file diff --git a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/model/Features.ios.kt b/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/model/Features.ios.kt deleted file mode 100644 index 4bad23bef..000000000 --- a/feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/model/Features.ios.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.michaelbel.movies.settings.model - -import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.ui.unit.dp - -internal actual val isDynamicColorsFeatureEnabled: Boolean - get() = false - -internal actual val isPaletteColorsFeatureEnabled: Boolean - get() = false - -internal actual val settingsWindowInsets: WindowInsets - get() = WindowInsets(0.dp, 0.dp, 0.dp, 0.dp) \ No newline at end of file diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt deleted file mode 100644 index 927c92501..000000000 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/di/GrammaticalGenderKoinModule.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.michaelbel.movies.settings.gender.di - -import org.koin.core.module.dsl.bind -import org.koin.core.module.dsl.singleOf -import org.koin.dsl.module -import org.michaelbel.movies.settings.gender.GrammaticalGenderManager -import org.michaelbel.movies.settings.gender.impl.GrammaticalGenderManagerImpl - -actual val grammaticalGenderKoinModule = module { - singleOf(::GrammaticalGenderManagerImpl) { bind() } -} \ No newline at end of file diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt deleted file mode 100644 index 5b21ac0fa..000000000 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/gender/impl/GrammaticalGenderManagerImpl.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.michaelbel.movies.settings.gender.impl - -import org.michaelbel.movies.common.SealedString -import org.michaelbel.movies.common.gender.GrammaticalGender -import org.michaelbel.movies.settings.gender.GrammaticalGenderManager - -class GrammaticalGenderManagerImpl: GrammaticalGenderManager { - - override val grammaticalGender: SealedString - get() = GrammaticalGender.NotSpecified() - - override fun setGrammaticalGender(grammaticalGender: Int) {} -} \ No newline at end of file diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt deleted file mode 100644 index f48eb5db4..000000000 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/di/IconAliasKoinModule.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias.di - -import org.koin.core.module.dsl.bind -import org.koin.core.module.dsl.singleOf -import org.koin.dsl.module -import org.michaelbel.movies.settings.iconAlias.IconAliasInteractor -import org.michaelbel.movies.settings.iconAlias.impl.IconAliasManagerImpl - -actual val iconAliasKoinModule = module { - singleOf(::IconAliasManagerImpl) { bind() } -} \ No newline at end of file diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt deleted file mode 100644 index 41d8a6785..000000000 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/iconAlias/impl/IconAliasManagerImpl.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.michaelbel.movies.settings.iconAlias.impl - -import org.michaelbel.movies.settings.iconAlias.IconAliasInteractor -import org.michaelbel.movies.ui.appicon.IconAlias - -class IconAliasManagerImpl: IconAliasInteractor { - - override val enabledIcon: IconAlias - get() = IconAlias.Red - - override fun setIcon(iconAlias: IconAlias) {} -} \ No newline at end of file diff --git a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt b/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt deleted file mode 100644 index 4bad23bef..000000000 --- a/feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/model/Features.desktop.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.michaelbel.movies.settings.model - -import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.ui.unit.dp - -internal actual val isDynamicColorsFeatureEnabled: Boolean - get() = false - -internal actual val isPaletteColorsFeatureEnabled: Boolean - get() = false - -internal actual val settingsWindowInsets: WindowInsets - get() = WindowInsets(0.dp, 0.dp, 0.dp, 0.dp) \ No newline at end of file