From 4bdd0e61bc1fd3ac22827c647afc9777443e668e Mon Sep 17 00:00:00 2001 From: Diego Beraldin Date: Thu, 25 Jan 2024 22:54:51 +0100 Subject: [PATCH] feat: move color and fonts to separate screen (#485) --- .../colors/SettingsColorAndFontMviModel.kt | 37 ++ .../colors/SettingsColorAndFontScreen.kt | 263 ++++++++++++++ .../colors/SettingsColorAndFontViewModel.kt | 243 +++++++++++++ .../feature/settings/di/SettingsModule.kt | 14 +- .../feature/settings/main/SettingsMviModel.kt | 25 -- .../feature/settings/main/SettingsScreen.kt | 176 +-------- .../settings/main/SettingsViewModel.kt | 333 ++---------------- .../commonMain/resources/MR/ar/strings.xml | 1 + .../commonMain/resources/MR/base/strings.xml | 1 + .../commonMain/resources/MR/bg/strings.xml | 1 + .../commonMain/resources/MR/cs/strings.xml | 1 + .../commonMain/resources/MR/da/strings.xml | 1 + .../commonMain/resources/MR/de/strings.xml | 1 + .../commonMain/resources/MR/el/strings.xml | 1 + .../commonMain/resources/MR/eo/strings.xml | 1 + .../commonMain/resources/MR/es/strings.xml | 1 + .../commonMain/resources/MR/et/strings.xml | 1 + .../commonMain/resources/MR/fi/strings.xml | 1 + .../commonMain/resources/MR/fr/strings.xml | 1 + .../commonMain/resources/MR/ga/strings.xml | 1 + .../commonMain/resources/MR/hr/strings.xml | 1 + .../commonMain/resources/MR/hu/strings.xml | 1 + .../commonMain/resources/MR/it/strings.xml | 1 + .../commonMain/resources/MR/lt/strings.xml | 1 + .../commonMain/resources/MR/lv/strings.xml | 1 + .../commonMain/resources/MR/mt/strings.xml | 1 + .../commonMain/resources/MR/nl/strings.xml | 1 + .../commonMain/resources/MR/no/strings.xml | 1 + .../commonMain/resources/MR/pl/strings.xml | 1 + .../commonMain/resources/MR/pt-BR/strings.xml | 1 + .../commonMain/resources/MR/pt/strings.xml | 1 + .../commonMain/resources/MR/ro/strings.xml | 1 + .../commonMain/resources/MR/ru/strings.xml | 1 + .../commonMain/resources/MR/se/strings.xml | 1 + .../commonMain/resources/MR/sk/strings.xml | 1 + .../commonMain/resources/MR/sl/strings.xml | 1 + .../commonMain/resources/MR/sq/strings.xml | 1 + .../commonMain/resources/MR/tok/strings.xml | 1 + .../commonMain/resources/MR/tr/strings.xml | 1 + .../commonMain/resources/MR/uk/strings.xml | 4 +- 40 files changed, 630 insertions(+), 497 deletions(-) create mode 100644 feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontMviModel.kt create mode 100644 feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontScreen.kt create mode 100644 feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontViewModel.kt diff --git a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontMviModel.kt b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontMviModel.kt new file mode 100644 index 000000000..78f0f18da --- /dev/null +++ b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontMviModel.kt @@ -0,0 +1,37 @@ +package com.github.diegoberaldin.raccoonforlemmy.feature.settings.colors + +import androidx.compose.ui.graphics.Color +import cafe.adriel.voyager.core.model.ScreenModel +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.CommentBarTheme +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.FontScale +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiFontFamily +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiTheme +import com.github.diegoberaldin.raccoonforlemmy.core.architecture.MviModel + +interface SettingsColorAndFontMviModel : + MviModel, + ScreenModel { + + sealed interface Intent { + data class ChangeDynamicColors(val value: Boolean) : Intent + } + + data class UiState( + val isLogged: Boolean = false, + val supportsDynamicColors: Boolean = false, + val uiTheme: UiTheme? = null, + val dynamicColors: Boolean = false, + val customSeedColor: Color? = null, + val upVoteColor: Color? = null, + val downVoteColor: Color? = null, + val replyColor: Color? = null, + val saveColor: Color? = null, + val commentBarTheme: CommentBarTheme = CommentBarTheme.Blue, + val uiFontScale: FontScale = FontScale.Normal, + val uiFontFamily: UiFontFamily = UiFontFamily.Poppins, + val contentFontScale: FontScale = FontScale.Normal, + val contentFontFamily: UiFontFamily = UiFontFamily.Poppins, + ) + + sealed interface Effect +} \ No newline at end of file diff --git a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontScreen.kt b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontScreen.kt new file mode 100644 index 000000000..a27d58361 --- /dev/null +++ b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontScreen.kt @@ -0,0 +1,263 @@ +package com.github.diegoberaldin.raccoonforlemmy.feature.settings.colors + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.material3.rememberTopAppBarState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.input.nestedscroll.nestedScroll +import cafe.adriel.voyager.core.screen.Screen +import cafe.adriel.voyager.koin.getScreenModel +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.FontScale +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiTheme +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.scaleFactor +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toReadableName +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getColorSchemeProvider +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepository +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing +import com.github.diegoberaldin.raccoonforlemmy.core.architecture.bindToLifecycle +import com.github.diegoberaldin.raccoonforlemmy.core.commonui.lemmyui.SettingsRow +import com.github.diegoberaldin.raccoonforlemmy.core.commonui.lemmyui.SettingsSwitchRow +import com.github.diegoberaldin.raccoonforlemmy.core.navigation.di.getNavigationCoordinator +import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick +import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.rememberCallback +import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.rememberCallbackArgs +import com.github.diegoberaldin.raccoonforlemmy.feature.settings.ui.components.SettingsColorRow +import com.github.diegoberaldin.raccoonforlemmy.feature.settings.ui.components.SettingsMultiColorRow +import com.github.diegoberaldin.raccoonforlemmy.resources.MR +import com.github.diegoberaldin.raccoonforlemmy.unit.choosecolor.ColorBottomSheet +import com.github.diegoberaldin.raccoonforlemmy.unit.choosecolor.CommentBarThemeBottomSheet +import com.github.diegoberaldin.raccoonforlemmy.unit.choosecolor.VoteThemeBottomSheet +import com.github.diegoberaldin.raccoonforlemmy.unit.choosefont.FontFamilyBottomSheet +import com.github.diegoberaldin.raccoonforlemmy.unit.choosefont.FontScaleBottomSheet +import dev.icerock.moko.resources.compose.stringResource +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.drop +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach + +class SettingsColorAndFontScreen : Screen { + + @OptIn(ExperimentalMaterial3Api::class) + @Composable + override fun Content() { + val model = getScreenModel() + model.bindToLifecycle(key) + val uiState by model.uiState.collectAsState() + val navigationCoordinator = remember { getNavigationCoordinator() } + val topAppBarState = rememberTopAppBarState() + val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(topAppBarState) + val themeRepository = remember { getThemeRepository() } + val scrollState = rememberScrollState() + val colorSchemeProvider = remember { getColorSchemeProvider() } + val defaultTheme = if (isSystemInDarkTheme()) { + UiTheme.Dark + } else { + UiTheme.Light + } + var uiFontSizeWorkaround by remember { mutableStateOf(true) } + + LaunchedEffect(themeRepository) { + themeRepository.uiFontScale.drop(1).onEach { + uiFontSizeWorkaround = false + delay(50) + uiFontSizeWorkaround = true + }.launchIn(this) + } + + if (!uiFontSizeWorkaround) { + return + } + + Scaffold( + modifier = Modifier + .background(MaterialTheme.colorScheme.background) + .padding(Spacing.xs), + topBar = { + TopAppBar( + scrollBehavior = scrollBehavior, + title = { + Text( + modifier = Modifier.padding(horizontal = Spacing.s), + text = stringResource(MR.strings.settings_colors_and_fonts), + ) + }, + navigationIcon = { + if (navigationCoordinator.canPop.value) { + Image( + modifier = Modifier.onClick( + onClick = rememberCallback { + navigationCoordinator.popScreen() + }, + ), + imageVector = Icons.Default.ArrowBack, + contentDescription = null, + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground), + ) + } + }, + ) + }, + ) { paddingValues -> + Box( + modifier = Modifier + .padding(paddingValues) + .nestedScroll(scrollBehavior.nestedScrollConnection), + ) { + Column( + modifier = Modifier.fillMaxSize().verticalScroll(scrollState), + verticalArrangement = Arrangement.spacedBy(Spacing.xs), + ) { + // dynamic colors + if (uiState.supportsDynamicColors) { + SettingsSwitchRow( + title = stringResource(MR.strings.settings_dynamic_colors), + value = uiState.dynamicColors, + onValueChanged = rememberCallbackArgs(model) { value -> + model.reduce( + SettingsColorAndFontMviModel.Intent.ChangeDynamicColors(value) + ) + }, + ) + } + + // custom scheme seed color + SettingsColorRow( + title = stringResource(MR.strings.settings_custom_seed_color), + value = uiState.customSeedColor ?: colorSchemeProvider.getColorScheme( + theme = uiState.uiTheme ?: defaultTheme, + dynamic = uiState.dynamicColors, + ).primary, + onTap = rememberCallback { + val sheet = ColorBottomSheet() + navigationCoordinator.showBottomSheet(sheet) + }, + ) + + if (uiState.isLogged) { + // action colors + SettingsColorRow( + title = stringResource(MR.strings.settings_upvote_color), + value = uiState.upVoteColor ?: MaterialTheme.colorScheme.primary, + onTap = rememberCallback { + val screen = VoteThemeBottomSheet( + actionType = 0, + ) + navigationCoordinator.showBottomSheet(screen) + }, + ) + SettingsColorRow( + title = stringResource(MR.strings.settings_downvote_color), + value = uiState.downVoteColor ?: MaterialTheme.colorScheme.tertiary, + onTap = rememberCallback { + val screen = VoteThemeBottomSheet( + actionType = 1, + ) + navigationCoordinator.showBottomSheet(screen) + }, + ) + SettingsColorRow( + title = stringResource(MR.strings.settings_reply_color), + value = uiState.replyColor ?: MaterialTheme.colorScheme.secondary, + onTap = rememberCallback { + val screen = VoteThemeBottomSheet( + actionType = 2, + ) + navigationCoordinator.showBottomSheet(screen) + }, + ) + SettingsColorRow( + title = stringResource(MR.strings.settings_save_color), + value = uiState.saveColor + ?: MaterialTheme.colorScheme.secondaryContainer, + onTap = rememberCallback { + val screen = VoteThemeBottomSheet( + actionType = 3, + ) + navigationCoordinator.showBottomSheet(screen) + }, + ) + } + + // comment bar theme + val commentBarColors = + themeRepository.getCommentBarColors(uiState.commentBarTheme) + SettingsMultiColorRow( + title = stringResource(MR.strings.settings_comment_bar_theme), + values = commentBarColors, + onTap = rememberCallback { + val screen = CommentBarThemeBottomSheet() + navigationCoordinator.showBottomSheet(screen) + } + ) + + // font family + SettingsRow( + title = stringResource(MR.strings.settings_ui_font_family), + value = uiState.uiFontFamily.toReadableName(), + onTap = rememberCallback { + val sheet = FontFamilyBottomSheet() + navigationCoordinator.showBottomSheet(sheet) + }, + ) + + SettingsRow( + title = stringResource(MR.strings.settings_content_font_family), + value = uiState.contentFontFamily.toReadableName(), + onTap = rememberCallback { + val sheet = FontFamilyBottomSheet(content = true) + navigationCoordinator.showBottomSheet(sheet) + }, + ) + // font scale + SettingsRow( + title = stringResource(MR.strings.settings_ui_font_scale), + value = uiState.uiFontScale.toReadableName(), + onTap = rememberCallback { + val sheet = FontScaleBottomSheet( + values = listOf( + FontScale.Large, + FontScale.Normal, + FontScale.Small, + ).map { it.scaleFactor }, + content = false, + ) + navigationCoordinator.showBottomSheet(sheet) + }, + ) + SettingsRow( + title = stringResource(MR.strings.settings_content_font_scale), + value = uiState.contentFontScale.toReadableName(), + onTap = rememberCallback { + val sheet = FontScaleBottomSheet(content = true) + navigationCoordinator.showBottomSheet(sheet) + }, + ) + } + } + } + } +} \ No newline at end of file diff --git a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontViewModel.kt b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontViewModel.kt new file mode 100644 index 000000000..b6cf3724a --- /dev/null +++ b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/colors/SettingsColorAndFontViewModel.kt @@ -0,0 +1,243 @@ +package com.github.diegoberaldin.raccoonforlemmy.feature.settings.colors + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.toArgb +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.CommentBarTheme +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiFontFamily +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toFontScale +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toInt +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ThemeRepository +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.ColorSchemeProvider +import com.github.diegoberaldin.raccoonforlemmy.core.architecture.DefaultMviModel +import com.github.diegoberaldin.raccoonforlemmy.core.architecture.MviModel +import com.github.diegoberaldin.raccoonforlemmy.core.notifications.NotificationCenter +import com.github.diegoberaldin.raccoonforlemmy.core.notifications.NotificationCenterEvent +import com.github.diegoberaldin.raccoonforlemmy.core.persistence.data.SettingsModel +import com.github.diegoberaldin.raccoonforlemmy.core.persistence.repository.AccountRepository +import com.github.diegoberaldin.raccoonforlemmy.core.persistence.repository.SettingsRepository +import com.github.diegoberaldin.raccoonforlemmy.domain.identity.repository.IdentityRepository +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.IO +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.launch + +class SettingsColorAndFontViewModel( + private val mvi: DefaultMviModel, + private val themeRepository: ThemeRepository, + private val colorSchemeProvider: ColorSchemeProvider, + private val identityRepository: IdentityRepository, + private val settingsRepository: SettingsRepository, + private val accountRepository: AccountRepository, + private val notificationCenter: NotificationCenter, +) : SettingsColorAndFontMviModel, + MviModel by mvi { + + override fun onStarted() { + mvi.onStarted() + mvi.scope?.launch { + themeRepository.uiTheme.onEach { value -> + mvi.updateState { it.copy(uiTheme = value) } + }.launchIn(this) + themeRepository.uiFontFamily.onEach { value -> + mvi.updateState { it.copy(uiFontFamily = value) } + }.launchIn(this) + themeRepository.contentFontScale.onEach { value -> + mvi.updateState { it.copy(contentFontScale = value.toFontScale()) } + }.launchIn(this) + themeRepository.contentFontFamily.onEach { value -> + mvi.updateState { it.copy(contentFontFamily = value) } + }.launchIn(this) + themeRepository.uiFontScale.onEach { value -> + mvi.updateState { it.copy(uiFontScale = value.toFontScale()) } + }.launchIn(this) + themeRepository.dynamicColors.onEach { value -> + mvi.updateState { it.copy(dynamicColors = value) } + }.launchIn(this) + themeRepository.customSeedColor.onEach { value -> + mvi.updateState { it.copy(customSeedColor = value) } + }.launchIn(this) + themeRepository.upVoteColor.onEach { value -> + mvi.updateState { it.copy(upVoteColor = value) } + }.launchIn(this) + themeRepository.downVoteColor.onEach { value -> + mvi.updateState { it.copy(downVoteColor = value) } + }.launchIn(this) + themeRepository.replyColor.onEach { value -> + mvi.updateState { it.copy(replyColor = value) } + }.launchIn(this) + themeRepository.saveColor.onEach { value -> + mvi.updateState { it.copy(saveColor = value) } + }.launchIn(this) + themeRepository.commentBarTheme.onEach { value -> + mvi.updateState { it.copy(commentBarTheme = value) } + }.launchIn(this) + + identityRepository.isLogged.onEach { logged -> + mvi.updateState { it.copy(isLogged = logged ?: false) } + }.launchIn(this) + + notificationCenter.subscribe(NotificationCenterEvent.ChangeFontFamily::class) + .onEach { evt -> + changeFontFamily(evt.value) + }.launchIn(this) + notificationCenter.subscribe(NotificationCenterEvent.ChangeContentFontSize::class) + .onEach { evt -> + changeContentFontScale(evt.value) + }.launchIn(this) + notificationCenter.subscribe(NotificationCenterEvent.ChangeContentFontFamily::class) + .onEach { evt -> + changeContentFontFamily(evt.value) + }.launchIn(this) + notificationCenter.subscribe(NotificationCenterEvent.ChangeUiFontSize::class) + .onEach { evt -> + changeUiFontScale(evt.value) + }.launchIn(this) + notificationCenter.subscribe(NotificationCenterEvent.ChangeColor::class).onEach { evt -> + changeCustomSeedColor(evt.color) + }.launchIn(this) + notificationCenter.subscribe(NotificationCenterEvent.ChangeCommentBarTheme::class) + .onEach { evt -> + changeCommentBarTheme(evt.value) + }.launchIn(this) + notificationCenter.subscribe(NotificationCenterEvent.ChangeActionColor::class) + .onEach { evt -> + when (evt.actionType) { + 3 -> changeSaveColor(evt.color) + 2 -> changeReplyColor(evt.color) + 1 -> changeDownVoteColor(evt.color) + else -> changeUpVoteColor(evt.color) + } + }.launchIn(this) + mvi.updateState { + it.copy( + supportsDynamicColors = colorSchemeProvider.supportsDynamicColors, + ) + } + } + } + + override fun reduce(intent: SettingsColorAndFontMviModel.Intent) { + when (intent) { + is SettingsColorAndFontMviModel.Intent.ChangeDynamicColors -> { + changeDynamicColors(intent.value) + } + } + } + + private fun changeFontFamily(value: UiFontFamily) { + themeRepository.changeUiFontFamily(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + uiFontFamily = value.toInt() + ) + saveSettings(settings) + } + } + + private fun changeUiFontScale(value: Float) { + themeRepository.changeUiFontScale(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + uiFontScale = value + ) + saveSettings(settings) + } + } + + private fun changeContentFontScale(value: Float) { + themeRepository.changeContentFontScale(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + contentFontScale = value + ) + saveSettings(settings) + } + } + + private fun changeContentFontFamily(value: UiFontFamily) { + themeRepository.changeContentFontFamily(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + contentFontFamily = value.toInt() + ) + saveSettings(settings) + } + } + + private fun changeDynamicColors(value: Boolean) { + themeRepository.changeDynamicColors(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + dynamicColors = value + ) + saveSettings(settings) + } + } + + private fun changeCustomSeedColor(value: Color?) { + themeRepository.changeCustomSeedColor(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + customSeedColor = value?.toArgb() + ) + saveSettings(settings) + } + } + + private fun changeUpVoteColor(value: Color?) { + themeRepository.changeUpvoteColor(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + upVoteColor = value?.toArgb() + ) + saveSettings(settings) + } + } + + private fun changeDownVoteColor(value: Color?) { + themeRepository.changeDownvoteColor(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + downVoteColor = value?.toArgb() + ) + saveSettings(settings) + } + } + + private fun changeReplyColor(value: Color?) { + themeRepository.changeReplyColor(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + replyColor = value?.toArgb() + ) + saveSettings(settings) + } + } + + private fun changeSaveColor(value: Color?) { + themeRepository.changeSaveColor(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + saveColor = value?.toArgb() + ) + saveSettings(settings) + } + } + + private fun changeCommentBarTheme(value: CommentBarTheme) { + themeRepository.changeCommentBarTheme(value) + mvi.scope?.launch(Dispatchers.IO) { + val settings = settingsRepository.currentSettings.value.copy( + commentBarTheme = value.toInt() + ) + saveSettings(settings) + } + } + + private suspend fun saveSettings(settings: SettingsModel) { + val accountId = accountRepository.getActive()?.id + settingsRepository.updateSettings(settings, accountId) + settingsRepository.changeCurrentSettings(settings) + } +} \ No newline at end of file diff --git a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/di/SettingsModule.kt b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/di/SettingsModule.kt index 9e24a320d..330dee17c 100644 --- a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/di/SettingsModule.kt +++ b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/di/SettingsModule.kt @@ -1,6 +1,8 @@ package com.github.diegoberaldin.raccoonforlemmy.feature.settings.di import com.github.diegoberaldin.raccoonforlemmy.core.architecture.DefaultMviModel +import com.github.diegoberaldin.raccoonforlemmy.feature.settings.colors.SettingsColorAndFontMviModel +import com.github.diegoberaldin.raccoonforlemmy.feature.settings.colors.SettingsColorAndFontViewModel import com.github.diegoberaldin.raccoonforlemmy.feature.settings.main.SettingsMviModel import com.github.diegoberaldin.raccoonforlemmy.feature.settings.main.SettingsViewModel import com.github.diegoberaldin.raccoonforlemmy.unit.about.di.aboutModule @@ -16,7 +18,6 @@ val settingsTabModule = module { themeRepository = get(), languageRepository = get(), identityRepository = get(), - colorSchemeProvider = get(), notificationCenter = get(), crashReportConfiguration = get(), crashReportSender = get(), @@ -24,4 +25,15 @@ val settingsTabModule = module { getSortTypesUseCase = get(), ) } + factory { + SettingsColorAndFontViewModel( + mvi = DefaultMviModel(SettingsColorAndFontMviModel.UiState()), + settingsRepository = get(), + accountRepository = get(), + themeRepository = get(), + identityRepository = get(), + colorSchemeProvider = get(), + notificationCenter = get(), + ) + } } diff --git a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsMviModel.kt b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsMviModel.kt index b1aa1b31d..cf98bd121 100644 --- a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsMviModel.kt +++ b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsMviModel.kt @@ -1,11 +1,7 @@ package com.github.diegoberaldin.raccoonforlemmy.feature.settings.main -import androidx.compose.ui.graphics.Color import cafe.adriel.voyager.core.model.ScreenModel -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.CommentBarTheme -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.FontScale import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.PostLayout -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiFontFamily import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiTheme import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.VoteFormat import com.github.diegoberaldin.raccoonforlemmy.core.architecture.MviModel @@ -20,26 +16,17 @@ interface SettingsMviModel : sealed interface Intent { data class ChangeUiTheme(val value: UiTheme?) : Intent - data class ChangeUiFontSize(val value: Float) : Intent - data class ChangeUiFontFamily(val value: UiFontFamily) : Intent - data class ChangeContentFontSize(val value: Float) : Intent - data class ChangeContentFontFamily(val value: UiFontFamily) : Intent data class ChangeLanguage(val value: String) : Intent data class ChangeDefaultListingType(val value: ListingType) : Intent data class ChangePostLayout(val value: PostLayout) : Intent data class ChangeDefaultPostSortType(val value: SortType) : Intent data class ChangeDefaultCommentSortType(val value: SortType) : Intent data class ChangeNavBarTitlesVisible(val value: Boolean) : Intent - data class ChangeDynamicColors(val value: Boolean) : Intent data class ChangeIncludeNsfw(val value: Boolean) : Intent data class ChangeBlurNsfw(val value: Boolean) : Intent data class ChangeOpenUrlsInExternalBrowser(val value: Boolean) : Intent data class ChangeEnableSwipeActions(val value: Boolean) : Intent data class ChangeEnableDoubleTapAction(val value: Boolean) : Intent - data class ChangeCustomSeedColor(val value: Color?) : Intent - data class ChangeUpvoteColor(val value: Color?) : Intent - data class ChangeDownvoteColor(val value: Color?) : Intent - data class ChangeReplyColor(val value: Color?) : Intent data class ChangeCrashReportEnabled(val value: Boolean) : Intent data class ChangeVoteFormat(val value: VoteFormat) : Intent data class ChangeAutoLoadImages(val value: Boolean) : Intent @@ -59,15 +46,6 @@ interface SettingsMviModel : data class UiState( val isLogged: Boolean = false, val uiTheme: UiTheme? = null, - val uiFontFamily: UiFontFamily = UiFontFamily.Poppins, - val customSeedColor: Color? = null, - val upVoteColor: Color? = null, - val downVoteColor: Color? = null, - val replyColor: Color? = null, - val saveColor: Color? = null, - val uiFontScale: FontScale = FontScale.Normal, - val contentFontScale: FontScale = FontScale.Normal, - val contentFontFamily: UiFontFamily = UiFontFamily.Poppins, val lang: String = "", val postLayout: PostLayout = PostLayout.Card, val defaultListingType: ListingType = ListingType.Local, @@ -75,8 +53,6 @@ interface SettingsMviModel : val defaultCommentSortType: SortType = SortType.New, val defaultInboxUnreadOnly: Boolean = true, val navBarTitlesVisible: Boolean = false, - val supportsDynamicColors: Boolean = false, - val dynamicColors: Boolean = false, val includeNsfw: Boolean = true, val blurNsfw: Boolean = true, val openUrlsInExternalBrowser: Boolean = false, @@ -93,7 +69,6 @@ interface SettingsMviModel : val markAsReadWhileScrolling: Boolean = true, val availableSortTypesForPosts: List = emptyList(), val availableSortTypesForComments: List = emptyList(), - val commentBarTheme: CommentBarTheme = CommentBarTheme.Blue, val searchPostTitleOnly: Boolean = false, val edgeToEdge: Boolean = true, val postBodyMaxLines: Int? = null, diff --git a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsScreen.kt b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsScreen.kt index d5e206c45..788a1ed9e 100644 --- a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsScreen.kt +++ b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsScreen.kt @@ -1,7 +1,6 @@ package com.github.diegoberaldin.raccoonforlemmy.feature.settings.main import androidx.compose.foundation.Image -import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -42,14 +41,9 @@ import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.unit.toSize import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.koin.getScreenModel -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.FontScale import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.PostLayout import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiBarTheme -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiTheme -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.scaleFactor import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toReadableName -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getColorSchemeProvider -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepository import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.architecture.bindToLifecycle import com.github.diegoberaldin.raccoonforlemmy.core.commonui.lemmyui.SettingsHeader @@ -80,25 +74,16 @@ import com.github.diegoberaldin.raccoonforlemmy.core.utils.toLanguageName import com.github.diegoberaldin.raccoonforlemmy.core.utils.toLocalDp import com.github.diegoberaldin.raccoonforlemmy.domain.lemmy.data.toInt import com.github.diegoberaldin.raccoonforlemmy.domain.lemmy.data.toReadableName -import com.github.diegoberaldin.raccoonforlemmy.feature.settings.ui.SettingsTab -import com.github.diegoberaldin.raccoonforlemmy.feature.settings.ui.components.SettingsColorRow -import com.github.diegoberaldin.raccoonforlemmy.feature.settings.ui.components.SettingsMultiColorRow +import com.github.diegoberaldin.raccoonforlemmy.feature.settings.colors.SettingsColorAndFontScreen import com.github.diegoberaldin.raccoonforlemmy.resources.MR import com.github.diegoberaldin.raccoonforlemmy.resources.di.getLanguageRepository import com.github.diegoberaldin.raccoonforlemmy.resources.di.staticString import com.github.diegoberaldin.raccoonforlemmy.unit.about.AboutDialog import com.github.diegoberaldin.raccoonforlemmy.unit.accountsettings.AccountSettingsScreen -import com.github.diegoberaldin.raccoonforlemmy.unit.choosecolor.ColorBottomSheet -import com.github.diegoberaldin.raccoonforlemmy.unit.choosecolor.CommentBarThemeBottomSheet -import com.github.diegoberaldin.raccoonforlemmy.unit.choosecolor.VoteThemeBottomSheet -import com.github.diegoberaldin.raccoonforlemmy.unit.choosefont.FontFamilyBottomSheet -import com.github.diegoberaldin.raccoonforlemmy.unit.choosefont.FontScaleBottomSheet import com.github.diegoberaldin.raccoonforlemmy.unit.configureswipeactions.ConfigureSwipeActionsScreen import com.github.diegoberaldin.raccoonforlemmy.unit.manageban.ManageBanScreen import dev.icerock.moko.resources.compose.stringResource import dev.icerock.moko.resources.desc.desc -import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch @@ -110,7 +95,7 @@ class SettingsScreen : Screen { @Composable override fun Content() { val model = getScreenModel() - model.bindToLifecycle(SettingsTab.key) + model.bindToLifecycle(key) val uiState by model.uiState.collectAsState() val topAppBarState = rememberTopAppBarState() val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(topAppBarState) @@ -120,24 +105,9 @@ class SettingsScreen : Screen { val scrollState = rememberScrollState() val languageRepository = remember { getLanguageRepository() } val lang by languageRepository.currentLanguage.collectAsState() - var uiFontSizeWorkaround by remember { mutableStateOf(true) } - val themeRepository = remember { getThemeRepository() } - val colorSchemeProvider = remember { getColorSchemeProvider() } - val defaultTheme = if (isSystemInDarkTheme()) { - UiTheme.Dark - } else { - UiTheme.Light - } var infoDialogOpened by remember { mutableStateOf(false) } val scope = rememberCoroutineScope() - LaunchedEffect(themeRepository) { - themeRepository.uiFontScale.drop(1).onEach { - uiFontSizeWorkaround = false - delay(50) - uiFontSizeWorkaround = true - }.launchIn(this) - } LaunchedEffect(Unit) { navigationCoordinator.onDoubleTabSelection.onEach { section -> if (section == TabNavigationSection.Settings) { @@ -153,10 +123,6 @@ class SettingsScreen : Screen { }.launchIn(this) } - if (!uiFontSizeWorkaround) { - return - } - var screenWidth by remember { mutableStateOf(0f) } Scaffold( modifier = Modifier.onGloballyPositioned { @@ -193,7 +159,8 @@ class SettingsScreen : Screen { }, ) { paddingValues -> Box( - modifier = Modifier.padding(paddingValues) + modifier = Modifier + .padding(paddingValues) .nestedScroll(scrollBehavior.nestedScrollConnection), ) { Column( @@ -231,132 +198,6 @@ class SettingsScreen : Screen { }, ) - // dynamic colors - if (uiState.supportsDynamicColors) { - SettingsSwitchRow( - title = stringResource(MR.strings.settings_dynamic_colors), - value = uiState.dynamicColors, - onValueChanged = rememberCallbackArgs(model) { value -> - model.reduce( - SettingsMviModel.Intent.ChangeDynamicColors(value) - ) - }, - ) - } - - // custom scheme seed color - SettingsColorRow( - title = stringResource(MR.strings.settings_custom_seed_color), - value = uiState.customSeedColor ?: colorSchemeProvider.getColorScheme( - theme = uiState.uiTheme ?: defaultTheme, - dynamic = uiState.dynamicColors, - ).primary, - onTap = rememberCallback { - val sheet = ColorBottomSheet() - navigationCoordinator.showBottomSheet(sheet) - }, - ) - - if (uiState.isLogged) { - // action colors - SettingsColorRow( - title = stringResource(MR.strings.settings_upvote_color), - value = uiState.upVoteColor ?: MaterialTheme.colorScheme.primary, - onTap = rememberCallback { - val screen = VoteThemeBottomSheet( - actionType = 0, - ) - navigationCoordinator.showBottomSheet(screen) - }, - ) - SettingsColorRow( - title = stringResource(MR.strings.settings_downvote_color), - value = uiState.downVoteColor ?: MaterialTheme.colorScheme.tertiary, - onTap = rememberCallback { - val screen = VoteThemeBottomSheet( - actionType = 1, - ) - navigationCoordinator.showBottomSheet(screen) - }, - ) - SettingsColorRow( - title = stringResource(MR.strings.settings_reply_color), - value = uiState.replyColor ?: MaterialTheme.colorScheme.secondary, - onTap = rememberCallback { - val screen = VoteThemeBottomSheet( - actionType = 2, - ) - navigationCoordinator.showBottomSheet(screen) - }, - ) - SettingsColorRow( - title = stringResource(MR.strings.settings_save_color), - value = uiState.saveColor - ?: MaterialTheme.colorScheme.secondaryContainer, - onTap = rememberCallback { - val screen = VoteThemeBottomSheet( - actionType = 3, - ) - navigationCoordinator.showBottomSheet(screen) - }, - ) - } - - // comment bar theme - val commentBarColors = - themeRepository.getCommentBarColors(uiState.commentBarTheme) - SettingsMultiColorRow( - title = stringResource(MR.strings.settings_comment_bar_theme), - values = commentBarColors, - onTap = rememberCallback { - val screen = CommentBarThemeBottomSheet() - navigationCoordinator.showBottomSheet(screen) - } - ) - - // font family - SettingsRow( - title = stringResource(MR.strings.settings_ui_font_family), - value = uiState.uiFontFamily.toReadableName(), - onTap = rememberCallback { - val sheet = FontFamilyBottomSheet() - navigationCoordinator.showBottomSheet(sheet) - }, - ) - - SettingsRow( - title = stringResource(MR.strings.settings_content_font_family), - value = uiState.contentFontFamily.toReadableName(), - onTap = rememberCallback { - val sheet = FontFamilyBottomSheet(content = true) - navigationCoordinator.showBottomSheet(sheet) - }, - ) - // font scale - SettingsRow( - title = stringResource(MR.strings.settings_ui_font_scale), - value = uiState.uiFontScale.toReadableName(), - onTap = rememberCallback { - val sheet = FontScaleBottomSheet( - values = listOf( - FontScale.Large, - FontScale.Normal, - FontScale.Small, - ).map { it.scaleFactor }, - content = false, - ) - navigationCoordinator.showBottomSheet(sheet) - }, - ) - SettingsRow( - title = stringResource(MR.strings.settings_content_font_scale), - value = uiState.contentFontScale.toReadableName(), - onTap = rememberCallback { - val sheet = FontScaleBottomSheet(content = true) - navigationCoordinator.showBottomSheet(sheet) - }, - ) - // navigation bar titles SettingsSwitchRow( title = stringResource(MR.strings.settings_navigation_bar_titles_visible), @@ -407,6 +248,15 @@ class SettingsScreen : Screen { }, ) + // colors and fonts + SettingsRow( + title = stringResource(MR.strings.settings_colors_and_fonts), + disclosureIndicator = true, + onTap = rememberCallback { + navigationCoordinator.pushScreen(SettingsColorAndFontScreen()) + } + ) + SettingsHeader( icon = Icons.Default.Dashboard, title = stringResource(MR.strings.settings_section_feed), diff --git a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsViewModel.kt b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsViewModel.kt index 476e614a1..a39afdbec 100644 --- a/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsViewModel.kt +++ b/feature/settings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/feature/settings/main/SettingsViewModel.kt @@ -1,17 +1,11 @@ package com.github.diegoberaldin.raccoonforlemmy.feature.settings.main -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.toArgb -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.CommentBarTheme import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.PostLayout import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiBarTheme -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiFontFamily import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.UiTheme import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.VoteFormat -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toFontScale import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toInt import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ThemeRepository -import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.ColorSchemeProvider import com.github.diegoberaldin.raccoonforlemmy.core.architecture.DefaultMviModel import com.github.diegoberaldin.raccoonforlemmy.core.architecture.MviModel import com.github.diegoberaldin.raccoonforlemmy.core.notifications.ContentResetCoordinator @@ -42,7 +36,6 @@ import kotlin.time.Duration class SettingsViewModel( private val mvi: DefaultMviModel, private val themeRepository: ThemeRepository, - private val colorSchemeProvider: ColorSchemeProvider, private val languageRepository: LanguageRepository, private val identityRepository: IdentityRepository, private val settingsRepository: SettingsRepository, @@ -61,45 +54,12 @@ class SettingsViewModel( themeRepository.uiTheme.onEach { value -> mvi.updateState { it.copy(uiTheme = value) } }.launchIn(this) - themeRepository.uiFontFamily.onEach { value -> - mvi.updateState { it.copy(uiFontFamily = value) } - }.launchIn(this) - themeRepository.contentFontScale.onEach { value -> - mvi.updateState { it.copy(contentFontScale = value.toFontScale()) } - }.launchIn(this) - themeRepository.contentFontFamily.onEach { value -> - mvi.updateState { it.copy(contentFontFamily = value) } - }.launchIn(this) - themeRepository.uiFontScale.onEach { value -> - mvi.updateState { it.copy(uiFontScale = value.toFontScale()) } - }.launchIn(this) themeRepository.navItemTitles.onEach { value -> mvi.updateState { it.copy(navBarTitlesVisible = value) } }.launchIn(this) - themeRepository.dynamicColors.onEach { value -> - mvi.updateState { it.copy(dynamicColors = value) } - }.launchIn(this) - themeRepository.customSeedColor.onEach { value -> - mvi.updateState { it.copy(customSeedColor = value) } - }.launchIn(this) themeRepository.postLayout.onEach { value -> mvi.updateState { it.copy(postLayout = value) } }.launchIn(this) - themeRepository.upVoteColor.onEach { value -> - mvi.updateState { it.copy(upVoteColor = value) } - }.launchIn(this) - themeRepository.downVoteColor.onEach { value -> - mvi.updateState { it.copy(downVoteColor = value) } - }.launchIn(this) - themeRepository.replyColor.onEach { value -> - mvi.updateState { it.copy(replyColor = value) } - }.launchIn(this) - themeRepository.saveColor.onEach { value -> - mvi.updateState { it.copy(saveColor = value) } - }.launchIn(this) - themeRepository.commentBarTheme.onEach { value -> - mvi.updateState { it.copy(commentBarTheme = value) } - }.launchIn(this) languageRepository.currentLanguage.onEach { lang -> mvi.updateState { it.copy(lang = lang) } @@ -119,25 +79,6 @@ class SettingsViewModel( notificationCenter.subscribe(NotificationCenterEvent.ChangeTheme::class).onEach { evt -> changeTheme(evt.value) }.launchIn(this) - notificationCenter.subscribe(NotificationCenterEvent.ChangeColor::class).onEach { evt -> - changeCustomSeedColor(evt.color) - }.launchIn(this) - notificationCenter.subscribe(NotificationCenterEvent.ChangeFontFamily::class) - .onEach { evt -> - changeFontFamily(evt.value) - }.launchIn(this) - notificationCenter.subscribe(NotificationCenterEvent.ChangeContentFontSize::class) - .onEach { evt -> - changeContentFontScale(evt.value) - }.launchIn(this) - notificationCenter.subscribe(NotificationCenterEvent.ChangeContentFontFamily::class) - .onEach { evt -> - changeContentFontFamily(evt.value) - }.launchIn(this) - notificationCenter.subscribe(NotificationCenterEvent.ChangeUiFontSize::class) - .onEach { evt -> - changeUiFontScale(evt.value) - }.launchIn(this) notificationCenter.subscribe(NotificationCenterEvent.ChangePostLayout::class) .onEach { evt -> changePostLayout(evt.value) @@ -170,19 +111,6 @@ class SettingsViewModel( .onEach { evt -> changeVoteFormat(evt.value) }.launchIn(this) - notificationCenter.subscribe(NotificationCenterEvent.ChangeCommentBarTheme::class) - .onEach { evt -> - changeCommentBarTheme(evt.value) - }.launchIn(this) - notificationCenter.subscribe(NotificationCenterEvent.ChangeActionColor::class) - .onEach { evt -> - when (evt.actionType) { - 3 -> changeSaveColor(evt.color) - 2 -> changeReplyColor(evt.color) - 1 -> changeDownvoteColor(evt.color) - else -> changeUpvoteColor(evt.color) - } - }.launchIn(this) notificationCenter.subscribe(NotificationCenterEvent.ChangePostBodyMaxLines::class) .onEach { evt -> changePostBodyMaxLines(evt.value) @@ -211,7 +139,6 @@ class SettingsViewModel( defaultInboxUnreadOnly = settings.defaultInboxType.toInboxUnreadOnly(), includeNsfw = settings.includeNsfw, blurNsfw = settings.blurNsfw, - supportsDynamicColors = colorSchemeProvider.supportsDynamicColors, openUrlsInExternalBrowser = settings.openUrlsInExternalBrowser, enableSwipeActions = settings.enableSwipeActions, enableDoubleTapAction = settings.enableDoubleTapAction, @@ -235,145 +162,47 @@ class SettingsViewModel( override fun reduce(intent: SettingsMviModel.Intent) { when (intent) { - is SettingsMviModel.Intent.ChangeUiTheme -> { - changeTheme(intent.value) - } - - is SettingsMviModel.Intent.ChangeUiFontFamily -> { - changeFontFamily(intent.value) - } - - is SettingsMviModel.Intent.ChangeContentFontSize -> { - changeContentFontScale(intent.value) - } - - is SettingsMviModel.Intent.ChangeContentFontFamily -> { - changeContentFontFamily(intent.value) - } - - is SettingsMviModel.Intent.ChangeUiFontSize -> { - changeUiFontScale(intent.value) - } - - is SettingsMviModel.Intent.ChangeLanguage -> { - changeLanguage(intent.value) - } - - is SettingsMviModel.Intent.ChangeDefaultCommentSortType -> { + is SettingsMviModel.Intent.ChangeUiTheme -> changeTheme(intent.value) + is SettingsMviModel.Intent.ChangeLanguage -> changeLanguage(intent.value) + is SettingsMviModel.Intent.ChangeDefaultCommentSortType -> changeDefaultCommentSortType(intent.value) - } - is SettingsMviModel.Intent.ChangeDefaultListingType -> { - changeDefaultListingType(intent.value) - } - - is SettingsMviModel.Intent.ChangeDefaultPostSortType -> { - changeDefaultPostSortType(intent.value) - } - - is SettingsMviModel.Intent.ChangeBlurNsfw -> { - changeBlurNsfw(intent.value) - } - - is SettingsMviModel.Intent.ChangeIncludeNsfw -> { - changeIncludeNsfw(intent.value) - } - - is SettingsMviModel.Intent.ChangeNavBarTitlesVisible -> { - changeNavBarTitlesVisible(intent.value) - } - - is SettingsMviModel.Intent.ChangeDynamicColors -> { - changeDynamicColors(intent.value) - } - - is SettingsMviModel.Intent.ChangeOpenUrlsInExternalBrowser -> { + is SettingsMviModel.Intent.ChangeDefaultListingType -> changeDefaultListingType(intent.value) + is SettingsMviModel.Intent.ChangeDefaultPostSortType -> changeDefaultPostSortType(intent.value) + is SettingsMviModel.Intent.ChangeBlurNsfw -> changeBlurNsfw(intent.value) + is SettingsMviModel.Intent.ChangeIncludeNsfw -> changeIncludeNsfw(intent.value) + is SettingsMviModel.Intent.ChangeNavBarTitlesVisible -> changeNavBarTitlesVisible(intent.value) + is SettingsMviModel.Intent.ChangeOpenUrlsInExternalBrowser -> changeOpenUrlsInExternalBrowser(intent.value) - } - is SettingsMviModel.Intent.ChangeEnableSwipeActions -> { - changeEnableSwipeActions(intent.value) - } - - is SettingsMviModel.Intent.ChangeEnableDoubleTapAction -> { + is SettingsMviModel.Intent.ChangeEnableSwipeActions -> changeEnableSwipeActions(intent.value) + is SettingsMviModel.Intent.ChangeEnableDoubleTapAction -> changeEnableDoubleTapAction(intent.value) - } - is SettingsMviModel.Intent.ChangeCustomSeedColor -> { - changeCustomSeedColor(intent.value) - } - - is SettingsMviModel.Intent.ChangePostLayout -> { - changePostLayout(intent.value) - } - - is SettingsMviModel.Intent.ChangeCrashReportEnabled -> { - changeCrashReportEnabled(intent.value) - } - - is SettingsMviModel.Intent.ChangeVoteFormat -> { - changeVoteFormat(intent.value) - } - - is SettingsMviModel.Intent.ChangeAutoLoadImages -> { - changeAutoLoadImages(intent.value) - } - - is SettingsMviModel.Intent.ChangeAutoExpandComments -> { - changeAutoExpandComments(intent.value) - } - - is SettingsMviModel.Intent.ChangeFullHeightImages -> { - changeFullHeightImages(intent.value) - } - - is SettingsMviModel.Intent.ChangeUpvoteColor -> { - changeUpvoteColor(intent.value) - } - - is SettingsMviModel.Intent.ChangeDownvoteColor -> { - changeDownvoteColor(intent.value) - } - - is SettingsMviModel.Intent.ChangeReplyColor -> { - changeReplyColor(intent.value) - } - - is SettingsMviModel.Intent.ChangeHideNavigationBarWhileScrolling -> { + is SettingsMviModel.Intent.ChangePostLayout -> changePostLayout(intent.value) + is SettingsMviModel.Intent.ChangeCrashReportEnabled -> changeCrashReportEnabled(intent.value) + is SettingsMviModel.Intent.ChangeVoteFormat -> changeVoteFormat(intent.value) + is SettingsMviModel.Intent.ChangeAutoLoadImages -> changeAutoLoadImages(intent.value) + is SettingsMviModel.Intent.ChangeAutoExpandComments -> changeAutoExpandComments(intent.value) + is SettingsMviModel.Intent.ChangeFullHeightImages -> changeFullHeightImages(intent.value) + is SettingsMviModel.Intent.ChangeHideNavigationBarWhileScrolling -> changeHideNavigationBarWhileScrolling(intent.value) - } - is SettingsMviModel.Intent.ChangeZombieModeInterval -> { - changeZombieModeInterval(intent.value) - } - - is SettingsMviModel.Intent.ChangeZombieModeScrollAmount -> { + is SettingsMviModel.Intent.ChangeZombieModeInterval -> changeZombieModeInterval(intent.value) + is SettingsMviModel.Intent.ChangeZombieModeScrollAmount -> changeZombieModeScrollAmount(intent.value) - } - is SettingsMviModel.Intent.ChangeMarkAsReadWhileScrolling -> { + is SettingsMviModel.Intent.ChangeMarkAsReadWhileScrolling -> changeMarkAsReadWhileScrolling(intent.value) - } - is SettingsMviModel.Intent.ChangeDefaultInboxUnreadOnly -> { + is SettingsMviModel.Intent.ChangeDefaultInboxUnreadOnly -> changeDefaultInboxUnreadOnly(intent.value) - } - is SettingsMviModel.Intent.ChangeSearchPostTitleOnly -> { - changeSearchPostTitleOnly(intent.value) - } - - is SettingsMviModel.Intent.ChangeEdgeToEdge -> { - changeEdgeToEdge(intent.value) - } - - is SettingsMviModel.Intent.ChangePostBodyMaxLines -> { - changePostBodyMaxLines(intent.value) - } - - is SettingsMviModel.Intent.ChangeInfiniteScrollDisabled -> { + is SettingsMviModel.Intent.ChangeSearchPostTitleOnly -> changeSearchPostTitleOnly(intent.value) + is SettingsMviModel.Intent.ChangeEdgeToEdge -> changeEdgeToEdge(intent.value) + is SettingsMviModel.Intent.ChangePostBodyMaxLines -> changePostBodyMaxLines(intent.value) + is SettingsMviModel.Intent.ChangeInfiniteScrollDisabled -> changeInfiniteScrollDisabled(intent.value) - } } } @@ -387,46 +216,6 @@ class SettingsViewModel( } } - private fun changeFontFamily(value: UiFontFamily) { - themeRepository.changeUiFontFamily(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - uiFontFamily = value.toInt() - ) - saveSettings(settings) - } - } - - private fun changeUiFontScale(value: Float) { - themeRepository.changeUiFontScale(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - uiFontScale = value - ) - saveSettings(settings) - } - } - - private fun changeContentFontScale(value: Float) { - themeRepository.changeContentFontScale(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - contentFontScale = value - ) - saveSettings(settings) - } - } - - private fun changeContentFontFamily(value: UiFontFamily) { - themeRepository.changeContentFontFamily(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - contentFontFamily = value.toInt() - ) - saveSettings(settings) - } - } - private fun changeLanguage(value: String) { languageRepository.changeLanguage(value) mvi.scope?.launch(Dispatchers.IO) { @@ -501,66 +290,6 @@ class SettingsViewModel( } } - private fun changeDynamicColors(value: Boolean) { - themeRepository.changeDynamicColors(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - dynamicColors = value - ) - saveSettings(settings) - } - } - - private fun changeCustomSeedColor(value: Color?) { - themeRepository.changeCustomSeedColor(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - customSeedColor = value?.toArgb() - ) - saveSettings(settings) - } - } - - private fun changeUpvoteColor(value: Color?) { - themeRepository.changeUpvoteColor(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - upVoteColor = value?.toArgb() - ) - saveSettings(settings) - } - } - - private fun changeDownvoteColor(value: Color?) { - themeRepository.changeDownvoteColor(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - downVoteColor = value?.toArgb() - ) - saveSettings(settings) - } - } - - private fun changeReplyColor(value: Color?) { - themeRepository.changeReplyColor(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - replyColor = value?.toArgb() - ) - saveSettings(settings) - } - } - - private fun changeSaveColor(value: Color?) { - themeRepository.changeSaveColor(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - saveColor = value?.toArgb() - ) - saveSettings(settings) - } - } - private fun changeOpenUrlsInExternalBrowser(value: Boolean) { mvi.updateState { it.copy(openUrlsInExternalBrowser = value) } mvi.scope?.launch(Dispatchers.IO) { @@ -698,16 +427,6 @@ class SettingsViewModel( } } - private fun changeCommentBarTheme(value: CommentBarTheme) { - themeRepository.changeCommentBarTheme(value) - mvi.scope?.launch(Dispatchers.IO) { - val settings = settingsRepository.currentSettings.value.copy( - commentBarTheme = value.toInt() - ) - saveSettings(settings) - } - } - private fun changeSearchPostTitleOnly(value: Boolean) { mvi.updateState { it.copy(searchPostTitleOnly = value) } mvi.scope?.launch(Dispatchers.IO) { diff --git a/resources/src/commonMain/resources/MR/ar/strings.xml b/resources/src/commonMain/resources/MR/ar/strings.xml index 9c059d44c..cd2f00490 100644 --- a/resources/src/commonMain/resources/MR/ar/strings.xml +++ b/resources/src/commonMain/resources/MR/ar/strings.xml @@ -323,4 +323,5 @@ مبهمة شفاف موضوع الحالة وشريط التنقل + الألوان والخطوط \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/base/strings.xml b/resources/src/commonMain/resources/MR/base/strings.xml index 3ae7a777e..0ba2ac93f 100755 --- a/resources/src/commonMain/resources/MR/base/strings.xml +++ b/resources/src/commonMain/resources/MR/base/strings.xml @@ -356,4 +356,5 @@ Opaque Transparent System notification and navigation bar theme + Colors and fonts \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/bg/strings.xml b/resources/src/commonMain/resources/MR/bg/strings.xml index 47d0a4b7b..35e2e054e 100644 --- a/resources/src/commonMain/resources/MR/bg/strings.xml +++ b/resources/src/commonMain/resources/MR/bg/strings.xml @@ -333,4 +333,5 @@ Непрозрачен Прозрачен Тема на лентата за състояние и навигация + Цветове и шрифтове \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/cs/strings.xml b/resources/src/commonMain/resources/MR/cs/strings.xml index 6dbcfa106..fbab1a0a4 100644 --- a/resources/src/commonMain/resources/MR/cs/strings.xml +++ b/resources/src/commonMain/resources/MR/cs/strings.xml @@ -325,4 +325,5 @@ Neprůhledný Průhledný Téma stavové a navigační lišty + Barvy a písma \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/da/strings.xml b/resources/src/commonMain/resources/MR/da/strings.xml index 45db863cf..23186be18 100644 --- a/resources/src/commonMain/resources/MR/da/strings.xml +++ b/resources/src/commonMain/resources/MR/da/strings.xml @@ -325,4 +325,5 @@ Uigennemsigtig Gennemsigtig Tema for status- og navigationslinjen + Farver og skrifttyper \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/de/strings.xml b/resources/src/commonMain/resources/MR/de/strings.xml index 366c48c5e..e141d2b26 100755 --- a/resources/src/commonMain/resources/MR/de/strings.xml +++ b/resources/src/commonMain/resources/MR/de/strings.xml @@ -333,4 +333,5 @@ Undurchsichtig Transparent Thema der Status- und Navigationsleiste + Farben und Schriftarten diff --git a/resources/src/commonMain/resources/MR/el/strings.xml b/resources/src/commonMain/resources/MR/el/strings.xml index af192a0b4..3c2c93ffa 100644 --- a/resources/src/commonMain/resources/MR/el/strings.xml +++ b/resources/src/commonMain/resources/MR/el/strings.xml @@ -336,4 +336,5 @@ Αδιαφανής Διαφανής Θέμα της γραμμής κατάστασης και πλοήγησης + Χρώματα και γραμματοσειρές \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/eo/strings.xml b/resources/src/commonMain/resources/MR/eo/strings.xml index 2c9415123..dfeeca537 100644 --- a/resources/src/commonMain/resources/MR/eo/strings.xml +++ b/resources/src/commonMain/resources/MR/eo/strings.xml @@ -324,4 +324,5 @@ Opaka Travidebla Temo de la statuso kaj navigadbreto + Koloroj kaj tiparoj \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/es/strings.xml b/resources/src/commonMain/resources/MR/es/strings.xml index 6fb906ef6..4c893d5a7 100755 --- a/resources/src/commonMain/resources/MR/es/strings.xml +++ b/resources/src/commonMain/resources/MR/es/strings.xml @@ -326,4 +326,5 @@ Opaco Transparente Tema barra de estado y navegación + Colores y fuentes \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/et/strings.xml b/resources/src/commonMain/resources/MR/et/strings.xml index 9aa00d0d4..b9d291378 100644 --- a/resources/src/commonMain/resources/MR/et/strings.xml +++ b/resources/src/commonMain/resources/MR/et/strings.xml @@ -325,4 +325,5 @@ Läbipaistmatu Läbipaistev Oleku- ja navigeerimisriba teema + Värvid ja fondid \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/fi/strings.xml b/resources/src/commonMain/resources/MR/fi/strings.xml index 97682df6a..1131f85b4 100644 --- a/resources/src/commonMain/resources/MR/fi/strings.xml +++ b/resources/src/commonMain/resources/MR/fi/strings.xml @@ -325,4 +325,5 @@ Läpinäkymätön Läpinäkyvä Tila- ja navigointipalkin teema + Värit ja fontit \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/fr/strings.xml b/resources/src/commonMain/resources/MR/fr/strings.xml index 36fabda6b..df0b95aaa 100755 --- a/resources/src/commonMain/resources/MR/fr/strings.xml +++ b/resources/src/commonMain/resources/MR/fr/strings.xml @@ -330,4 +330,5 @@ Opaque Transparent Thème barre d\'état et de navigation + Couleurs et polices \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/ga/strings.xml b/resources/src/commonMain/resources/MR/ga/strings.xml index 33183c633..489c9dab8 100644 --- a/resources/src/commonMain/resources/MR/ga/strings.xml +++ b/resources/src/commonMain/resources/MR/ga/strings.xml @@ -334,4 +334,5 @@ Teimhneach Trédhearcach Téama an bharra stádais agus nascleanúna + Dathanna agus clónna \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/hr/strings.xml b/resources/src/commonMain/resources/MR/hr/strings.xml index 71140492e..1e5f4faa5 100644 --- a/resources/src/commonMain/resources/MR/hr/strings.xml +++ b/resources/src/commonMain/resources/MR/hr/strings.xml @@ -330,4 +330,5 @@ Neproziran Transparentan Tema statusne i navigacijske trake + Boje i fontovi \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/hu/strings.xml b/resources/src/commonMain/resources/MR/hu/strings.xml index a8bb88d67..947de86bc 100644 --- a/resources/src/commonMain/resources/MR/hu/strings.xml +++ b/resources/src/commonMain/resources/MR/hu/strings.xml @@ -329,4 +329,5 @@ Áttetsző Átlátszó Az állapot és a navigációs sáv témája + Színek és betűtípusok \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/it/strings.xml b/resources/src/commonMain/resources/MR/it/strings.xml index 560874e46..9446f443f 100755 --- a/resources/src/commonMain/resources/MR/it/strings.xml +++ b/resources/src/commonMain/resources/MR/it/strings.xml @@ -329,4 +329,5 @@ Opaco Trasparente Tema barra notifiche di sistema e navigazione + Colori e font \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/lt/strings.xml b/resources/src/commonMain/resources/MR/lt/strings.xml index 2a174c81f..394206d1d 100644 --- a/resources/src/commonMain/resources/MR/lt/strings.xml +++ b/resources/src/commonMain/resources/MR/lt/strings.xml @@ -327,4 +327,5 @@ Nepermatomas Skaidrus Būsenos ir naršymo juostos tema + Spalvos ir šriftai \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/lv/strings.xml b/resources/src/commonMain/resources/MR/lv/strings.xml index bbd65d958..4c27d8dcb 100644 --- a/resources/src/commonMain/resources/MR/lv/strings.xml +++ b/resources/src/commonMain/resources/MR/lv/strings.xml @@ -329,4 +329,5 @@ Necaurspīdīgs Caurspīdīgs Statusa un navigācijas joslas motīvs + Krāsas un fonti \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/mt/strings.xml b/resources/src/commonMain/resources/MR/mt/strings.xml index 5311702ab..151bc2415 100644 --- a/resources/src/commonMain/resources/MR/mt/strings.xml +++ b/resources/src/commonMain/resources/MR/mt/strings.xml @@ -330,4 +330,5 @@ Opaki Trasparenti Tema tal-istatus u l-bar tan-navigazzjoni + Kuluri u fonts \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/nl/strings.xml b/resources/src/commonMain/resources/MR/nl/strings.xml index 841238d6c..782758f5a 100644 --- a/resources/src/commonMain/resources/MR/nl/strings.xml +++ b/resources/src/commonMain/resources/MR/nl/strings.xml @@ -328,4 +328,5 @@ Ondoorzichtig Transparant Thema van de status- en navigatiebalk + Kleuren en lettertypen \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/no/strings.xml b/resources/src/commonMain/resources/MR/no/strings.xml index 277b401de..2b6dc0634 100644 --- a/resources/src/commonMain/resources/MR/no/strings.xml +++ b/resources/src/commonMain/resources/MR/no/strings.xml @@ -327,4 +327,5 @@ Ugjennomsiktig Gjennomsiktig Tema for status- og navigasjonslinjen + Farger og fonter \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/pl/strings.xml b/resources/src/commonMain/resources/MR/pl/strings.xml index 9c88bdee0..898361143 100644 --- a/resources/src/commonMain/resources/MR/pl/strings.xml +++ b/resources/src/commonMain/resources/MR/pl/strings.xml @@ -328,4 +328,5 @@ Nieprzejrzysty Przezroczysty Motyw paska stanu i nawigacji + Kolory i czcionki \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/pt-BR/strings.xml b/resources/src/commonMain/resources/MR/pt-BR/strings.xml index db569df1f..3f201809d 100644 --- a/resources/src/commonMain/resources/MR/pt-BR/strings.xml +++ b/resources/src/commonMain/resources/MR/pt-BR/strings.xml @@ -325,4 +325,5 @@ Opaco Transparente Tema da barra de status e navegação + Cores e fontes diff --git a/resources/src/commonMain/resources/MR/pt/strings.xml b/resources/src/commonMain/resources/MR/pt/strings.xml index f5db77547..911455091 100755 --- a/resources/src/commonMain/resources/MR/pt/strings.xml +++ b/resources/src/commonMain/resources/MR/pt/strings.xml @@ -327,4 +327,5 @@ Opaco Transparente Tema da barra de status e navegação + Cores e fontes \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/ro/strings.xml b/resources/src/commonMain/resources/MR/ro/strings.xml index 3f174d0c8..b1bf6e05f 100755 --- a/resources/src/commonMain/resources/MR/ro/strings.xml +++ b/resources/src/commonMain/resources/MR/ro/strings.xml @@ -326,4 +326,5 @@ Opac Transparent Tema barei de stare și navigare + Culori și fonturi \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/ru/strings.xml b/resources/src/commonMain/resources/MR/ru/strings.xml index 4645274f2..0b0ef178d 100644 --- a/resources/src/commonMain/resources/MR/ru/strings.xml +++ b/resources/src/commonMain/resources/MR/ru/strings.xml @@ -329,4 +329,5 @@ Непрозрачный Прозрачный Тема статусной и навигационной панели + Цвета и шрифты \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/se/strings.xml b/resources/src/commonMain/resources/MR/se/strings.xml index 32355b1cf..7a0da68a1 100644 --- a/resources/src/commonMain/resources/MR/se/strings.xml +++ b/resources/src/commonMain/resources/MR/se/strings.xml @@ -326,4 +326,5 @@ Ogenomskinlig Transparent Tema för status- och navigeringsfältet + Färger och typsnitt \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/sk/strings.xml b/resources/src/commonMain/resources/MR/sk/strings.xml index 11b620282..a450c3e29 100644 --- a/resources/src/commonMain/resources/MR/sk/strings.xml +++ b/resources/src/commonMain/resources/MR/sk/strings.xml @@ -327,4 +327,5 @@ Nepriehľadné Transparentné Téma stavovej a navigačnej lišty + Farby a písma \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/sl/strings.xml b/resources/src/commonMain/resources/MR/sl/strings.xml index 73d0be33b..e0df7c88a 100644 --- a/resources/src/commonMain/resources/MR/sl/strings.xml +++ b/resources/src/commonMain/resources/MR/sl/strings.xml @@ -325,4 +325,5 @@ Neprozoren Pregleden Tema statusne in navigacijske vrstice + Barve in pisave \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/sq/strings.xml b/resources/src/commonMain/resources/MR/sq/strings.xml index 7997eb532..bb040b4f9 100644 --- a/resources/src/commonMain/resources/MR/sq/strings.xml +++ b/resources/src/commonMain/resources/MR/sq/strings.xml @@ -331,4 +331,5 @@ I errët Transparente Tema e shiritit të statusit dhe navigimit + Ngjyrat dhe shkronjat \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/tok/strings.xml b/resources/src/commonMain/resources/MR/tok/strings.xml index 794983f69..f5983b105 100755 --- a/resources/src/commonMain/resources/MR/tok/strings.xml +++ b/resources/src/commonMain/resources/MR/tok/strings.xml @@ -324,4 +324,5 @@ lukin ala lukin nasin lukin pi linja sewi pi linja anpa + Kule en sitelen \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/tr/strings.xml b/resources/src/commonMain/resources/MR/tr/strings.xml index 8807ee1ef..0030b756d 100644 --- a/resources/src/commonMain/resources/MR/tr/strings.xml +++ b/resources/src/commonMain/resources/MR/tr/strings.xml @@ -328,4 +328,5 @@ Opak Şeffaf Durum ve gezinme çubuğunun teması + Renkler ve yazı tipleri \ No newline at end of file diff --git a/resources/src/commonMain/resources/MR/uk/strings.xml b/resources/src/commonMain/resources/MR/uk/strings.xml index d59a57861..ec442c7f0 100644 --- a/resources/src/commonMain/resources/MR/uk/strings.xml +++ b/resources/src/commonMain/resources/MR/uk/strings.xml @@ -308,7 +308,8 @@ Зняти бан Примірники Вміст від краю до краю - Максимальна кількість рядків для тіла повідомлення + Максимальна кількість рядків для тіла повідомлення + Необмежений (цей вміст було видалено) Завантажити більше дописів @@ -327,4 +328,5 @@ Непрозорий Прозорий Тема панелі стану та навігації + Кольори та шрифти \ No newline at end of file