Skip to content

Commit

Permalink
Small tweaks to settings screen UI
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Oct 19, 2023
1 parent b5fa94e commit 803bb57
Showing 1 changed file with 52 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ internal fun SettingsScreen(
}

if (canBlurImage) {
item { InsetDivider() }

item {
FeaturedItemBlurSettingItem(
featuredItemBlurEnabled = state.enableHomePageBlur,
Expand Down Expand Up @@ -245,67 +247,63 @@ private fun BrowserTypeSettingItem(
) {
var checked by remember(browserType) { mutableStateOf(browserType == BrowserType.InApp) }

Column {
Box(
modifier =
Modifier.clickable {
checked = !checked
val newBrowserType =
if (checked) {
BrowserType.InApp
} else {
BrowserType.Default
}
Box(
modifier =
Modifier.clickable {
checked = !checked
val newBrowserType =
if (checked) {
BrowserType.InApp
} else {
BrowserType.Default
}

onBrowserTypeChanged(newBrowserType)
}
onBrowserTypeChanged(newBrowserType)
}
) {
Row(
modifier = Modifier.padding(start = 24.dp, top = 16.dp, end = 24.dp, bottom = 20.dp),
verticalAlignment = Alignment.CenterVertically
) {
Row(
modifier = Modifier.padding(start = 24.dp, top = 16.dp, end = 24.dp, bottom = 20.dp),
verticalAlignment = Alignment.CenterVertically
) {
Column(modifier = Modifier.weight(1f)) {
Text(
LocalStrings.current.settingsBrowserTypeTitle,
style = MaterialTheme.typography.titleMedium,
color = AppTheme.colorScheme.textEmphasisHigh
)
Text(
LocalStrings.current.settingsBrowserTypeSubtitle,
style = MaterialTheme.typography.labelLarge,
color = AppTheme.colorScheme.textEmphasisMed
)
}

Spacer(Modifier.width(16.dp))
Column(modifier = Modifier.weight(1f)) {
Text(
LocalStrings.current.settingsBrowserTypeTitle,
style = MaterialTheme.typography.titleMedium,
color = AppTheme.colorScheme.textEmphasisHigh
)
Text(
LocalStrings.current.settingsBrowserTypeSubtitle,
style = MaterialTheme.typography.labelLarge,
color = AppTheme.colorScheme.textEmphasisMed
)
}

MaterialTheme(
colorScheme =
darkColorScheme(
primary = AppTheme.colorScheme.tintedSurface,
onPrimary = AppTheme.colorScheme.tintedForeground,
outline = AppTheme.colorScheme.outline,
surfaceVariant = AppTheme.colorScheme.surfaceContainer
)
) {
Switch(
checked = checked,
onCheckedChange = { checked ->
val newBrowserType =
if (checked) {
BrowserType.InApp
} else {
BrowserType.Default
}
Spacer(Modifier.width(16.dp))

onBrowserTypeChanged(newBrowserType)
},
MaterialTheme(
colorScheme =
darkColorScheme(
primary = AppTheme.colorScheme.tintedSurface,
onPrimary = AppTheme.colorScheme.tintedForeground,
outline = AppTheme.colorScheme.outline,
surfaceVariant = AppTheme.colorScheme.surfaceContainer
)
}
) {
Switch(
checked = checked,
onCheckedChange = { checked ->
val newBrowserType =
if (checked) {
BrowserType.InApp
} else {
BrowserType.Default
}

onBrowserTypeChanged(newBrowserType)
},
)
}
}

InsetDivider()
}
}

Expand Down

0 comments on commit 803bb57

Please sign in to comment.