mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 04:01:49 +01:00
parent
69223df27c
commit
4146c4c31d
@ -4,11 +4,14 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import eu.kanade.presentation.theme.TachiyomiTheme
|
||||||
|
import tachiyomi.presentation.core.util.ThemePreviews
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PageIndicatorText(
|
fun PageIndicatorText(
|
||||||
@ -19,24 +22,35 @@ fun PageIndicatorText(
|
|||||||
|
|
||||||
val text = "$currentPage / $totalPages"
|
val text = "$currentPage / $totalPages"
|
||||||
|
|
||||||
Box {
|
val style = TextStyle(
|
||||||
Text(
|
color = Color(235, 235, 235),
|
||||||
text = text,
|
fontSize = MaterialTheme.typography.bodySmall.fontSize,
|
||||||
color = Color(45, 45, 45),
|
fontWeight = FontWeight.Bold,
|
||||||
fontSize = MaterialTheme.typography.bodySmall.fontSize,
|
letterSpacing = 1.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
)
|
||||||
letterSpacing = 1.sp,
|
val strokeStyle = style.copy(
|
||||||
style = TextStyle.Default.copy(
|
color = Color(45, 45, 45),
|
||||||
drawStyle = Stroke(width = 4f),
|
drawStyle = Stroke(width = 4f),
|
||||||
),
|
)
|
||||||
)
|
|
||||||
|
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = text,
|
text = text,
|
||||||
color = Color(235, 235, 235),
|
style = strokeStyle,
|
||||||
fontSize = MaterialTheme.typography.bodySmall.fontSize,
|
)
|
||||||
fontWeight = FontWeight.Bold,
|
Text(
|
||||||
letterSpacing = 1.sp,
|
text = text,
|
||||||
|
style = style,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ThemePreviews
|
||||||
|
@Composable
|
||||||
|
private fun PageIndicatorTextPreview() {
|
||||||
|
TachiyomiTheme {
|
||||||
|
PageIndicatorText(currentPage = 10, totalPages = 69)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user