Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Update settings and themeing screen layouts #436

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ fun SettingsScreen(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.height(56.dp)
.clickable(
role = Role.Button,
indication = null,
interactionSource = remember { MutableInteractionSource() },
onClick = { onChangeThemeClick() },
)
.padding(vertical = 24.dp)
.semantics(mergeDescendants = true) {},
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalAlignment = Alignment.CenterVertically,
Expand All @@ -113,8 +113,8 @@ fun SettingsScreen(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.height(56.dp)
.semantics(mergeDescendants = true) {},
.semantics(mergeDescendants = true) {}
.padding(vertical = 24.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
Expand Down Expand Up @@ -128,7 +127,7 @@ fun UsualRideScreen(
item {
Text(
text = "Select a color",
style = KrailTheme.typography.titleMedium.copy(fontWeight = FontWeight.Normal),
style = KrailTheme.typography.titleSmall.copy(fontWeight = FontWeight.Normal),
modifier = Modifier
.padding(horizontal = 24.dp)
.padding(bottom = 16.dp),
Expand Down Expand Up @@ -189,17 +188,22 @@ private fun TransportModeRadioButton(
modifier: Modifier = Modifier,
selected: Boolean = false,
) {
val backgroundColor by animateColorAsState(
targetValue = if (selected) transportModeBackgroundColor(mode) else Color.Transparent,
label = "backgroundColor",
animationSpec = tween(durationMillis = 300, easing = LinearEasing),
)

Row(
modifier = modifier
.fillMaxWidth()
.padding(vertical = 1.dp)
.background(color = if (selected) transportModeBackgroundColor(mode) else Color.Transparent)
.padding(vertical = 16.dp, horizontal = 24.dp)
.background(color = backgroundColor)
.clickable(
role = Role.Button,
indication = null,
interactionSource = remember { MutableInteractionSource() },
role = Role.Button,
) { onClick(mode) },
) { onClick(mode) }
.padding(vertical = 24.dp, horizontal = 24.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Box(
Expand All @@ -209,20 +213,11 @@ private fun TransportModeRadioButton(
.background(color = mode.colorCode.hexToComposeColor()),
)

Column(
Text(
text = mode.tagLine,
style = KrailTheme.typography.title.copy(fontWeight = FontWeight.Normal),
modifier = Modifier.padding(start = 16.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
Text(
text = mode.tagLine,
style = KrailTheme.typography.titleMedium,
)

Text(
text = mode.name,
style = KrailTheme.typography.body.copy(fontWeight = FontWeight.Normal),
)
}
)
}
}

Expand Down
Loading