Skip to content

Commit 0c5f1b2

Browse files
feat: Make fontsize controls more granular (#231)
Signed-off-by: starry-shivam <[email protected]>
1 parent fbd93b2 commit 0c5f1b2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ChaptersContent.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private fun ChapterLazyItemItem(
9494
val paragraphs = remember { chunkText(chapter.body) }
9595

9696
val targetFontSize = remember(state.fontSize) {
97-
(state.fontSize / 10) * 1.8f
97+
(state.fontSize / 5) * 0.9f
9898
}
9999

100100
val fontSize by animateFloatAsState(
@@ -103,7 +103,7 @@ private fun ChapterLazyItemItem(
103103
label = "fontSize"
104104
)
105105
val titleFontSize by animateFloatAsState(
106-
targetValue = targetFontSize * 1.4f,
106+
targetValue = targetFontSize * 1.35f,
107107
animationSpec = tween(durationMillis = 300),
108108
label = "titleFontSize"
109109
)
@@ -202,7 +202,7 @@ private fun ChapterLazyItemItem(
202202
modifier = Modifier.padding(start = 12.dp, end = 4.dp, top = 10.dp),
203203
text = chapter.title,
204204
fontSize = titleFontSize.sp,
205-
lineHeight = 32.sp,
205+
lineHeight = 1.3f.em,
206206
fontFamily = pacificoFont,
207207
fontWeight = FontWeight.Medium,
208208
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.88f)

app/src/main/java/com/starry/myne/ui/screens/reader/main/composables/ReaderBottomBar.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ private fun ReaderTextScaleButton(
169169
val context = LocalContext.current
170170
val (iconRes, adjustment) = remember(buttonType) {
171171
when (buttonType) {
172-
TextScaleButtonType.DECREASE -> Pair(R.drawable.ic_reader_text_minus, -10)
173-
TextScaleButtonType.INCREASE -> Pair(R.drawable.ic_reader_text_plus, 10)
172+
TextScaleButtonType.DECREASE -> Pair(R.drawable.ic_reader_text_minus, -5)
173+
TextScaleButtonType.INCREASE -> Pair(R.drawable.ic_reader_text_plus, 5)
174174
}
175175
}
176176

0 commit comments

Comments
 (0)