From 7a26fccff7e676ec4ff615359f826c2883566395 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Mon, 27 Jul 2026 21:18:49 +0200 Subject: [PATCH] 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 --- .../android/ui/LocationChannelsSheet.kt | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt b/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt index 19156485..505ea5b0 100644 --- a/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt +++ b/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt @@ -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 + ) ) - ) + } } }