Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Nov 25, 2024
1 parent 7e52e14 commit 1efece0
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 511 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package org.michaelbel.movies.settings.model

import android.os.Build
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 isNavigationIconVisible: Boolean
get() = false

internal actual val isLanguageFeatureEnabled: Boolean
get() = true
Expand All @@ -21,6 +27,9 @@ internal actual val isGenderFeatureEnabled: Boolean
internal actual val isDynamicColorsFeatureEnabled: Boolean
get() = DynamicColors.isDynamicColorAvailable()

internal actual val isPaletteColorsFeatureEnabled: Boolean
get() = DynamicColors.isDynamicColorAvailable()

internal actual val isNotificationsFeatureEnabled: Boolean
get() = Build.VERSION.SDK_INT >= 33

Expand Down Expand Up @@ -49,4 +58,7 @@ internal actual val isUpdateAppFeatureEnabled: Boolean
get() = true

internal actual val isAboutFeatureEnabled: Boolean
get() = true
get() = true

internal actual val settingsWindowInsets: WindowInsets
@Composable get() = displayCutoutWindowInsets

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package org.michaelbel.movies.settings.model

import androidx.compose.foundation.layout.WindowInsets

internal expect val isNavigationIconVisible: Boolean
internal expect val isLanguageFeatureEnabled: Boolean
internal expect val isThemeFeatureEnabled: Boolean
internal expect val isFeedViewFeatureEnabled: Boolean
internal expect val isMovieListFeatureEnabled: Boolean
internal expect val isGenderFeatureEnabled: Boolean
internal expect val isDynamicColorsFeatureEnabled: Boolean
internal expect val isPaletteColorsFeatureEnabled: Boolean
internal expect val isNotificationsFeatureEnabled: Boolean
internal expect val isBiometricFeatureEnabled: Boolean
internal expect val isWidgetFeatureEnabled: Boolean
Expand All @@ -15,4 +19,5 @@ internal expect val isScreenshotFeatureEnabled: Boolean
internal expect val isGithubFeatureEnabled: Boolean
internal expect val isReviewAppFeatureEnabled: Boolean
internal expect val isUpdateAppFeatureEnabled: Boolean
internal expect val isAboutFeatureEnabled: Boolean
internal expect val isAboutFeatureEnabled: Boolean
internal expect val settingsWindowInsets: WindowInsets
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,30 @@ import org.michaelbel.movies.settings.model.isGenderFeatureEnabled
import org.michaelbel.movies.settings.model.isGithubFeatureEnabled
import org.michaelbel.movies.settings.model.isLanguageFeatureEnabled
import org.michaelbel.movies.settings.model.isMovieListFeatureEnabled
import org.michaelbel.movies.settings.model.isNavigationIconVisible
import org.michaelbel.movies.settings.model.isNotificationsFeatureEnabled
import org.michaelbel.movies.settings.model.isPaletteColorsFeatureEnabled
import org.michaelbel.movies.settings.model.isReviewAppFeatureEnabled
import org.michaelbel.movies.settings.model.isScreenshotFeatureEnabled
import org.michaelbel.movies.settings.model.isThemeFeatureEnabled
import org.michaelbel.movies.settings.model.isTileFeatureEnabled
import org.michaelbel.movies.settings.model.isUpdateAppFeatureEnabled
import org.michaelbel.movies.settings.model.isWidgetFeatureEnabled
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.displayCutoutWindowInsets
import org.michaelbel.movies.ui.ktx.isDebug
import org.michaelbel.movies.ui.lifecycle.OnResume
import org.michaelbel.movies.ui.strings.MoviesStrings

@Composable
fun SettingsRoute2(
fun SettingsRoute(
onBackClick: () -> Unit,
onRequestReview: () -> Unit,
onRequestUpdate: () -> Unit,
modifier: Modifier = Modifier,
viewModel: SettingsViewModel = koinViewModel()
) {
val currentLanguage = AppLanguage.transform(stringResource(MoviesStrings.language_code))
val themeData by viewModel.themeData.collectAsStateCommon()
val currentFeedView by viewModel.currentFeedView.collectAsStateCommon()
val currentMovieList by viewModel.currentMovieList.collectAsStateCommon()
Expand Down Expand Up @@ -103,7 +104,7 @@ fun SettingsRoute2(
onBackClick = onBackClick,
languageData = SettingsData.ListData(
isFeatureEnabled = isLanguageFeatureEnabled,
current = currentLanguage,
current = AppLanguage.transform(stringResource(MoviesStrings.language_code)),
onSelect = viewModel::selectLanguage
),
themeData = SettingsData.ListData(
Expand All @@ -124,17 +125,15 @@ fun SettingsRoute2(
genderData = SettingsData.ListData(
isFeatureEnabled = isGenderFeatureEnabled,
current = viewModel.grammaticalGenderManager.grammaticalGender,
onSelect = { gender ->
viewModel.grammaticalGenderManager.setGrammaticalGender(GrammaticalGender.value(gender))
}
onSelect = { gender -> viewModel.grammaticalGenderManager.setGrammaticalGender(GrammaticalGender.value(gender)) }
),
dynamicColorsData = SettingsData.ChangedData(
isFeatureEnabled = isDynamicColorsFeatureEnabled,
isEnabled = themeData.dynamicColors,
onChange = viewModel::setDynamicColors
),
paletteColorsData = SettingsData.PaletteColorsData(
isFeatureEnabled = isDynamicColorsFeatureEnabled,
isFeatureEnabled = isPaletteColorsFeatureEnabled,
isDynamicColorsEnabled = themeData.dynamicColors,
paletteKey = themeData.paletteKey,
seedColor = themeData.seedColor,
Expand Down Expand Up @@ -207,9 +206,9 @@ fun SettingsRoute2(
isDebug = isDebug
)
),
windowInsets = displayCutoutWindowInsets,
windowInsets = settingsWindowInsets,
snackbarHostState = snackbarHostState,
isNavigationIconVisible = false,
isNavigationIconVisible = isNavigationIconVisible,
modifier = modifier
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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() = TODO()
get() = GrammaticalGender.NotSpecified()

override fun setGrammaticalGender(grammaticalGender: Int) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.michaelbel.movies.ui.appicon.IconAlias
class IconAliasManagerImpl: IconAliasManager {

override val enabledIcon: IconAlias
get() = TODO()
get() = IconAlias.Red

override fun setIcon(iconAlias: IconAlias) {}
}
Loading

0 comments on commit 1efece0

Please sign in to comment.