From 3f935ae66c32652f3649e5ee0239b1e117ef200d Mon Sep 17 00:00:00 2001 From: Diego Beraldin Date: Tue, 20 Feb 2024 13:07:48 +0100 Subject: [PATCH] feat: custom font scale factor for content classes (#541) --- .../repository/ContentFontScales.kt | 15 ++ .../repository/DefaultThemeRepository.kt | 4 +- .../appearance/repository/ThemeRepository.kt | 4 +- .../core/appearance/theme/AppTheme.kt | 9 +- .../commonui/components/CustomizedContent.kt | 14 +- .../core/commonui/lemmyui/CommentCard.kt | 3 +- .../lemmyui/CommunityAndCreatorInfo.kt | 66 ++++--- .../core/commonui/lemmyui/CommunityItem.kt | 176 +++++++++--------- .../core/commonui/lemmyui/InboxCard.kt | 3 +- .../commonui/lemmyui/InboxReplySubtitle.kt | 38 ++-- .../commonui/lemmyui/MultiCommunityItem.kt | 27 ++- .../core/commonui/lemmyui/PostCard.kt | 7 +- .../core/commonui/lemmyui/UserItem.kt | 13 +- .../src/androidMain/res/values-ar/strings.xml | 5 +- .../src/androidMain/res/values-bg/strings.xml | 5 +- .../src/androidMain/res/values-cs/strings.xml | 5 +- .../src/androidMain/res/values-da/strings.xml | 5 +- .../src/androidMain/res/values-de/strings.xml | 5 +- .../src/androidMain/res/values-el/strings.xml | 5 +- .../src/androidMain/res/values-eo/strings.xml | 5 +- .../src/androidMain/res/values-es/strings.xml | 5 +- .../src/androidMain/res/values-et/strings.xml | 5 +- .../src/androidMain/res/values-fi/strings.xml | 5 +- .../src/androidMain/res/values-fr/strings.xml | 5 +- .../src/androidMain/res/values-ga/strings.xml | 5 +- .../src/androidMain/res/values-hr/strings.xml | 5 +- .../src/androidMain/res/values-hu/strings.xml | 5 +- .../src/androidMain/res/values-it/strings.xml | 5 +- .../src/androidMain/res/values-lt/strings.xml | 5 +- .../src/androidMain/res/values-lv/strings.xml | 5 +- .../src/androidMain/res/values-mt/strings.xml | 5 +- .../src/androidMain/res/values-nl/strings.xml | 5 +- .../src/androidMain/res/values-no/strings.xml | 5 +- .../src/androidMain/res/values-pl/strings.xml | 5 +- .../androidMain/res/values-pt-rBR/strings.xml | 5 +- .../src/androidMain/res/values-pt/strings.xml | 5 +- .../src/androidMain/res/values-ro/strings.xml | 5 +- .../src/androidMain/res/values-ru/strings.xml | 5 +- .../src/androidMain/res/values-se/strings.xml | 5 +- .../src/androidMain/res/values-sk/strings.xml | 5 +- .../src/androidMain/res/values-sl/strings.xml | 5 +- .../src/androidMain/res/values-sq/strings.xml | 5 +- .../androidMain/res/values-tok/strings.xml | 5 +- .../src/androidMain/res/values-tr/strings.xml | 5 +- .../src/androidMain/res/values-uk/strings.xml | 5 +- .../src/androidMain/res/values/strings.xml | 5 +- .../notifications/NotificationCenterEvent.kt | 4 +- .../core/persistence/data/SettingsModel.kt | 3 +- .../repository/DefaultSettingsRepository.kt | 45 ++++- .../core/persistence/settings.sq | 15 ++ .../commonMain/sqldelight/migrations/25.sqm | 8 + .../colors/SettingsColorAndFontMviModel.kt | 6 +- .../colors/SettingsColorAndFontScreen.kt | 37 +++- .../colors/SettingsColorAndFontViewModel.kt | 21 ++- .../diegoberaldin/raccoonforlemmy/App.kt | 4 - .../AccountSettingsFormattedInfo.kt | 3 +- .../components/AccountSettingsTextualInfo.kt | 3 +- .../unit/chat/components/MessageCard.kt | 3 +- .../unit/choosefont/FontScaleBottomSheet.kt | 19 +- .../unit/communityinfo/CommunityInfoScreen.kt | 3 +- .../unit/instanceinfo/InstanceInfoScreen.kt | 3 +- .../unit/manageban/components/InstanceItem.kt | 13 +- .../unit/messages/components/ChatCard.kt | 3 +- .../unit/modlog/components/InnerModlogItem.kt | 3 +- .../reportlist/components/InnerReportCard.kt | 3 +- .../unit/userinfo/UserInfoScreen.kt | 5 +- 66 files changed, 491 insertions(+), 257 deletions(-) create mode 100644 core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ContentFontScales.kt create mode 100644 core/persistence/src/commonMain/sqldelight/migrations/25.sqm diff --git a/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ContentFontScales.kt b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ContentFontScales.kt new file mode 100644 index 000000000..ef6329b56 --- /dev/null +++ b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ContentFontScales.kt @@ -0,0 +1,15 @@ +package com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository + +data class ContentFontScales( + val title: Float = 1f, + val body: Float = 1f, + val comment: Float = 1f, + val ancillary: Float = 1f, +) + +sealed interface ContentFontClass { + data object Title : ContentFontClass + data object Body : ContentFontClass + data object Comment : ContentFontClass + data object AncillaryText : ContentFontClass +} \ No newline at end of file diff --git a/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/DefaultThemeRepository.kt b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/DefaultThemeRepository.kt index e0683cb3e..aee68ce96 100644 --- a/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/DefaultThemeRepository.kt +++ b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/DefaultThemeRepository.kt @@ -13,7 +13,7 @@ internal class DefaultThemeRepository : ThemeRepository { override val uiTheme = MutableStateFlow(null) override val uiFontFamily = MutableStateFlow(UiFontFamily.Poppins) override val uiFontScale = MutableStateFlow(1f) - override val contentFontScale = MutableStateFlow(1f) + override val contentFontScale = MutableStateFlow(ContentFontScales()) override val contentFontFamily = MutableStateFlow(UiFontFamily.Poppins) override val navItemTitles = MutableStateFlow(false) override val dynamicColors = MutableStateFlow(false) @@ -38,7 +38,7 @@ internal class DefaultThemeRepository : ThemeRepository { uiFontScale.value = value } - override fun changeContentFontScale(value: Float) { + override fun changeContentFontScale(value: ContentFontScales) { contentFontScale.value = value } diff --git a/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ThemeRepository.kt b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ThemeRepository.kt index c571d7bbc..937a18670 100644 --- a/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ThemeRepository.kt +++ b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/repository/ThemeRepository.kt @@ -14,7 +14,7 @@ interface ThemeRepository { val uiTheme: StateFlow val uiFontFamily: StateFlow val uiFontScale: StateFlow - val contentFontScale: StateFlow + val contentFontScale: StateFlow val contentFontFamily: StateFlow val navItemTitles: StateFlow val dynamicColors: StateFlow @@ -33,7 +33,7 @@ interface ThemeRepository { fun changeUiFontScale(value: Float) - fun changeContentFontScale(value: Float) + fun changeContentFontScale(value: ContentFontScales) fun changeContentFontFamily(value: UiFontFamily) diff --git a/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/theme/AppTheme.kt b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/theme/AppTheme.kt index fb5f69234..bda8e31e0 100644 --- a/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/theme/AppTheme.kt +++ b/core/appearance/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/appearance/theme/AppTheme.kt @@ -14,17 +14,12 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepos @Composable fun AppTheme( - theme: UiTheme?, - contentFontScale: Float, useDynamicColors: Boolean, barTheme: UiBarTheme = UiBarTheme.Solid, content: @Composable () -> Unit, ) { val repository = remember { - val res = getThemeRepository() - res.changeUiTheme(theme) - res.changeContentFontScale(contentFontScale) - res + getThemeRepository() } val themeState by repository.uiTheme.collectAsState() @@ -47,7 +42,7 @@ fun AppTheme( val barColorProvider = remember { getBarColorProvider() } barColorProvider.setBarColorAccordingToTheme( - theme = theme ?: defaultTheme, + theme = themeState ?: defaultTheme, barTheme = barTheme, ) diff --git a/core/commonui/components/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/components/CustomizedContent.kt b/core/commonui/components/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/components/CustomizedContent.kt index 343c043ef..08300b056 100644 --- a/core/commonui/components/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/components/CustomizedContent.kt +++ b/core/commonui/components/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/components/CustomizedContent.kt @@ -8,16 +8,26 @@ import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Density import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepository +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass @Composable -fun CustomizedContent(content: @Composable () -> Unit) { +fun CustomizedContent( + contentClass: ContentFontClass, + content: @Composable () -> Unit, +) { val themeRepository = remember { getThemeRepository() } val fontScale by themeRepository.contentFontScale.collectAsState() + val scaleFactor = when (contentClass) { + ContentFontClass.Title -> fontScale.title + ContentFontClass.Body -> fontScale.body + ContentFontClass.Comment -> fontScale.comment + ContentFontClass.AncillaryText -> fontScale.ancillary + } CompositionLocalProvider( LocalDensity provides Density( density = LocalDensity.current.density, - fontScale = fontScale, + fontScale = scaleFactor, ), ) { content() diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommentCard.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommentCard.kt index 4a2c246c8..28f65bea0 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommentCard.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommentCard.kt @@ -25,6 +25,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.toSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.VoteFormat import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepository +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent @@ -125,7 +126,7 @@ fun CommentCard( color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f), ) } else { - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { CompositionLocalProvider( LocalDensity provides Density( density = LocalDensity.current.density, diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityAndCreatorInfo.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityAndCreatorInfo.kt index a94dbc210..f669e43e9 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityAndCreatorInfo.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityAndCreatorInfo.kt @@ -32,10 +32,12 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.CornerSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomImage +import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PlaceholderImage import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.rememberCallback @@ -148,40 +150,44 @@ fun CommunityAndCreatorInfo( modifier = Modifier.padding(vertical = Spacing.xxxs), ) { if (community != null) { - Text( - modifier = Modifier - .onClick( - onClick = rememberCallback { - onOpenCommunity?.invoke(community) - }, - onDoubleClick = onDoubleClick ?: {}, - onLongClick = onLongClick ?: {}, - ), - text = communityName, - style = MaterialTheme.typography.bodySmall, - color = if (creator == null) ancillaryColor else fullColor, - ) + CustomizedContent(ContentFontClass.AncillaryText) { + Text( + modifier = Modifier + .onClick( + onClick = rememberCallback { + onOpenCommunity?.invoke(community) + }, + onDoubleClick = onDoubleClick ?: {}, + onLongClick = onLongClick ?: {}, + ), + text = communityName, + style = MaterialTheme.typography.bodySmall, + color = if (creator == null) ancillaryColor else fullColor, + ) + } } if (creator != null) { val translationAmount = 3.dp.toLocalPixel() - Text( - modifier = Modifier - .graphicsLayer { - if (communityName.isNotEmpty()) { - translationY = -translationAmount + CustomizedContent(ContentFontClass.AncillaryText) { + Text( + modifier = Modifier + .graphicsLayer { + if (communityName.isNotEmpty()) { + translationY = -translationAmount + } } - } - .onClick( - onClick = rememberCallback { - onOpenCreator?.invoke(creator) - }, - onDoubleClick = onDoubleClick ?: {}, - onLongClick = onLongClick ?: {}, - ), - text = creatorName, - style = MaterialTheme.typography.bodySmall, - color = ancillaryColor, - ) + .onClick( + onClick = rememberCallback { + onOpenCreator?.invoke(creator) + }, + onDoubleClick = onDoubleClick ?: {}, + onLongClick = onLongClick ?: {}, + ), + text = creatorName, + style = MaterialTheme.typography.bodySmall, + color = ancillaryColor, + ) + } } } if (isOp) { diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityItem.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityItem.kt index 8930073a4..e0a3d2499 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityItem.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/CommunityItem.kt @@ -34,7 +34,6 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomDropDown import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomImage -import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PlaceholderImage import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.rememberCallback @@ -85,106 +84,103 @@ fun CommunityItem( title = community.readableName(preferNicknames), ) } - - CustomizedContent { - Column( - modifier = Modifier.weight(1f) - ) { - val translationAmount = 3.dp.toLocalPixel() - Text( - text = buildString { - append(title) - }, - style = MaterialTheme.typography.bodyLarge, - color = fullColor, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - Text( - modifier = Modifier.graphicsLayer { - translationY = -translationAmount - }, - text = buildString { - append("!") - append(communityName) - }, - style = MaterialTheme.typography.bodySmall, - color = ancillaryColor, - ) - } - if (showSubscribers) { - Row( - modifier = Modifier.padding(start = Spacing.xxs), - horizontalArrangement = Arrangement.spacedBy(Spacing.xs), - verticalAlignment = Alignment.CenterVertically, - ) { - Text( - text = community.subscribers.toString(), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onBackground, - ) - Icon( - imageVector = Icons.Default.Group, - contentDescription = "", - tint = MaterialTheme.colorScheme.onBackground, - ) - } - } + Column( + modifier = Modifier.weight(1f) + ) { + val translationAmount = 3.dp.toLocalPixel() + Text( + text = buildString { + append(title) + }, + style = MaterialTheme.typography.bodyLarge, + color = fullColor, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + Text( + modifier = Modifier.graphicsLayer { + translationY = -translationAmount + }, + text = buildString { + append("!") + append(communityName) + }, + style = MaterialTheme.typography.bodySmall, + color = ancillaryColor, + ) } - - if (showFavorite) { - if (community.favorite) { + if (showSubscribers) { + Row( + modifier = Modifier.padding(start = Spacing.xxs), + horizontalArrangement = Arrangement.spacedBy(Spacing.xs), + verticalAlignment = Alignment.CenterVertically, + ) { + Text( + text = community.subscribers.toString(), + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onBackground, + ) Icon( - modifier = Modifier.size(IconSize.s), - imageVector = Icons.Default.Star, + imageVector = Icons.Default.Group, contentDescription = "", tint = MaterialTheme.colorScheme.onBackground, ) } } + } - if (options.isNotEmpty()) { - Box { - Icon( - modifier = Modifier.size(IconSize.m) - .padding(Spacing.xs) - .onGloballyPositioned { - optionsOffset = it.positionInParent() - } - .onClick( + if (showFavorite) { + if (community.favorite) { + Icon( + modifier = Modifier.size(IconSize.s), + imageVector = Icons.Default.Star, + contentDescription = "", + tint = MaterialTheme.colorScheme.onBackground, + ) + } + } + + if (options.isNotEmpty()) { + Box { + Icon( + modifier = Modifier.size(IconSize.m) + .padding(Spacing.xs) + .onGloballyPositioned { + optionsOffset = it.positionInParent() + } + .onClick( + onClick = rememberCallback { + optionsMenuOpen = true + }, + ), + imageVector = Icons.Default.MoreVert, + contentDescription = null, + tint = ancillaryColor, + ) + + CustomDropDown( + expanded = optionsMenuOpen, + onDismiss = { + optionsMenuOpen = false + }, + offset = DpOffset( + x = optionsOffset.x.toLocalDp(), + y = optionsOffset.y.toLocalDp(), + ), + ) { + options.forEach { option -> + Text( + modifier = Modifier.padding( + horizontal = Spacing.m, + vertical = Spacing.s, + ).onClick( onClick = rememberCallback { - optionsMenuOpen = true + optionsMenuOpen = false + onOptionSelected?.invoke(option.id) }, ), - imageVector = Icons.Default.MoreVert, - contentDescription = null, - tint = ancillaryColor, - ) - - CustomDropDown( - expanded = optionsMenuOpen, - onDismiss = { - optionsMenuOpen = false - }, - offset = DpOffset( - x = optionsOffset.x.toLocalDp(), - y = optionsOffset.y.toLocalDp(), - ), - ) { - options.forEach { option -> - Text( - modifier = Modifier.padding( - horizontal = Spacing.m, - vertical = Spacing.s, - ).onClick( - onClick = rememberCallback { - optionsMenuOpen = false - onOptionSelected?.invoke(option.id) - }, - ), - text = option.text, - ) - } + text = option.text, + ) } } } diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxCard.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxCard.kt index e411a128b..24074eaeb 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxCard.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxCard.kt @@ -16,6 +16,7 @@ import androidx.compose.ui.draw.shadow import androidx.compose.ui.unit.dp import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.PostLayout import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.VoteFormat +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.CornerSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent @@ -87,7 +88,7 @@ fun InboxCard( color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f), ) } else { - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { PostCardBody( modifier = Modifier.padding( horizontal = Spacing.xs, diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxReplySubtitle.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxReplySubtitle.kt index f7e5518ab..2d6dc4847 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxReplySubtitle.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/InboxReplySubtitle.kt @@ -37,10 +37,12 @@ import androidx.compose.ui.unit.dp import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.VoteFormat import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.formatToReadableValue import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepository +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomDropDown import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomImage +import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.FeedbackButton import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.rememberCallback @@ -120,14 +122,16 @@ fun InboxReplySubtitle( contentScale = ContentScale.FillBounds, ) } - Text( - modifier = Modifier.padding(vertical = Spacing.xs), - text = creatorName, - style = MaterialTheme.typography.bodySmall, - color = ancillaryColor, - overflow = TextOverflow.Ellipsis, - maxLines = 1, - ) + CustomizedContent(ContentFontClass.AncillaryText) { + Text( + modifier = Modifier.padding(vertical = Spacing.xs), + text = creatorName, + style = MaterialTheme.typography.bodySmall, + color = ancillaryColor, + overflow = TextOverflow.Ellipsis, + maxLines = 1, + ) + } } } if (communityName.isNotEmpty()) { @@ -156,14 +160,16 @@ fun InboxReplySubtitle( contentScale = ContentScale.FillBounds, ) } - Text( - modifier = Modifier.padding(vertical = Spacing.xs), - text = communityName, - style = MaterialTheme.typography.bodySmall, - overflow = TextOverflow.Ellipsis, - maxLines = 1, - color = ancillaryColor, - ) + CustomizedContent(ContentFontClass.AncillaryText) { + Text( + modifier = Modifier.padding(vertical = Spacing.xs), + text = communityName, + style = MaterialTheme.typography.bodySmall, + overflow = TextOverflow.Ellipsis, + maxLines = 1, + color = ancillaryColor, + ) + } } } } diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/MultiCommunityItem.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/MultiCommunityItem.kt index 08dac2f9d..04bb9390b 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/MultiCommunityItem.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/MultiCommunityItem.kt @@ -29,7 +29,6 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomDropDown import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomImage -import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PlaceholderImage import com.github.diegoberaldin.raccoonforlemmy.core.persistence.data.MultiCommunityModel import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick @@ -72,21 +71,21 @@ fun MultiCommunityItem( ) } - CustomizedContent { - Column( - modifier = Modifier.weight(1f) - ) { - Text( - modifier = Modifier.padding(vertical = Spacing.s), - text = buildString { - append(title) - }, - color = fullColor, - style = MaterialTheme.typography.bodyLarge, - ) - } + + Column( + modifier = Modifier.weight(1f) + ) { + Text( + modifier = Modifier.padding(vertical = Spacing.s), + text = buildString { + append(title) + }, + color = fullColor, + style = MaterialTheme.typography.bodyLarge, + ) } + if (options.isNotEmpty()) { Box { Icon( diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/PostCard.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/PostCard.kt index a5891347e..b829940a4 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/PostCard.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/PostCard.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.PostLayout import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.VoteFormat +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.CornerSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent @@ -226,7 +227,7 @@ private fun CompactPost( verticalAlignment = Alignment.Top, horizontalArrangement = Arrangement.spacedBy(Spacing.xs) ) { - CustomizedContent { + CustomizedContent(ContentFontClass.Title) { PostCardTitle( modifier = Modifier.weight(0.75f), text = post.title, @@ -370,7 +371,7 @@ private fun ExtendedPost( optionsMenuOpen.value = true }, ) - CustomizedContent { + CustomizedContent(ContentFontClass.Title) { PostCardTitle( modifier = Modifier.padding( vertical = Spacing.xs, @@ -437,7 +438,7 @@ private fun ExtendedPost( color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f), ) } else { - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { PostCardBody( modifier = Modifier.padding( top = Spacing.xxs, diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/UserItem.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/UserItem.kt index 35f48371d..73a0b09fe 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/UserItem.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/commonui/lemmyui/UserItem.kt @@ -30,7 +30,6 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomDropDown import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomImage -import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PlaceholderImage import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.rememberCallback @@ -78,13 +77,11 @@ fun UserItem( ) } - CustomizedContent { - Text( - text = user.readableHandle, - style = MaterialTheme.typography.bodySmall, - color = fullColor, - ) - } + Text( + text = user.readableHandle, + style = MaterialTheme.typography.bodySmall, + color = fullColor, + ) if (options.isNotEmpty()) { Box { diff --git a/core/l10n/src/androidMain/res/values-ar/strings.xml b/core/l10n/src/androidMain/res/values-ar/strings.xml index 578651705..e7a1f1d69 100644 --- a/core/l10n/src/androidMain/res/values-ar/strings.xml +++ b/core/l10n/src/androidMain/res/values-ar/strings.xml @@ -179,7 +179,7 @@ كبير جدا دوبل إكسترا لارج عادي - حجم نص المحتوى + حجم النص من المشاركات صغير صغيرة إضافية مزدوج إضافي صغير @@ -331,4 +331,7 @@ سمك شريط التعليق استخدم أسماء العرض للمستخدمين والمجتمعات تم وضع علامة على هذا الفيديو على أنه NSFW + حجم نص العناوين + حجم نص التعليقات + حجم النصوص المساعدة \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-bg/strings.xml b/core/l10n/src/androidMain/res/values-bg/strings.xml index 2a2d06745..56700bcfb 100644 --- a/core/l10n/src/androidMain/res/values-bg/strings.xml +++ b/core/l10n/src/androidMain/res/values-bg/strings.xml @@ -183,7 +183,7 @@ Много голям Двойна много голяма Нормална - Размер на текста на съдържанието + Размер на текста на публикациите Малко Много Малък Двойно по - малко @@ -341,4 +341,7 @@ Дебелина на лентата за коментари Използвайте показвани имена за потребители и общности Този видеоклип беше маркиран като NSFW + Размер на текста на заглавията + Размер на текста на коментарите + Размер на спомагателните текстове \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-cs/strings.xml b/core/l10n/src/androidMain/res/values-cs/strings.xml index 90a04f472..926408ea5 100644 --- a/core/l10n/src/androidMain/res/values-cs/strings.xml +++ b/core/l10n/src/androidMain/res/values-cs/strings.xml @@ -181,7 +181,7 @@ Extra velké Dvojité extra velké Normální - Velikost textu obsahu + Velikost textu příspěvků Malé Velmi malé Dvojité extra malé @@ -333,4 +333,7 @@ Komentář tloušťka tyče Používejte zobrazovaná jména pro uživatele a komunity Toto video bylo označeno jako NSFW + Velikost textu titulků + Velikost textu komentářů + Velikost pomocných textů \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-da/strings.xml b/core/l10n/src/androidMain/res/values-da/strings.xml index 5ee2b752c..b5b2b2c89 100644 --- a/core/l10n/src/androidMain/res/values-da/strings.xml +++ b/core/l10n/src/androidMain/res/values-da/strings.xml @@ -181,7 +181,7 @@ Ekstra stort Dobbelt ekstra stor Normal - Indhold tekst størrelse + Tekststørrelse på indlæg Lille Ekstra lille Dobbelt ekstra lille @@ -333,4 +333,7 @@ Kommentarbjælketykkelse Brug visningsnavne til brugere og fællesskaber Denne video blev markeret som NSFW + Tekststørrelse på titler + Tekststørrelse af kommentarer + Størrelse af hjælpetekster \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-de/strings.xml b/core/l10n/src/androidMain/res/values-de/strings.xml index a8b278f12..104fccdf2 100755 --- a/core/l10n/src/androidMain/res/values-de/strings.xml +++ b/core/l10n/src/androidMain/res/values-de/strings.xml @@ -183,7 +183,7 @@ Extra groß Doppelt extra groß Normal - Inhalt-Schriftgröße + Textgröße der Beiträge Klein Extra klein Doppelt extra klein @@ -341,4 +341,7 @@ Dicke der Kommentarleiste Verwenden Sie Anzeigenamen für Benutzer und Communities Dieses Video wurde als NSFW markiert + Textgröße der Titel + Textgröße von Kommentaren + Größe der Zusatztexte diff --git a/core/l10n/src/androidMain/res/values-el/strings.xml b/core/l10n/src/androidMain/res/values-el/strings.xml index ad1497dca..880f2dab1 100644 --- a/core/l10n/src/androidMain/res/values-el/strings.xml +++ b/core/l10n/src/androidMain/res/values-el/strings.xml @@ -183,7 +183,7 @@ Εξαιρετικά μεγάλο Διπλά εξαιρετικά μεγάλο Κανονικό - Μέγεθος κειμένου περιεχομένου + Μέγεθος κειμένου αναρτήσεων Μικρό Πολύ μικρό Διπλά πολύ μικρό @@ -344,4 +344,7 @@ Πάχος ράβδου σχολίων Χρησιμοποιήστε εμφανιζόμενα ονόματα για χρήστες και κοινότητες Αυτό το βίντεο επισημάνθηκε ως NSFW + Μέγεθος κειμένου των τίτλων + Μέγεθος κειμένου σχολίων + Μέγεθος βοηθητικών κειμένων \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-eo/strings.xml b/core/l10n/src/androidMain/res/values-eo/strings.xml index 4363eda29..9eae2648e 100644 --- a/core/l10n/src/androidMain/res/values-eo/strings.xml +++ b/core/l10n/src/androidMain/res/values-eo/strings.xml @@ -181,7 +181,7 @@ Pli granda Duoble pli granda Normala - Enhava tekstograndeco + Teksta grandeco de afiŝoj Malgranda Pli malgranda Duoble pli malgranda @@ -332,4 +332,7 @@ Komento trinkejo dikeco Uzu vidnomojn por uzantoj kaj komunumoj Ĉi tiu video estis markita kiel NSFW + Tekstograndeco de titoloj + Tekstograndeco de komentoj + Grandeco de helpaj tekstoj \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-es/strings.xml b/core/l10n/src/androidMain/res/values-es/strings.xml index 7baa775de..ad76ac512 100755 --- a/core/l10n/src/androidMain/res/values-es/strings.xml +++ b/core/l10n/src/androidMain/res/values-es/strings.xml @@ -181,7 +181,7 @@ Muy grande Extra grande Normal - Tamaño de texto del contenido + Tamaño de texto publicaciones Pequeño Muy pequeño Extra pequeño @@ -334,4 +334,7 @@ Grosor de la barra de comentarios Utilizar nombres para mostrar para usuarios y comunidades Este vídeo fue marcado como NSFW + Tamaño del texto de los títulos. + Tamaño del texto de los comentarios. + Tamaño de los textos auxiliares \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-et/strings.xml b/core/l10n/src/androidMain/res/values-et/strings.xml index 5105addb5..90b308f50 100644 --- a/core/l10n/src/androidMain/res/values-et/strings.xml +++ b/core/l10n/src/androidMain/res/values-et/strings.xml @@ -181,7 +181,7 @@ Eriti suur Kahekordne ülisuur Normaalne - Sisu teksti suurus + Postituste teksti suurus Väike Eriti väike Kahekordne üliväike @@ -333,4 +333,7 @@ Kommentaari riba paksus Kasutage kasutajate ja kogukondade jaoks kuvatavaid nimesid See video märgiti kui NSFW + Pealkirjade teksti suurus + Kommentaaride teksti suurus + Abitekstide suurus \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-fi/strings.xml b/core/l10n/src/androidMain/res/values-fi/strings.xml index c93f8f6aa..e5e62c251 100644 --- a/core/l10n/src/androidMain/res/values-fi/strings.xml +++ b/core/l10n/src/androidMain/res/values-fi/strings.xml @@ -181,7 +181,7 @@ Erittäin suuri Kaksinkertainen erittäin suuri Normaali - Sisällön tekstin koko + Viestien tekstikoko Pieni Erittäin pieni Kaksinkertainen erittäin pieni @@ -333,4 +333,7 @@ Kommenttipalkin paksuus Käytä näyttönimiä käyttäjille ja yhteisöille Tämä video on merkitty NSFW:ksi + Otsikon tekstikoko + Kommenttien tekstikoko + Aputekstien koko \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-fr/strings.xml b/core/l10n/src/androidMain/res/values-fr/strings.xml index e430a36d0..eaadcdf6c 100755 --- a/core/l10n/src/androidMain/res/values-fr/strings.xml +++ b/core/l10n/src/androidMain/res/values-fr/strings.xml @@ -183,7 +183,7 @@ Extra large Double extra large Normal - Tailler du texte des contenus + Tailler du texte des publications Petit Extra petit Double extra petit @@ -338,4 +338,7 @@ Épaisseur de la barre de commentaires Utiliser des noms d\'affichage pour les utilisateurs et les communautés Cette vidéo a été marquée comme NSFW + Taille du texte des titres + Taille du texte des commentaires + Taille des textes annexes \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-ga/strings.xml b/core/l10n/src/androidMain/res/values-ga/strings.xml index 01796f111..d45a83e3c 100644 --- a/core/l10n/src/androidMain/res/values-ga/strings.xml +++ b/core/l10n/src/androidMain/res/values-ga/strings.xml @@ -186,7 +186,7 @@ An - mhór An - mhór dúbailte Gnáth - Méid an ábhair + Méid téacs na bpostálacha Beag An - bheag Dhá oiread beag breise @@ -342,4 +342,7 @@ Tiús barra tráchta Úsáid ainmneacha taispeána le haghaidh úsáideoirí agus pobail Marcáladh an físeán seo mar NSFW + Méid téacs na dteideal + Méid téacs na dtuairimí + Méid na dtéacsanna coimhdeacha \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-hr/strings.xml b/core/l10n/src/androidMain/res/values-hr/strings.xml index 558fee25e..b04976512 100644 --- a/core/l10n/src/androidMain/res/values-hr/strings.xml +++ b/core/l10n/src/androidMain/res/values-hr/strings.xml @@ -183,7 +183,7 @@ Jako velika Dvostruko ekstra velika Normalno - Veličina teksta sadržaja + Veličina teksta postova Mali jako malo Dvostruko, vrlo malo @@ -338,4 +338,7 @@ Debljina trake komentara Koristite imena za prikaz za korisnike i zajednice Ovaj video je označen kao NSFW + Veličina teksta naslova + Veličina teksta komentara + Veličina pomoćnih tekstova \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-hu/strings.xml b/core/l10n/src/androidMain/res/values-hu/strings.xml index af9c9b732..8e869b1e9 100644 --- a/core/l10n/src/androidMain/res/values-hu/strings.xml +++ b/core/l10n/src/androidMain/res/values-hu/strings.xml @@ -181,7 +181,7 @@ Nagyon nagy Dupla extra nagy Átlagos - Tartalom szövegének mérete + Hozzászólások szövegmérete Kicsi Extra kicsi Dupla extra kicsi @@ -337,4 +337,7 @@ Megjegyzés sáv vastagsága Használjon megjelenített neveket a felhasználók és közösségek számára Ez a videó NSFW-ként lett megjelölve + Címek szövegmérete + Megjegyzések szövegmérete + A segédszövegek mérete \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-it/strings.xml b/core/l10n/src/androidMain/res/values-it/strings.xml index 3c0abf94d..53065bbec 100755 --- a/core/l10n/src/androidMain/res/values-it/strings.xml +++ b/core/l10n/src/androidMain/res/values-it/strings.xml @@ -183,7 +183,7 @@ Più grande Grandissimo Normale - Dimensione testo contenuti + Dimensione testo post Piccolo Più piccolo Piccolissimo @@ -337,4 +337,7 @@ Spessore barra dei commenti Utilizza nome visualizzato per utenti e comunità Questo video è stato contrassegnato come NSFW + Dimensione testo titoli + Dimensione testo commenti + Dimensione testi ancillari \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-lt/strings.xml b/core/l10n/src/androidMain/res/values-lt/strings.xml index 7780c2b43..a7a0c00f8 100644 --- a/core/l10n/src/androidMain/res/values-lt/strings.xml +++ b/core/l10n/src/androidMain/res/values-lt/strings.xml @@ -181,7 +181,7 @@ Εχτra large Dvivietis ypač didelis Normalus - Turinio teksto dydis + Įrašų teksto dydis Mažas Itin mažas Dvivietis itin mažas @@ -335,4 +335,7 @@ Komentarų juostos storis Naudokite rodomus vardus naudotojams ir bendruomenėms Šis vaizdo įrašas buvo pažymėtas kaip NSFW + Antraštės teksto dydis + Komentarų teksto dydis + Pagalbinių tekstų dydis \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-lv/strings.xml b/core/l10n/src/androidMain/res/values-lv/strings.xml index 0500a81c5..0eeed8dd1 100644 --- a/core/l10n/src/androidMain/res/values-lv/strings.xml +++ b/core/l10n/src/androidMain/res/values-lv/strings.xml @@ -182,7 +182,7 @@ Ļoti liels Divvietīgs, īpaši liels Parasta - Satura teksta lielums + Ziņu teksta lielums Neliela Ekstra mazs Divvietīgs, īpaši mazs @@ -337,4 +337,7 @@ Komentāru joslas biezums Izmantojiet parādāmos vārdus lietotājiem un kopienām Šis videoklips tika atzīmēts kā NSFW + Virsrakstu teksta lielums + Komentāru teksta lielums + Palīgtekstu lielums \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-mt/strings.xml b/core/l10n/src/androidMain/res/values-mt/strings.xml index fec9caffe..823b1a1a3 100644 --- a/core/l10n/src/androidMain/res/values-mt/strings.xml +++ b/core/l10n/src/androidMain/res/values-mt/strings.xml @@ -181,7 +181,7 @@ Iktar kbir Kbir żejjed doppju Normali - Daqs tat-test tal-kontenut + Daqs tat-test tal-postijiet Żgħir Iktar żgħir Żgħir żejjed doppju @@ -338,4 +338,7 @@ Ħxuna tal-bar tal-kumment Uża ismijiet tal-wiri għall-utenti u l-komunitajiet Dan il-video kien immarkat bħala NSFW + Daqs tat-test tat-titoli + Daqs tat-test tal-kummenti + Daqs tat-testi anċillari \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-nl/strings.xml b/core/l10n/src/androidMain/res/values-nl/strings.xml index 44d60fc48..0b1160bdb 100644 --- a/core/l10n/src/androidMain/res/values-nl/strings.xml +++ b/core/l10n/src/androidMain/res/values-nl/strings.xml @@ -183,7 +183,7 @@ Extra large Dubbel extra groot Normaal - Inhoud tekst grootte + Tekstgrootte van berichten Klein Extra klein Dubbel extra klein @@ -336,4 +336,7 @@ Opmerking staafdikte Gebruik weergavenamen voor gebruikers en community\'s Deze video is gemarkeerd als NSFW + Tekstgrootte van titels + Tekstgrootte van opmerkingen + Grootte van ondersteunende teksten \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-no/strings.xml b/core/l10n/src/androidMain/res/values-no/strings.xml index 1620821a0..aa4bc0d86 100644 --- a/core/l10n/src/androidMain/res/values-no/strings.xml +++ b/core/l10n/src/androidMain/res/values-no/strings.xml @@ -183,7 +183,7 @@ Ekstra stor Dobbel ekstra stor Normale - Content text size + Tekststørrelse på innlegg Små Ekstra liten Dobbel ekstra liten @@ -335,4 +335,7 @@ Kommentarstavtykkelse Bruk visningsnavn for brukere og fellesskap Denne videoen ble merket som NSFW + Tekststørrelse på titler + Tekststørrelse på kommentarer + Størrelse på hjelpetekster \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-pl/strings.xml b/core/l10n/src/androidMain/res/values-pl/strings.xml index 637fe0a18..1e10cc0df 100644 --- a/core/l10n/src/androidMain/res/values-pl/strings.xml +++ b/core/l10n/src/androidMain/res/values-pl/strings.xml @@ -182,7 +182,7 @@ Bardzo duży Podwójny bardzo duży Normalny - Rozmiar tekstu treści + Rozmiar tekstu postów Mały Bardzo mały Podwójny bardzo mały @@ -336,4 +336,7 @@ Grubość paska komentarza Używaj nazw wyświetlanych dla użytkowników i społeczności Ten film wideo został oznaczony jako NSFW + Rozmiar tekstu tytułów + Rozmiar tekstu komentarzy + Rozmiar tekstów pomocniczych \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-pt-rBR/strings.xml b/core/l10n/src/androidMain/res/values-pt-rBR/strings.xml index 173994a09..e00c33aaf 100644 --- a/core/l10n/src/androidMain/res/values-pt-rBR/strings.xml +++ b/core/l10n/src/androidMain/res/values-pt-rBR/strings.xml @@ -181,7 +181,7 @@ Extragrande Super extragrande Normal - Tamanho do texto de conteúdo + Tamanho do texto dos posts Pequeno Extra pequeno Super extrapequeno @@ -333,4 +333,7 @@ Espessura da barra de comentários Usar nomes de exibição para usuários e comunidades Este vídeo foi marcado como NSFW + Tamanho do texto dos títulos + Tamanho do texto dos comentários + Tamanho dos textos auxiliares diff --git a/core/l10n/src/androidMain/res/values-pt/strings.xml b/core/l10n/src/androidMain/res/values-pt/strings.xml index 1cec196d4..1b6ca57ab 100755 --- a/core/l10n/src/androidMain/res/values-pt/strings.xml +++ b/core/l10n/src/androidMain/res/values-pt/strings.xml @@ -181,7 +181,7 @@ Extra grande Duplo extra large Normal - Tamanho do texto dos conteúdos + Tamanho do texto das publicações Pequeno Extra pequeno Doblo extra pequeno @@ -335,4 +335,7 @@ Espessura da barra de comentários Usar nomes de exibição para usuários e comunidades Este vídeo foi marcado como NSFW + Tamanho do texto dos títulos + Tamanho do texto dos comentários + Tamanho dos textos auxiliares \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-ro/strings.xml b/core/l10n/src/androidMain/res/values-ro/strings.xml index 79b6664fc..98fdea987 100755 --- a/core/l10n/src/androidMain/res/values-ro/strings.xml +++ b/core/l10n/src/androidMain/res/values-ro/strings.xml @@ -182,7 +182,7 @@ Foarte mare Dublu extra mare Normal - Dimensiunea textului conținuturilor + Dimensiunea textului postărilor Mic Extra mic Dublu extra mic @@ -334,4 +334,7 @@ Grosimea barei comentariilor Utilizează nume afișate pentru utilizatori și comunități Acest videoclip a fost marcat ca NSFW + Dimensiunea textului titlurilor + Dimensiunea textului comentariilor + Dimensiunea textelor auxiliare \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-ru/strings.xml b/core/l10n/src/androidMain/res/values-ru/strings.xml index 8ae837762..ef62e64fd 100644 --- a/core/l10n/src/androidMain/res/values-ru/strings.xml +++ b/core/l10n/src/androidMain/res/values-ru/strings.xml @@ -181,7 +181,7 @@ Очень большой Double Extra Large Обычные - Размер текста содержимого + Размер текста постов Маленький Очень маленький Double Extra Small @@ -337,4 +337,7 @@ Толщина панели комментариев Используйте отображаемые имена для пользователей и сообществ Это видео было отмечено как NSFW. + Размер текста заголовков + Размер текста комментариев + Размер вспомогательных текстов \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-se/strings.xml b/core/l10n/src/androidMain/res/values-se/strings.xml index 120e86255..32611fae0 100644 --- a/core/l10n/src/androidMain/res/values-se/strings.xml +++ b/core/l10n/src/androidMain/res/values-se/strings.xml @@ -182,7 +182,7 @@ Extra stor Dubbel extra stor Normal - Innehållstextstorlek + Textstorlek på inlägg Liten Extra liten Dubbel extra liten @@ -334,4 +334,7 @@ Kommentarstapelns tjocklek Använd visningsnamn för användare och gemenskaper Den här videon markerades som NSFW + Textstorlek på titlar + Textstorlek på kommentarer + Storlek på tilläggstexter \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-sk/strings.xml b/core/l10n/src/androidMain/res/values-sk/strings.xml index 756edfa30..4b995eab0 100644 --- a/core/l10n/src/androidMain/res/values-sk/strings.xml +++ b/core/l10n/src/androidMain/res/values-sk/strings.xml @@ -183,7 +183,7 @@ Dvojité extra veľké V norme - Veľkosť textu obsahu + Veľkosť textu príspevkov Malá Extra Dvojité extra malé @@ -335,4 +335,7 @@ Komentár hrúbka pruhu Používať zobrazované mená pre používateľov a komunity Toto video bolo označené ako NSFW + Veľkosť textu titulkov + Veľkosť textu komentárov + Veľkosť pomocných textov \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-sl/strings.xml b/core/l10n/src/androidMain/res/values-sl/strings.xml index fabc8060f..9790e66cb 100644 --- a/core/l10n/src/androidMain/res/values-sl/strings.xml +++ b/core/l10n/src/androidMain/res/values-sl/strings.xml @@ -180,7 +180,7 @@ Zelo velika Dvojno, zelo veliko Normalno - Velikost besedila vsebine + Velikost besedila objav Majhna Zelo majhen Dvojno, zelo majhno @@ -333,4 +333,7 @@ Debelina vrstice za komentarje Uporabite prikazna imena za uporabnike in skupnosti Ta video je bil označen kot NSFW + Velikost besedila naslovov + Velikost besedila komentarjev + Velikost pomožnih besedil \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-sq/strings.xml b/core/l10n/src/androidMain/res/values-sq/strings.xml index 0bcd6b9c7..8bc1f923c 100644 --- a/core/l10n/src/androidMain/res/values-sq/strings.xml +++ b/core/l10n/src/androidMain/res/values-sq/strings.xml @@ -182,7 +182,7 @@ ekstra e madhe Dyfish më i madh Normale - Madhësia e tekstit të përmbajtjes + Madhësia e tekstit të postimeve Trupvogël Shumë e vogël Dyfish më i vogël @@ -339,4 +339,7 @@ Trashësia e shiritit të komenteve Përdorni emra të shfaqur për përdoruesit dhe komunitetet Kjo video u shënua si NSFW + Madhësia e tekstit të titujve + Madhësia e tekstit të komenteve + Madhësia e teksteve ndihmëse \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-tok/strings.xml b/core/l10n/src/androidMain/res/values-tok/strings.xml index 32e56ad55..3a1325976 100755 --- a/core/l10n/src/androidMain/res/values-tok/strings.xml +++ b/core/l10n/src/androidMain/res/values-tok/strings.xml @@ -181,7 +181,7 @@ suli mute suli mute mute pona - suli sitelen + suli sitelen lipu lili lili mute lili mute mute @@ -332,4 +332,7 @@ suli pi linja pi toki lili o lukin e nimi lili tan jan tan kulupu sitelen tawa ni li NSFW + suli sitelen pi toki suli + suli sitelen pi toki lili + suli sitelen pi nimi lili \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-tr/strings.xml b/core/l10n/src/androidMain/res/values-tr/strings.xml index be28c4b76..a6021ca38 100644 --- a/core/l10n/src/androidMain/res/values-tr/strings.xml +++ b/core/l10n/src/androidMain/res/values-tr/strings.xml @@ -181,7 +181,7 @@ Ekstra Büyük Double extra large Normal - İçerik Yazı Boyutu + Gönderilerin metin boyutu Küçük Ekstra Küçük Double extra small @@ -336,4 +336,7 @@ Yorum çubuğu kalınlığı Kullanıcılar ve topluluklar için görünen adları kullanın Bu video NSFW olarak işaretlendi + Başlıkların metin boyutu + Yorumların metin boyutu + Yardımcı metinlerin boyutu \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values-uk/strings.xml b/core/l10n/src/androidMain/res/values-uk/strings.xml index 236e42b2b..0a70995fb 100644 --- a/core/l10n/src/androidMain/res/values-uk/strings.xml +++ b/core/l10n/src/androidMain/res/values-uk/strings.xml @@ -181,7 +181,7 @@ Дуже великий Подвійний екстра-великий Нормальний - Розмір тексту контенту + Розмір тексту дописів Маленький Дуже малий Подвійний екстра малий @@ -336,4 +336,7 @@ Товщина панелі коментарів Використовуйте відображувані імена для користувачів і спільнот Це відео було позначено як NSFW + Розмір тексту заголовків + Розмір тексту коментарів + Розмір допоміжних текстів \ No newline at end of file diff --git a/core/l10n/src/androidMain/res/values/strings.xml b/core/l10n/src/androidMain/res/values/strings.xml index 7cf502c12..a70dc93b3 100755 --- a/core/l10n/src/androidMain/res/values/strings.xml +++ b/core/l10n/src/androidMain/res/values/strings.xml @@ -181,7 +181,7 @@ Extra large Double extra large Normal - Content text size + Post text size Small Extra small Double extra small @@ -331,4 +331,7 @@ Comment bar thickness Use display names for users and communities This video was marked as NSFW + Title text size + Comment text size + Ancillary text size \ No newline at end of file diff --git a/core/notifications/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/notifications/NotificationCenterEvent.kt b/core/notifications/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/notifications/NotificationCenterEvent.kt index a155ca67e..14dce5c4d 100644 --- a/core/notifications/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/notifications/NotificationCenterEvent.kt +++ b/core/notifications/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/notifications/NotificationCenterEvent.kt @@ -7,6 +7,7 @@ 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.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.persistence.data.ActionOnSwipe import com.github.diegoberaldin.raccoonforlemmy.core.persistence.data.ActionOnSwipeDirection import com.github.diegoberaldin.raccoonforlemmy.core.persistence.data.ActionOnSwipeTarget @@ -31,7 +32,8 @@ sealed interface NotificationCenterEvent { data class ChangeInboxType(val unreadOnly: Boolean) : NotificationCenterEvent data class ChangeTheme(val value: UiTheme?) : NotificationCenterEvent - data class ChangeContentFontSize(val value: Float) : NotificationCenterEvent + data class ChangeContentFontSize(val value: Float, val contentClass: ContentFontClass) : + NotificationCenterEvent data class ChangeUiFontSize(val value: Float) : NotificationCenterEvent data class ChangeFontFamily(val value: UiFontFamily) : NotificationCenterEvent data class ChangeContentFontFamily(val value: UiFontFamily) : NotificationCenterEvent diff --git a/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/data/SettingsModel.kt b/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/data/SettingsModel.kt index 048430302..f2172f19e 100644 --- a/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/data/SettingsModel.kt +++ b/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/data/SettingsModel.kt @@ -1,6 +1,7 @@ package com.github.diegoberaldin.raccoonforlemmy.core.persistence.data import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.VoteFormat +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontScales import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds @@ -9,7 +10,7 @@ data class SettingsModel( val theme: Int? = null, val uiFontFamily: Int = 0, val uiFontScale: Float = 1f, - val contentFontScale: Float = 1f, + val contentFontScale: ContentFontScales = ContentFontScales(), val contentFontFamily: Int = 0, val locale: String? = null, val defaultListingType: Int = 2, diff --git a/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/repository/DefaultSettingsRepository.kt b/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/repository/DefaultSettingsRepository.kt index 8175d2f0d..5c3dfdd9b 100644 --- a/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/repository/DefaultSettingsRepository.kt +++ b/core/persistence/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/core/persistence/repository/DefaultSettingsRepository.kt @@ -2,6 +2,7 @@ package com.github.diegoberaldin.raccoonforlemmy.core.persistence.repository import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toLong import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toVoteFormat +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontScales import com.github.diegoberaldin.raccoonforlemmy.core.persistence.DatabaseProvider import com.github.diegoberaldin.raccoonforlemmy.core.persistence.GetBy import com.github.diegoberaldin.raccoonforlemmy.core.persistence.data.ActionOnSwipe @@ -19,7 +20,10 @@ private object KeyStoreKeys { const val UI_THEME = "uiTheme" const val UI_FONT_FAMILY = "uiFontFamily" const val UI_FONT_SCALE = "uiFontSize" - const val CONTENT_FONT_SCALE = "contentFontSize" + const val CONTENT_TITLE_FONT_SCALE = "titleFontSize" + const val CONTENT_BODY_FONT_SCALE = "contentFontSize" + const val CONTENT_COMMENT_FONT_SCALE = "commentFontSize" + const val CONTENT_ANCILLARY_FONT_SCALE = "ancillaryFontSize" const val LOCALE = "locale" const val DEFAULT_LISTING_TYPE = "defaultListingType" const val DEFAULT_POST_SORT_TYPE = "defaultPostSortType" @@ -69,7 +73,10 @@ internal class DefaultSettingsRepository( theme = settings.theme?.toLong(), uiFontScale = settings.uiFontScale.toDouble(), uiFontFamily = settings.uiFontFamily.toLong(), - contentFontScale = settings.contentFontScale.toDouble(), + titleFontScale = settings.contentFontScale.title.toDouble(), + contentFontScale = settings.contentFontScale.body.toDouble(), + commentFontScale = settings.contentFontScale.comment.toDouble(), + ancillaryFontScale = settings.contentFontScale.ancillary.toDouble(), locale = settings.locale, defaultListingType = settings.defaultListingType.toLong(), defaultPostSortType = settings.defaultPostSortType.toLong(), @@ -126,13 +133,19 @@ internal class DefaultSettingsRepository( withContext(Dispatchers.IO) { if (accountId == null) { // anonymous user, reading from keystore + val contentFontScale = ContentFontScales( + title = keyStore[KeyStoreKeys.CONTENT_TITLE_FONT_SCALE, 1f], + body = keyStore[KeyStoreKeys.CONTENT_BODY_FONT_SCALE, 1f], + comment = keyStore[KeyStoreKeys.CONTENT_COMMENT_FONT_SCALE, 1f], + ancillary = keyStore[KeyStoreKeys.CONTENT_ANCILLARY_FONT_SCALE, 1f], + ) SettingsModel( theme = if (keyStore.containsKey(KeyStoreKeys.UI_THEME)) { keyStore[KeyStoreKeys.UI_THEME, 0] } else null, uiFontScale = keyStore[KeyStoreKeys.UI_FONT_SCALE, 1f], uiFontFamily = keyStore[KeyStoreKeys.UI_FONT_FAMILY, 0], - contentFontScale = keyStore[KeyStoreKeys.CONTENT_FONT_SCALE, 1f], + contentFontScale = contentFontScale, locale = keyStore[KeyStoreKeys.LOCALE, ""].takeIf { it.isNotEmpty() }, defaultListingType = keyStore[KeyStoreKeys.DEFAULT_LISTING_TYPE, 2], defaultPostSortType = keyStore[KeyStoreKeys.DEFAULT_POST_SORT_TYPE, 1], @@ -186,7 +199,19 @@ internal class DefaultSettingsRepository( } keyStore.save(KeyStoreKeys.UI_FONT_SCALE, settings.uiFontScale) keyStore.save(KeyStoreKeys.UI_FONT_FAMILY, settings.uiFontFamily) - keyStore.save(KeyStoreKeys.CONTENT_FONT_SCALE, settings.contentFontScale) + keyStore.save( + KeyStoreKeys.CONTENT_TITLE_FONT_SCALE, + settings.contentFontScale.title + ) + keyStore.save(KeyStoreKeys.CONTENT_BODY_FONT_SCALE, settings.contentFontScale.body) + keyStore.save( + KeyStoreKeys.CONTENT_COMMENT_FONT_SCALE, + settings.contentFontScale.comment + ) + keyStore.save( + KeyStoreKeys.CONTENT_ANCILLARY_FONT_SCALE, + settings.contentFontScale.ancillary + ) if (!settings.locale.isNullOrEmpty()) { keyStore.save(KeyStoreKeys.LOCALE, settings.locale) } else { @@ -260,7 +285,10 @@ internal class DefaultSettingsRepository( theme = settings.theme?.toLong(), uiFontScale = settings.uiFontScale.toDouble(), uiFontFamily = settings.uiFontFamily.toLong(), - contentFontScale = settings.contentFontScale.toDouble(), + titleFontScale = settings.contentFontScale.title.toDouble(), + contentFontScale = settings.contentFontScale.body.toDouble(), + commentFontScale = settings.contentFontScale.comment.toDouble(), + ancillaryFontScale = settings.contentFontScale.ancillary.toDouble(), locale = settings.locale, defaultListingType = settings.defaultListingType.toLong(), defaultPostSortType = settings.defaultPostSortType.toLong(), @@ -324,7 +352,12 @@ private fun GetBy.toModel() = SettingsModel( theme = theme?.toInt(), uiFontScale = uiFontScale.toFloat(), uiFontFamily = uiFontFamily.toInt(), - contentFontScale = contentFontScale.toFloat(), + contentFontScale = ContentFontScales( + title = titleFontScale.toFloat(), + body = contentFontScale.toFloat(), + comment = commentFontScale.toFloat(), + ancillary = ancillaryFontScale.toFloat(), + ), locale = locale, defaultListingType = defaultListingType.toInt(), defaultPostSortType = defaultPostSortType.toInt(), diff --git a/core/persistence/src/commonMain/sqldelight/com/github/diegoberaldin/raccoonforlemmy/core/persistence/settings.sq b/core/persistence/src/commonMain/sqldelight/com/github/diegoberaldin/raccoonforlemmy/core/persistence/settings.sq index 17cd57a14..53e5149e0 100644 --- a/core/persistence/src/commonMain/sqldelight/com/github/diegoberaldin/raccoonforlemmy/core/persistence/settings.sq +++ b/core/persistence/src/commonMain/sqldelight/com/github/diegoberaldin/raccoonforlemmy/core/persistence/settings.sq @@ -3,7 +3,10 @@ CREATE TABLE SettingsEntity ( theme INTEGER DEFAULT NULL, uiFontScale REAL NOT NULL DEFAULT 1, uiFontFamily INTEGER NOT NULL DEFAULT 0, + titleFontScale REAL NOT NULL DEFAULT 1, contentFontScale REAL NOT NULL DEFAULT 1, + commentFontScale REAL NOT NULL DEFAULT 1, + ancillaryFontScale REAL NOT NULL DEFAULT 1, locale TEXT DEFAULT NULL, defaultListingType INTEGER NOT NULL DEFAULT 0, defaultPostSortType INTEGER NOT NULL DEFAULT 0, @@ -56,7 +59,10 @@ INSERT OR IGNORE INTO SettingsEntity ( theme, uiFontScale, uiFontFamily, + titleFontScale, contentFontScale, + commentFontScale, + ancillaryFontScale, locale, defaultListingType, defaultPostSortType, @@ -147,6 +153,9 @@ INSERT OR IGNORE INTO SettingsEntity ( ?, ?, ?, + ?, + ?, + ?, ? ); @@ -155,7 +164,10 @@ UPDATE SettingsEntity SET theme = ?, uiFontScale = ?, uiFontFamily = ?, + titleFontScale = ?, contentFontScale = ?, + commentFontScale = ?, + ancillaryFontScale = ?, locale = ?, defaultListingType = ?, defaultPostSortType = ?, @@ -206,7 +218,10 @@ SELECT theme, uiFontScale, uiFontFamily, + titleFontScale, contentFontScale, + commentFontScale, + ancillaryFontScale, locale, defaultListingType, defaultPostSortType, diff --git a/core/persistence/src/commonMain/sqldelight/migrations/25.sqm b/core/persistence/src/commonMain/sqldelight/migrations/25.sqm new file mode 100644 index 000000000..b219a2b37 --- /dev/null +++ b/core/persistence/src/commonMain/sqldelight/migrations/25.sqm @@ -0,0 +1,8 @@ +ALTER TABLE SettingsEntity +ADD COLUMN titleFontScale REAL NOT NULL DEFAULT 1; + +ALTER TABLE SettingsEntity +ADD COLUMN commentFontScale REAL NOT NULL DEFAULT 1; + +ALTER TABLE SettingsEntity +ADD COLUMN ancillaryFontScale REAL NOT NULL DEFAULT 1; 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 index 1faca6d75..8ecb05e53 100644 --- 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 @@ -3,9 +3,9 @@ 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.appearance.repository.ContentFontScales import com.github.diegoberaldin.raccoonforlemmy.core.architecture.MviModel interface SettingsColorAndFontMviModel : @@ -28,9 +28,9 @@ interface SettingsColorAndFontMviModel : val saveColor: Color? = null, val commentBarTheme: CommentBarTheme = CommentBarTheme.Blue, val commentBarThickness: Int = 1, - val uiFontScale: FontScale = FontScale.Normal, + val uiFontScale: Float = 1f, val uiFontFamily: UiFontFamily = UiFontFamily.Poppins, - val contentFontScale: FontScale = FontScale.Normal, + val contentFontScale: ContentFontScales = ContentFontScales(), val contentFontFamily: UiFontFamily = UiFontFamily.Poppins, ) 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 index bc7e5bbb3..3e25147f3 100644 --- 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 @@ -34,9 +34,11 @@ 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.toFontScale 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.repository.ContentFontClass 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 @@ -245,7 +247,7 @@ class SettingsColorAndFontScreen : Screen { // font scale SettingsRow( title = LocalXmlStrings.current.settingsUiFontScale, - value = uiState.uiFontScale.toReadableName(), + value = uiState.uiFontScale.toFontScale().toReadableName(), onTap = rememberCallback { val sheet = FontScaleBottomSheet( values = listOf( @@ -253,16 +255,41 @@ class SettingsColorAndFontScreen : Screen { FontScale.Normal, FontScale.Small, ).map { it.scaleFactor }, - content = false, ) navigationCoordinator.showBottomSheet(sheet) }, ) SettingsRow( - title = LocalXmlStrings.current.settingsContentFontScale, - value = uiState.contentFontScale.toReadableName(), + title = LocalXmlStrings.current.settingsTitleFontScale, + value = uiState.contentFontScale.title.toFontScale().toReadableName(), onTap = rememberCallback { - val sheet = FontScaleBottomSheet(content = true) + val sheet = FontScaleBottomSheet(contentClass = ContentFontClass.Title) + navigationCoordinator.showBottomSheet(sheet) + }, + ) + SettingsRow( + title = LocalXmlStrings.current.settingsContentFontScale, + value = uiState.contentFontScale.body.toFontScale().toReadableName(), + onTap = rememberCallback { + val sheet = FontScaleBottomSheet(contentClass = ContentFontClass.Body) + navigationCoordinator.showBottomSheet(sheet) + }, + ) + SettingsRow( + title = LocalXmlStrings.current.settingsCommentFontScale, + value = uiState.contentFontScale.comment.toFontScale().toReadableName(), + onTap = rememberCallback { + val sheet = + FontScaleBottomSheet(contentClass = ContentFontClass.Comment) + navigationCoordinator.showBottomSheet(sheet) + }, + ) + SettingsRow( + title = LocalXmlStrings.current.settingsAncillaryFontScale, + value = uiState.contentFontScale.ancillary.toFontScale().toReadableName(), + onTap = rememberCallback { + val sheet = + FontScaleBottomSheet(contentClass = ContentFontClass.AncillaryText) navigationCoordinator.showBottomSheet(sheet) }, ) 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 index a19950f8b..6a7f93aea 100644 --- 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 @@ -4,8 +4,8 @@ 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.ContentFontClass 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 @@ -43,13 +43,13 @@ class SettingsColorAndFontViewModel( updateState { it.copy(uiFontFamily = value) } }.launchIn(this) themeRepository.contentFontScale.onEach { value -> - updateState { it.copy(contentFontScale = value.toFontScale()) } + updateState { it.copy(contentFontScale = value) } }.launchIn(this) themeRepository.contentFontFamily.onEach { value -> updateState { it.copy(contentFontFamily = value) } }.launchIn(this) themeRepository.uiFontScale.onEach { value -> - updateState { it.copy(uiFontScale = value.toFontScale()) } + updateState { it.copy(uiFontScale = value) } }.launchIn(this) themeRepository.dynamicColors.onEach { value -> updateState { it.copy(dynamicColors = value) } @@ -86,7 +86,7 @@ class SettingsColorAndFontViewModel( }.launchIn(this) notificationCenter.subscribe(NotificationCenterEvent.ChangeContentFontSize::class) .onEach { evt -> - changeContentFontScale(evt.value) + changeContentFontScale(evt.value, evt.contentClass) }.launchIn(this) notificationCenter.subscribe(NotificationCenterEvent.ChangeContentFontFamily::class) .onEach { evt -> @@ -152,11 +152,18 @@ class SettingsColorAndFontViewModel( } } - private fun changeContentFontScale(value: Float) { - themeRepository.changeContentFontScale(value) + private fun changeContentFontScale(value: Float, contentClass: ContentFontClass) { + val contentFontScale = themeRepository.contentFontScale.value.let { + when (contentClass) { + ContentFontClass.Title -> it.copy(title = value) + ContentFontClass.Body -> it.copy(body = value) + ContentFontClass.Comment -> it.copy(comment = value) + ContentFontClass.AncillaryText -> it.copy(ancillary = value) + } + } scope?.launch(Dispatchers.IO) { val settings = settingsRepository.currentSettings.value.copy( - contentFontScale = value + contentFontScale = contentFontScale ) saveSettings(settings) } diff --git a/shared/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/App.kt b/shared/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/App.kt index a915bc81c..da494b91c 100644 --- a/shared/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/App.kt +++ b/shared/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/App.kt @@ -74,9 +74,7 @@ fun App(onLoadingFinished: () -> Unit = {}) { UiTheme.Light }.toInt() val locale by derivedStateOf { settings.locale } - val currentTheme by themeRepository.uiTheme.collectAsState() val useDynamicColors by themeRepository.dynamicColors.collectAsState() - val fontScale by themeRepository.contentFontScale.collectAsState() val uiFontScale by themeRepository.uiFontScale.collectAsState() val navigationCoordinator = remember { getNavigationCoordinator() } val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed) @@ -227,8 +225,6 @@ fun App(onLoadingFinished: () -> Unit = {}) { else -> UiBarTheme.Solid } AppTheme( - theme = currentTheme, - contentFontScale = fontScale, useDynamicColors = useDynamicColors, barTheme = barTheme, ) { diff --git a/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsFormattedInfo.kt b/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsFormattedInfo.kt index 02f6e1f2e..44758f792 100644 --- a/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsFormattedInfo.kt +++ b/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsFormattedInfo.kt @@ -9,6 +9,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent import com.github.diegoberaldin.raccoonforlemmy.core.commonui.lemmyui.PostCardBody @@ -43,7 +44,7 @@ internal fun AccountSettingsFormattedInfo( style = MaterialTheme.typography.labelMedium, color = ancillaryColor, ) - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { PostCardBody( text = value, onClick = rememberCallback { diff --git a/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsTextualInfo.kt b/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsTextualInfo.kt index 687576da8..4986903de 100644 --- a/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsTextualInfo.kt +++ b/unit/accountsettings/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/accountsettings/components/AccountSettingsTextualInfo.kt @@ -10,6 +10,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.text.TextStyle +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.onClick @@ -45,7 +46,7 @@ internal fun AccountSettingsTextualInfo( style = MaterialTheme.typography.labelMedium, color = ancillaryColor, ) - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { Text( text = value, style = valueStyle, diff --git a/unit/chat/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/chat/components/MessageCard.kt b/unit/chat/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/chat/components/MessageCard.kt index a8f2266d9..5f0a36ea4 100644 --- a/unit/chat/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/chat/components/MessageCard.kt +++ b/unit/chat/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/chat/components/MessageCard.kt @@ -30,6 +30,7 @@ import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.layout.positionInParent import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.CornerSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing @@ -114,7 +115,7 @@ internal fun MessageCard( ) ).fillMaxWidth().padding(Spacing.s) ) { - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { Column { PostCardBody( text = content, diff --git a/unit/choosefont/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/choosefont/FontScaleBottomSheet.kt b/unit/choosefont/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/choosefont/FontScaleBottomSheet.kt index 1c8796d27..f3658adb7 100644 --- a/unit/choosefont/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/choosefont/FontScaleBottomSheet.kt +++ b/unit/choosefont/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/choosefont/FontScaleBottomSheet.kt @@ -18,6 +18,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.FontScale import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.scaleFactor import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toFontScale import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.toReadableName +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.BottomSheetHandle import com.github.diegoberaldin.raccoonforlemmy.core.l10n.LocalXmlStrings @@ -40,7 +41,7 @@ private val defaultChoices: List = listOf( class FontScaleBottomSheet( private val values: List = defaultChoices, - private val content: Boolean, + private val contentClass: ContentFontClass? = null, ) : Screen { @Composable @@ -61,13 +62,20 @@ class FontScaleBottomSheet( horizontalAlignment = Alignment.CenterHorizontally ) { BottomSheetHandle() + val title = when (contentClass) { + ContentFontClass.Title -> LocalXmlStrings.current.settingsTitleFontScale + ContentFontClass.Body -> LocalXmlStrings.current.settingsContentFontScale + ContentFontClass.Comment -> LocalXmlStrings.current.settingsCommentFontScale + ContentFontClass.AncillaryText -> LocalXmlStrings.current.settingsAncillaryFontScale + else -> LocalXmlStrings.current.settingsUiFontScale + } Text( modifier = Modifier.padding( start = Spacing.s, top = Spacing.s, end = Spacing.s, ), - text = LocalXmlStrings.current.settingsContentFontScale, + text = title, style = MaterialTheme.typography.titleLarge, color = MaterialTheme.colorScheme.onBackground, ) @@ -87,8 +95,11 @@ class FontScaleBottomSheet( .onClick( onClick = rememberCallback { notificationCenter.send( - if (content) { - NotificationCenterEvent.ChangeContentFontSize(value) + if (contentClass != null) { + NotificationCenterEvent.ChangeContentFontSize( + value = value, + contentClass = contentClass + ) } else { NotificationCenterEvent.ChangeUiFontSize(value) } diff --git a/unit/communityinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/communityinfo/CommunityInfoScreen.kt b/unit/communityinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/communityinfo/CommunityInfoScreen.kt index 9e2a9470c..475f62130 100644 --- a/unit/communityinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/communityinfo/CommunityInfoScreen.kt +++ b/unit/communityinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/communityinfo/CommunityInfoScreen.kt @@ -30,6 +30,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import cafe.adriel.voyager.core.screen.Screen +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.architecture.bindToLifecycle import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.BottomSheetHandle @@ -203,7 +204,7 @@ class CommunityInfoScreen( } } item { - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { PostCardBody( modifier = Modifier.fillMaxWidth().padding(top = Spacing.m), text = uiState.community.description, diff --git a/unit/instanceinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/instanceinfo/InstanceInfoScreen.kt b/unit/instanceinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/instanceinfo/InstanceInfoScreen.kt index 2e4d42ba1..50588690d 100644 --- a/unit/instanceinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/instanceinfo/InstanceInfoScreen.kt +++ b/unit/instanceinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/instanceinfo/InstanceInfoScreen.kt @@ -36,6 +36,7 @@ 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 com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.architecture.bindToLifecycle import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomizedContent @@ -174,7 +175,7 @@ class InstanceInfoScreen( verticalArrangement = Arrangement.spacedBy(Spacing.xs), ) { item { - CustomizedContent { + CustomizedContent(ContentFontClass.Title) { Column( modifier = Modifier.padding(horizontal = Spacing.s), verticalArrangement = Arrangement.spacedBy(Spacing.s), diff --git a/unit/manageban/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/manageban/components/InstanceItem.kt b/unit/manageban/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/manageban/components/InstanceItem.kt index c0d364b3d..75aa88d54 100644 --- a/unit/manageban/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/manageban/components/InstanceItem.kt +++ b/unit/manageban/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/manageban/components/InstanceItem.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.layout.positionInParent import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomDropDown @@ -61,13 +62,11 @@ fun InstanceItem( title = name, ) - CustomizedContent { - Text( - text = name, - style = MaterialTheme.typography.bodySmall, - color = fullColor, - ) - } + Text( + text = name, + style = MaterialTheme.typography.bodySmall, + color = fullColor, + ) if (options.isNotEmpty()) { Box { diff --git a/unit/messages/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/messages/components/ChatCard.kt b/unit/messages/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/messages/components/ChatCard.kt index c0e88a1bb..cd60a9a50 100644 --- a/unit/messages/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/messages/components/ChatCard.kt +++ b/unit/messages/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/messages/components/ChatCard.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.layout.positionInParent import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomDropDown @@ -124,7 +125,7 @@ internal fun ChatCard( color = ancillaryColor, ) } - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { // last message text PostCardBody( maxLines = 2, diff --git a/unit/modlog/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/modlog/components/InnerModlogItem.kt b/unit/modlog/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/modlog/components/InnerModlogItem.kt index a98b0545b..14c3ca7dd 100644 --- a/unit/modlog/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/modlog/components/InnerModlogItem.kt +++ b/unit/modlog/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/modlog/components/InnerModlogItem.kt @@ -39,6 +39,7 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.PostLayout +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.CornerSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing @@ -95,7 +96,7 @@ internal fun InnerModlogItem( preferNicknames = preferNicknames, onOpenCreator = onOpenUser, ) - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { if (reason != null) { PostCardBody( modifier = Modifier.padding( diff --git a/unit/reportlist/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/reportlist/components/InnerReportCard.kt b/unit/reportlist/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/reportlist/components/InnerReportCard.kt index bd9d5352b..4e3f3fa91 100644 --- a/unit/reportlist/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/reportlist/components/InnerReportCard.kt +++ b/unit/reportlist/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/reportlist/components/InnerReportCard.kt @@ -40,6 +40,7 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp import com.github.diegoberaldin.raccoonforlemmy.core.appearance.data.PostLayout +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.CornerSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing @@ -97,7 +98,7 @@ internal fun InnerReportCard( onOpenCreator = onOpenCreator, preferNicknames = preferNicknames, ) - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { PostCardBody( modifier = Modifier.padding( horizontal = Spacing.xs, diff --git a/unit/userinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/userinfo/UserInfoScreen.kt b/unit/userinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/userinfo/UserInfoScreen.kt index d38352676..0529e8584 100644 --- a/unit/userinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/userinfo/UserInfoScreen.kt +++ b/unit/userinfo/src/commonMain/kotlin/com/github/diegoberaldin/raccoonforlemmy/unit/userinfo/UserInfoScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.ui.text.style.TextAlign import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.koin.getScreenModel import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepository +import com.github.diegoberaldin.raccoonforlemmy.core.appearance.repository.ContentFontClass import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.toTypography import com.github.diegoberaldin.raccoonforlemmy.core.architecture.bindToLifecycle @@ -162,7 +163,7 @@ class UserInfoScreen( style = MaterialTheme.typography.labelMedium, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f), ) - CustomizedContent { + CustomizedContent(ContentFontClass.Body) { PostCardBody( modifier = Modifier.fillMaxWidth(), text = biography, @@ -226,7 +227,7 @@ class UserInfoScreen( style = MaterialTheme.typography.labelMedium, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.75f), ) - CustomizedContent { + CustomizedContent(ContentFontClass.AncillaryText) { SelectionContainer { Text( text = matrixUserId,