ui: move enable location services into nearby section

Keep disable at the sheet footer so enabling is next to nearby channels while turning location off stays a secondary action.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
callebtc 2026-07-27 21:18:49 +02:00
parent 0f312a13f0
commit 7a26fccff7

View File

@ -399,6 +399,18 @@ fun LocationChannelsSheet(
AboutSectionLabel(
text = stringResource(R.string.location_channels_nearby)
)
if (!appLocationEnabled) {
SheetDestructiveButton(
text = stringResource(R.string.enable_location_services),
isDestructive = false,
onClick = { locationManager.enableLocationServices() },
modifier = Modifier.padding(
start = AboutHorizontalPadding,
end = AboutHorizontalPadding,
bottom = 10.dp
)
)
}
Surface(
modifier = Modifier
.fillMaxWidth()
@ -561,27 +573,19 @@ fun LocationChannelsSheet(
}
}
item(key = "location_toggle") {
SheetDestructiveButton(
text = if (appLocationEnabled) {
stringResource(R.string.disable_location_services)
} else {
stringResource(R.string.enable_location_services)
},
isDestructive = appLocationEnabled,
onClick = {
if (appLocationEnabled) {
locationManager.disableLocationServices()
} else {
locationManager.enableLocationServices()
}
},
modifier = Modifier.padding(
start = AboutHorizontalPadding,
end = AboutHorizontalPadding,
top = 24.dp
if (appLocationEnabled) {
item(key = "location_toggle") {
SheetDestructiveButton(
text = stringResource(R.string.disable_location_services),
isDestructive = true,
onClick = { locationManager.disableLocationServices() },
modifier = Modifier.padding(
start = AboutHorizontalPadding,
end = AboutHorizontalPadding,
top = 24.dp
)
)
)
}
}
}