diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/main/domain/usecase/CheckLowBalanceUC.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/main/domain/usecase/CheckLowBalanceUC.kt index 2885a64d..02be59d7 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/main/domain/usecase/CheckLowBalanceUC.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/main/domain/usecase/CheckLowBalanceUC.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023, Petr Laštovička as Lasta apps, All rights reserved + * Copyright 2024, Petr Laštovička as Lasta apps, All rights reserved * * This file is part of Menza. * @@ -22,16 +22,20 @@ package cz.lastaapps.menza.features.main.domain.usecase import cz.lastaapps.api.main.domain.usecase.wallet.WalletGetBalanceUC import cz.lastaapps.core.domain.UCContext import cz.lastaapps.core.domain.UseCase +import cz.lastaapps.menza.features.settings.domain.usecase.GetBalanceWarningThresholdUC +import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.filterNotNull -import kotlinx.coroutines.flow.map internal class CheckLowBalanceUC( context: UCContext, private val walletGetBalanceUC: WalletGetBalanceUC, + private val getBalanceWarningThreshold: GetBalanceWarningThresholdUC, ) : UseCase(context) { operator fun invoke() = walletGetBalanceUC() .filterNotNull() - .map { it.balance <= 256 } + .combine(getBalanceWarningThreshold()) { balance, threshold -> + balance.balance < threshold + } .distinctUntilChanged() } diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/MainSettingsRepoImpl.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/MainSettingsRepoImpl.kt index 14903be7..89c1e789 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/MainSettingsRepoImpl.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/MainSettingsRepoImpl.kt @@ -140,4 +140,12 @@ internal class MainSettingsRepoImpl( override fun isOliverRow(): Flow = general.isOliverRow() .map { it ?: true } + + override suspend fun setBalanceWarningThreshold(threshold: Int) = + general.setBalanceWarningThreshold(threshold) + + override fun getBalanceWarningThreshold(): Flow = + general.getBalanceWarningThreshold() + .map { it ?: 256 } + } diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/datasource/GeneralDataSource.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/datasource/GeneralDataSource.kt index 0c962f10..7c04c746 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/datasource/GeneralDataSource.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/datasource/GeneralDataSource.kt @@ -32,8 +32,6 @@ import cz.lastaapps.menza.features.settings.domain.model.DishListMode import cz.lastaapps.menza.features.settings.domain.model.PriceType import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map -import kotlinx.coroutines.flow.onCompletion -import kotlinx.coroutines.flow.onStart @OptIn(ExperimentalSettingsApi::class) @JvmInline @@ -76,6 +74,9 @@ internal interface GeneralDataSource { suspend fun setOliverRow(isUsed: Boolean) fun isOliverRow(): Flow + + suspend fun setBalanceWarningThreshold(threshold: Int) + fun getBalanceWarningThreshold(): Flow } @OptIn(ExperimentalSettingsApi::class) @@ -95,6 +96,7 @@ internal class GeneralDataSourceImpl( private const val dishLanguageKey = "dish_language" private const val compactTodayViewKey = "compact_today_view" private const val oliverRowsKey = "oliver_row" + private const val balanceWarningThresholdKey = "balance_warning_threshold" } override suspend fun storeAppSetupFinished() = @@ -171,4 +173,10 @@ internal class GeneralDataSourceImpl( override fun isOliverRow(): Flow = settings.getBooleanOrNullFlow(oliverRowsKey) + + override suspend fun setBalanceWarningThreshold(threshold: Int) = + settings.putInt(balanceWarningThresholdKey, threshold) + + override fun getBalanceWarningThreshold(): Flow = + settings.getIntOrNullFlow(balanceWarningThresholdKey) } diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/di/settingsModule.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/di/settingsModule.kt index 8e5da990..6bd11b71 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/di/settingsModule.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/di/settingsModule.kt @@ -35,15 +35,17 @@ import cz.lastaapps.menza.features.settings.data.datasource.OrderSettings import cz.lastaapps.menza.features.settings.domain.MainSettingsRepo import cz.lastaapps.menza.features.settings.domain.OrderRepo import cz.lastaapps.menza.features.settings.domain.usecase.FullAppReloadUC +import cz.lastaapps.menza.features.settings.domain.usecase.GetBalanceWarningThresholdUC import cz.lastaapps.menza.features.settings.domain.usecase.GetDishLanguageUC import cz.lastaapps.menza.features.settings.domain.usecase.GetDishListModeUC import cz.lastaapps.menza.features.settings.domain.usecase.GetImageScaleRangeUC import cz.lastaapps.menza.features.settings.domain.usecase.GetImageScaleUC import cz.lastaapps.menza.features.settings.domain.usecase.GetImagesOnMeteredUC -import cz.lastaapps.menza.features.settings.domain.usecase.GetOliverRow +import cz.lastaapps.menza.features.settings.domain.usecase.GetOliverRowUC import cz.lastaapps.menza.features.settings.domain.usecase.GetPriceTypeUC import cz.lastaapps.menza.features.settings.domain.usecase.GetSettingsEverOpenedUC import cz.lastaapps.menza.features.settings.domain.usecase.OnSettingsOpenedUC +import cz.lastaapps.menza.features.settings.domain.usecase.SetBalanceWarningThresholdUC import cz.lastaapps.menza.features.settings.domain.usecase.SetDishLanguageUC import cz.lastaapps.menza.features.settings.domain.usecase.SetDishListModeUC import cz.lastaapps.menza.features.settings.domain.usecase.SetImageScaleUC @@ -89,9 +91,9 @@ val settingsModule = module { factory { // @formatter:off SettingsViewModel( + get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), - get(), get(), get(), get(), ) // @formatter:on } @@ -116,7 +118,9 @@ val settingsModule = module { // Others factoryOf(::GetImageScaleUC) factoryOf(::GetImagesOnMeteredUC) - factoryOf(::GetOliverRow) + factoryOf(::GetBalanceWarningThresholdUC) + factoryOf(::SetBalanceWarningThresholdUC) + factoryOf(::GetOliverRowUC) factoryOf(::GetPriceTypeUC) factoryOf(::GetSettingsEverOpenedUC) factoryOf(::GetDishLanguageUC) diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/MainSettingsRepo.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/MainSettingsRepo.kt index dd570443..c7fe5074 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/MainSettingsRepo.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/MainSettingsRepo.kt @@ -70,4 +70,7 @@ internal interface MainSettingsRepo { suspend fun setOliverRows(useOliverRows: Boolean) fun isOliverRow(): Flow + + suspend fun setBalanceWarningThreshold(threshold: Int) + fun getBalanceWarningThreshold(): Flow } diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetBalanceWarningThresholdUC.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetBalanceWarningThresholdUC.kt new file mode 100644 index 00000000..18263327 --- /dev/null +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetBalanceWarningThresholdUC.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2024, Petr Laštovička as Lasta apps, All rights reserved + * + * This file is part of Menza. + * + * Menza is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Menza is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Menza. If not, see . + */ + +package cz.lastaapps.menza.features.settings.domain.usecase + +import cz.lastaapps.core.domain.UCContext +import cz.lastaapps.core.domain.UseCase +import cz.lastaapps.menza.features.settings.domain.MainSettingsRepo + +class GetBalanceWarningThresholdUC internal constructor( + context: UCContext, + private val repo: MainSettingsRepo, +) : UseCase(context) { + operator fun invoke() = repo.getBalanceWarningThreshold() +} diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetOliverRow.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetOliverRowUC.kt similarity index 96% rename from app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetOliverRow.kt rename to app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetOliverRowUC.kt index b93e973b..61f68c9f 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetOliverRow.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/GetOliverRowUC.kt @@ -23,7 +23,7 @@ import cz.lastaapps.core.domain.UCContext import cz.lastaapps.core.domain.UseCase import cz.lastaapps.menza.features.settings.domain.MainSettingsRepo -class GetOliverRow internal constructor( +class GetOliverRowUC internal constructor( context: UCContext, private val repo: MainSettingsRepo, ) : UseCase(context) { diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/SetBalanceWarningThresholdUC.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/SetBalanceWarningThresholdUC.kt new file mode 100644 index 00000000..b835d737 --- /dev/null +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/domain/usecase/SetBalanceWarningThresholdUC.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2024, Petr Laštovička as Lasta apps, All rights reserved + * + * This file is part of Menza. + * + * Menza is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Menza is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Menza. If not, see . + */ + +package cz.lastaapps.menza.features.settings.domain.usecase + +import cz.lastaapps.core.domain.UCContext +import cz.lastaapps.core.domain.UseCase +import cz.lastaapps.menza.features.settings.domain.MainSettingsRepo + +class SetBalanceWarningThresholdUC internal constructor( + context: UCContext, + private val repo: MainSettingsRepo, +) : UseCase(context) { + suspend operator fun invoke(threshold: Int) = launch { + repo.setBalanceWarningThreshold(threshold) + } +} diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/component/SettingsComponent.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/component/SettingsComponent.kt index 5e1342c2..1bedf78f 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/component/SettingsComponent.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/component/SettingsComponent.kt @@ -99,6 +99,8 @@ internal fun SettingsContent( onDiscounterPrices = viewModel::setPriceType, downloadOnMetered = state.downloadOnMetered, onDownloadOnMetered = viewModel::setDownloadOnMetered, + balanceThreshold = state.balanceWarningThreshold, + onBalanceThreshold = viewModel::setBalanceWarningThreshold, initialMenzaBehaviour = state.initialMenzaBehaviour, onInitialMenzaBehaviour = viewModel::setInitMenzaBehaviour, menzaList = state.menzaList, diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/screens/SettingsScreen.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/screens/SettingsScreen.kt index ae4473df..8b1d892f 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/screens/SettingsScreen.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/screens/SettingsScreen.kt @@ -69,6 +69,7 @@ import cz.lastaapps.menza.features.settings.domain.model.DarkMode import cz.lastaapps.menza.features.settings.domain.model.InitialSelectionBehaviour import cz.lastaapps.menza.features.settings.domain.model.PriceType import cz.lastaapps.menza.features.settings.ui.util.name +import cz.lastaapps.menza.features.settings.ui.widget.BalanceThresholdSlider import cz.lastaapps.menza.features.settings.ui.widget.FullReloadDialog import cz.lastaapps.menza.features.settings.ui.widget.SettingsItem import cz.lastaapps.menza.features.settings.ui.widget.SettingsSwitch @@ -89,6 +90,8 @@ internal fun SettingsScreen( onDiscounterPrices: (PriceType) -> Unit, downloadOnMetered: Boolean, onDownloadOnMetered: (Boolean) -> Unit, + balanceThreshold: Int, + onBalanceThreshold: (Int) -> Unit, initialMenzaBehaviour: InitialSelectionBehaviour, onInitialMenzaBehaviour: (InitialSelectionBehaviour) -> Unit, menzaList: ImmutableList, @@ -146,6 +149,12 @@ internal fun SettingsScreen( onChecked = onDownloadOnMetered, ) + BalanceThresholdSlider( + title = stringResource(id = R.string.settings_balance_threshold_title), + threshold = balanceThreshold, + onThreshold = onBalanceThreshold, + ) + // Behaviour at startup InitialBehaviourSelector( initialMenzaBehaviour = initialMenzaBehaviour, @@ -294,7 +303,7 @@ private fun FullDataReload( if (showFullReload) { FullReloadDialog( onDismissRequest = { showFullReload = false }, - onConfirm = onFullRefresh + onConfirm = onFullRefresh, ) } @@ -358,6 +367,8 @@ private fun SettingsScreenPreview() = PreviewWrapper { onDiscounterPrices = {}, downloadOnMetered = false, onDownloadOnMetered = {}, + balanceThreshold = 256, + onBalanceThreshold = {}, initialMenzaBehaviour = InitialSelectionBehaviour.Specific, onInitialMenzaBehaviour = {}, menzaList = persistentListOf(), diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/vm/SettingsViewModel.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/vm/SettingsViewModel.kt index 34d29105..f3c53ae0 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/vm/SettingsViewModel.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/vm/SettingsViewModel.kt @@ -31,9 +31,11 @@ import cz.lastaapps.menza.features.settings.domain.model.DarkMode.Dark import cz.lastaapps.menza.features.settings.domain.model.InitialSelectionBehaviour import cz.lastaapps.menza.features.settings.domain.model.PriceType import cz.lastaapps.menza.features.settings.domain.usecase.FullAppReloadUC +import cz.lastaapps.menza.features.settings.domain.usecase.GetBalanceWarningThresholdUC import cz.lastaapps.menza.features.settings.domain.usecase.GetImagesOnMeteredUC import cz.lastaapps.menza.features.settings.domain.usecase.GetPriceTypeUC import cz.lastaapps.menza.features.settings.domain.usecase.OnSettingsOpenedUC +import cz.lastaapps.menza.features.settings.domain.usecase.SetBalanceWarningThresholdUC import cz.lastaapps.menza.features.settings.domain.usecase.SetImagesOnMeteredUC import cz.lastaapps.menza.features.settings.domain.usecase.SetPriceTypeUC import cz.lastaapps.menza.features.settings.domain.usecase.initialmenza.GetInitialMenzaModeUI @@ -56,6 +58,8 @@ internal class SettingsViewModel( val setPriceTypeUC: SetPriceTypeUC, val getImagesOnMeteredUC: GetImagesOnMeteredUC, val setImagesOnMeteredUC: SetImagesOnMeteredUC, + val getBalanceWarningThresholdUC: GetBalanceWarningThresholdUC, + val setBalanceWarningThresholdUC: SetBalanceWarningThresholdUC, val getMenzaListUC: GetOrderedVisibleMenzaListUC, val getInitialMenzaUC: GetInitialMenzaModeUI, val setInitialMenzaUC: SetInitialMenzaUC, @@ -78,6 +82,9 @@ internal class SettingsViewModel( getImagesOnMeteredUC().onEach { updateState { copy(downloadOnMetered = it) } }.launchInVM() + getBalanceWarningThresholdUC().onEach { + updateState { copy(balanceWarningThreshold = it) } + }.launchInVM() getInitialMenzaUC().onEach { updateState { copy(initialMenzaBehaviour = it) } }.launchInVM() @@ -101,6 +108,10 @@ internal class SettingsViewModel( setImagesOnMeteredUC(enable) } + fun setBalanceWarningThreshold(threshold: Int) = launchVM { + setBalanceWarningThresholdUC(threshold) + } + fun setInitMenzaBehaviour(behaviour: InitialSelectionBehaviour) = launchVM { setInitialMenzaUC(behaviour) } @@ -120,6 +131,7 @@ internal data class SettingsState( val darkMode: DarkMode = Dark, val priceType: PriceType = PriceType.Unset, val downloadOnMetered: Boolean = false, + val balanceWarningThreshold: Int = 0, val initialMenzaBehaviour: InitialSelectionBehaviour = InitialSelectionBehaviour.Ask, val menzaList: ImmutableList = persistentListOf(), val selectedMenza: Menza? = null, diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/widget/BalanceThresholdSlider.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/widget/BalanceThresholdSlider.kt new file mode 100644 index 00000000..eb6e24f5 --- /dev/null +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/widget/BalanceThresholdSlider.kt @@ -0,0 +1,129 @@ +/* + * Copyright 2024, Petr Laštovička as Lasta apps, All rights reserved + * + * This file is part of Menza. + * + * Menza is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Menza is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Menza. If not, see . + */ + +package cz.lastaapps.menza.features.settings.ui.widget + +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentWidth +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Label +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.PlainTooltip +import androidx.compose.material3.Slider +import androidx.compose.material3.SliderDefaults +import androidx.compose.material3.Text +import androidx.compose.material3.TooltipDefaults +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableFloatStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import cz.lastaapps.menza.R +import cz.lastaapps.menza.ui.theme.Padding +import cz.lastaapps.menza.ui.util.PreviewWrapper +import kotlin.math.roundToInt + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun BalanceThresholdSlider( + title: String, + threshold: Int, + onThreshold: (Int) -> Unit, + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier + .padding(SettingsTokens.itemPadding) + .fillMaxWidth(), + verticalArrangement = Arrangement.spacedBy(Padding.Small), + ) { + Row( + verticalAlignment = Alignment.CenterVertically, + ) { + SettingsTitle(text = title, modifier = Modifier.weight(1f)) + Text(threshold.thresholdText()) + } + + var localThreshold by remember(threshold) { mutableFloatStateOf(threshold.toFloat()) } + + val interactionSource = remember { MutableInteractionSource() } + + Slider( + value = localThreshold, + onValueChange = { localThreshold = it }, + onValueChangeFinished = { onThreshold(localThreshold.roundToInt()) }, + modifier = Modifier.padding(horizontal = Padding.Tiny), + valueRange = 0f..420f, + steps = 420 / 10 - 1, + interactionSource = interactionSource, + thumb = { + Label( + label = { + PlainTooltip( + caretSize = TooltipDefaults.caretSize, + modifier = Modifier.wrapContentWidth(), + shape = CircleShape, + ) { + Text( + it.value.roundToInt().thresholdText(), + style = MaterialTheme.typography.bodyMedium, + ) + } + }, + interactionSource = interactionSource, + ) { + SliderDefaults.Thumb(interactionSource = interactionSource) + } + }, + ) + } +} + +@Composable +private fun Int.thresholdText() = + if (this > 0) { + "%d Kč".format(this) + } else { + stringResource(R.string.settings_balance_threshold_disabled) + } + +@Preview +@Composable +private fun BalanceThresholdSliderPreview() = PreviewWrapper { + BalanceThresholdSlider( + title = stringResource(id = R.string.settings_balance_threshold_title), + threshold = 0, + {}, + ) + BalanceThresholdSlider( + title = stringResource(id = R.string.settings_balance_threshold_title), + threshold = 256, + {}, + ) +} diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/widget/SettingsTitle.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/widget/SettingsTitle.kt index f4bd25cc..542cfcb6 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/widget/SettingsTitle.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/settings/ui/widget/SettingsTitle.kt @@ -19,13 +19,11 @@ package cz.lastaapps.menza.features.settings.ui.widget -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.basicMarquee import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -@OptIn(ExperimentalFoundationApi::class) @Composable internal fun SettingsTitle( text: String, diff --git a/app/src/main/kotlin/cz/lastaapps/menza/features/today/domain/usecase/GetTodayUserSettingsUC.kt b/app/src/main/kotlin/cz/lastaapps/menza/features/today/domain/usecase/GetTodayUserSettingsUC.kt index 6fbdb0bd..035bbcbc 100644 --- a/app/src/main/kotlin/cz/lastaapps/menza/features/today/domain/usecase/GetTodayUserSettingsUC.kt +++ b/app/src/main/kotlin/cz/lastaapps/menza/features/today/domain/usecase/GetTodayUserSettingsUC.kt @@ -25,20 +25,19 @@ import cz.lastaapps.menza.features.settings.domain.usecase.GetDishLanguageUC import cz.lastaapps.menza.features.settings.domain.usecase.GetDishListModeUC import cz.lastaapps.menza.features.settings.domain.usecase.GetImageScaleUC import cz.lastaapps.menza.features.settings.domain.usecase.GetImagesOnMeteredUC -import cz.lastaapps.menza.features.settings.domain.usecase.GetOliverRow +import cz.lastaapps.menza.features.settings.domain.usecase.GetOliverRowUC import cz.lastaapps.menza.features.settings.domain.usecase.GetPriceTypeUC import cz.lastaapps.menza.features.today.domain.model.TodayUserSettings import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.channelFlow -import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update internal class GetTodayUserSettingsUC( context: UCContext, - private val getOliverRowUC: GetOliverRow, + private val getOliverRowUC: GetOliverRowUC, private val getPriceTypeUC: GetPriceTypeUC, private val getImagesOnMeteredUC: GetImagesOnMeteredUC, private val getImageScaleUC: GetImageScaleUC, diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 204a0e03..504f7028 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -110,6 +110,8 @@ Menu v češtině/angličtině Obrázky na datech Každý obrázek spotřebuje ~0.7 MB + Varování konta + Vypnuto Škálování obrázků Zásady ochrany osobních údajů O aplikaci diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4783d56c..1bf6c0c0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -123,6 +123,8 @@ Czech/English menu language Images on metered Each image takes ~0.7 MB + Balance warning + Disabled Image scaling Privacy policy About