mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-08-22 07:06:05 +00:00
Merge pull request #791 from permissionlesstech/ui/enable-location-in-nearby
ui: move enable location services into nearby section
This commit is contained in:
commit
10cc96d6e8
@ -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
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user