From 0c5f1b2cfbcf135fa7a3502b7eceb6a914319f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C9=91rry=20Shiv=C9=91m?= Date: Thu, 10 Oct 2024 14:37:57 +0530 Subject: [PATCH] feat: Make fontsize controls more granular (#231) Signed-off-by: starry-shivam --- .../ui/screens/reader/main/composables/ChaptersContent.kt | 6 +++--- .../ui/screens/reader/main/composables/ReaderBottomBar.kt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ChaptersContent.kt b/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ChaptersContent.kt index 4044094..d0961e1 100644 --- a/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ChaptersContent.kt +++ b/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ChaptersContent.kt @@ -94,7 +94,7 @@ private fun ChapterLazyItemItem( val paragraphs = remember { chunkText(chapter.body) } val targetFontSize = remember(state.fontSize) { - (state.fontSize / 10) * 1.8f + (state.fontSize / 5) * 0.9f } val fontSize by animateFloatAsState( @@ -103,7 +103,7 @@ private fun ChapterLazyItemItem( label = "fontSize" ) val titleFontSize by animateFloatAsState( - targetValue = targetFontSize * 1.4f, + targetValue = targetFontSize * 1.35f, animationSpec = tween(durationMillis = 300), label = "titleFontSize" ) @@ -202,7 +202,7 @@ private fun ChapterLazyItemItem( modifier = Modifier.padding(start = 12.dp, end = 4.dp, top = 10.dp), text = chapter.title, fontSize = titleFontSize.sp, - lineHeight = 32.sp, + lineHeight = 1.3f.em, fontFamily = pacificoFont, fontWeight = FontWeight.Medium, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.88f) diff --git a/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ReaderBottomBar.kt b/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ReaderBottomBar.kt index 903b2a2..34c1554 100644 --- a/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ReaderBottomBar.kt +++ b/app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ReaderBottomBar.kt @@ -169,8 +169,8 @@ private fun ReaderTextScaleButton( val context = LocalContext.current val (iconRes, adjustment) = remember(buttonType) { when (buttonType) { - TextScaleButtonType.DECREASE -> Pair(R.drawable.ic_reader_text_minus, -10) - TextScaleButtonType.INCREASE -> Pair(R.drawable.ic_reader_text_plus, 10) + TextScaleButtonType.DECREASE -> Pair(R.drawable.ic_reader_text_minus, -5) + TextScaleButtonType.INCREASE -> Pair(R.drawable.ic_reader_text_plus, 5) } }