From 49d07bfc8601cba2420acd9a7cf224e0d5bf62ff Mon Sep 17 00:00:00 2001 From: Daniel <101683475+Koranir@users.noreply.github.com> Date: Fri, 17 Nov 2023 17:58:22 +1100 Subject: [PATCH 1/2] Update ExhUtils.kt --- .../presentation/reader/appbars/ExhUtils.kt | 62 ++++++++++++------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt b/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt index be831adb007b..82990bde89f4 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -35,6 +36,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import eu.kanade.presentation.theme.TachiyomiTheme @@ -61,42 +63,60 @@ fun ExhUtils( Column( modifier .fillMaxWidth() - .background(backgroundColor) + .background(backgroundColor), + horizontalAlignment = Alignment.CenterHorizontally ) { AnimatedVisibility(visible = isVisible) { Column { Row( - Modifier.fillMaxWidth().height(IntrinsicSize.Min), + Modifier + .fillMaxWidth(0.9f) + .height(IntrinsicSize.Min), verticalAlignment = Alignment.CenterVertically, ) { Row( Modifier .fillMaxWidth(0.5f) .fillMaxHeight() + .padding(5.dp) .clickable(enabled = isAutoScrollEnabled) { onToggleAutoscroll(!isAutoScroll) }, horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { - Text( - text = stringResource(R.string.eh_autoscroll), - color = MaterialTheme.colorScheme.onSurface, - fontSize = 13.sp, - fontFamily = FontFamily.SansSerif, - style = MaterialTheme.typography.labelLarge, - modifier = Modifier.padding(start = 24.dp) - ) - Switch( - checked = isAutoScroll, - onCheckedChange = null, - enabled = isAutoScrollEnabled - ) + Column( + Modifier.weight(3f), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Text( + text = stringResource(R.string.eh_autoscroll), + color = MaterialTheme.colorScheme.onSurface, + fontSize = 13.sp, + fontFamily = FontFamily.SansSerif, + style = MaterialTheme.typography.labelLarge, + modifier = Modifier.fillMaxWidth(0.75f), + textAlign = TextAlign.Center + ) + } + Column( + Modifier.weight(1f), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Switch( + checked = isAutoScroll, + onCheckedChange = null, + enabled = isAutoScrollEnabled + ) + } } Row( - Modifier.fillMaxWidth(), + Modifier.fillMaxWidth(0.9f).padding(5.dp), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { - Column(Modifier.weight(3f)) { + Column( + Modifier.weight(3f), + horizontalAlignment = Alignment.CenterHorizontally + ) { var autoScrollFrequencyState by remember { mutableStateOf(autoScrollFrequency) } @@ -114,7 +134,7 @@ fun ExhUtils( focusedTextColor = MaterialTheme.colorScheme.onSurface, unfocusedTextColor = MaterialTheme.colorScheme.onSurface ), - modifier = Modifier.fillMaxWidth(), + modifier = Modifier.fillMaxWidth(0.75f), keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Decimal ), @@ -141,11 +161,11 @@ fun ExhUtils( } } Row( - Modifier.fillMaxWidth(), + Modifier.fillMaxWidth(0.9f), verticalAlignment = Alignment.CenterVertically, ) { Row( - Modifier.fillMaxWidth(0.5f), + Modifier.fillMaxWidth(0.5f).padding(5.dp), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { @@ -173,7 +193,7 @@ fun ExhUtils( } } Row( - Modifier.fillMaxWidth(), + Modifier.fillMaxWidth(0.9f).padding(5.dp), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { From f40134c780d0ca81734c8bf625dc9b20ab33c20c Mon Sep 17 00:00:00 2001 From: Daniel <101683475+Koranir@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:06:55 +1100 Subject: [PATCH 2/2] Remove import --- .../main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt b/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt index 763fda39d4ee..ed99b28d92a6 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/appbars/ExhUtils.kt @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height