parent
25f94e4500
commit
4c71e46ecc
@ -35,6 +35,7 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.text.font.FontFamily
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.tooling.preview.PreviewLightDark
|
import androidx.compose.ui.tooling.preview.PreviewLightDark
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
@ -62,12 +63,13 @@ fun ExhUtils(
|
|||||||
modifier
|
modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(backgroundColor),
|
.background(backgroundColor),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
AnimatedVisibility(visible = isVisible) {
|
AnimatedVisibility(visible = isVisible) {
|
||||||
Column {
|
Column {
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth(0.9f)
|
||||||
.height(IntrinsicSize.Min),
|
.height(IntrinsicSize.Min),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
@ -75,30 +77,45 @@ fun ExhUtils(
|
|||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth(0.5f)
|
.fillMaxWidth(0.5f)
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
|
.padding(5.dp)
|
||||||
.clickable(enabled = isAutoScrollEnabled) { onToggleAutoscroll(!isAutoScroll) },
|
.clickable(enabled = isAutoScrollEnabled) { onToggleAutoscroll(!isAutoScroll) },
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Text(
|
Column(
|
||||||
text = stringResource(SYMR.strings.eh_autoscroll),
|
Modifier.weight(3f),
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
fontSize = 13.sp,
|
) {
|
||||||
fontFamily = FontFamily.SansSerif,
|
Text(
|
||||||
style = MaterialTheme.typography.labelLarge,
|
text = stringResource(SYMR.strings.eh_autoscroll),
|
||||||
modifier = Modifier.padding(start = 24.dp),
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
)
|
fontSize = 13.sp,
|
||||||
Switch(
|
fontFamily = FontFamily.SansSerif,
|
||||||
checked = isAutoScroll,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
onCheckedChange = null,
|
modifier = Modifier.fillMaxWidth(0.75f),
|
||||||
enabled = isAutoScrollEnabled,
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
Column(
|
||||||
|
Modifier.weight(1f),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
Switch(
|
||||||
|
checked = isAutoScroll,
|
||||||
|
onCheckedChange = null,
|
||||||
|
enabled = isAutoScrollEnabled
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
Modifier.fillMaxWidth(),
|
Modifier.fillMaxWidth(0.9f).padding(5.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Column(Modifier.weight(3f)) {
|
Column(
|
||||||
|
Modifier.weight(3f),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
var autoScrollFrequencyState by remember {
|
var autoScrollFrequencyState by remember {
|
||||||
mutableStateOf(autoScrollFrequency)
|
mutableStateOf(autoScrollFrequency)
|
||||||
}
|
}
|
||||||
@ -116,7 +133,7 @@ fun ExhUtils(
|
|||||||
focusedTextColor = MaterialTheme.colorScheme.onSurface,
|
focusedTextColor = MaterialTheme.colorScheme.onSurface,
|
||||||
unfocusedTextColor = MaterialTheme.colorScheme.onSurface,
|
unfocusedTextColor = MaterialTheme.colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(0.75f),
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
keyboardType = KeyboardType.Decimal,
|
keyboardType = KeyboardType.Decimal,
|
||||||
),
|
),
|
||||||
@ -143,11 +160,11 @@ fun ExhUtils(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
Modifier.fillMaxWidth(),
|
Modifier.fillMaxWidth(0.9f),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
Modifier.fillMaxWidth(0.5f),
|
Modifier.fillMaxWidth(0.5f).padding(5.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
@ -175,7 +192,7 @@ fun ExhUtils(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
Modifier.fillMaxWidth(),
|
Modifier.fillMaxWidth(0.9f).padding(5.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user