location sheet

This commit is contained in:
callebtc 2026-07-27 12:57:03 +02:00
parent 7ad709c38e
commit a277b5e753
2 changed files with 12 additions and 5 deletions

View File

@ -67,6 +67,7 @@ import com.bitchat.android.net.TorMode
import com.bitchat.android.net.TorPreferenceManager
import com.bitchat.android.ui.theme.BitchatMotion
import com.bitchat.android.ui.theme.LocalBitchatPalette
import com.bitchat.android.wifiaware.WifiAwareController
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@ -115,6 +116,7 @@ fun LocationChannelsSheet(
val bookmarks by bookmarksStore.bookmarks.collectAsStateWithLifecycle()
val bookmarkNames by bookmarksStore.bookmarkNames.collectAsStateWithLifecycle()
val geohashParticipantCounts by viewModel.geohashParticipantCounts.collectAsStateWithLifecycle()
val wifiAwareEnabled by WifiAwareController.enabled.collectAsStateWithLifecycle()
var customGeohash by remember { mutableStateOf("") }
var customError by remember { mutableStateOf<String?>(null) }
@ -241,8 +243,12 @@ fun LocationChannelsSheet(
ChannelOptionRow(
title = meshTitleWithCount(viewModel),
subtitle = stringResource(
R.string.location_bluetooth_subtitle,
bluetoothRangeString()
if (wifiAwareEnabled) {
R.string.location_bluetooth_wifi_subtitle
} else {
R.string.location_bluetooth_subtitle
},
meshRangeString()
),
isSelected = selectedChannel is ChannelID.Mesh,
participantCount = meshCount(viewModel),
@ -1069,6 +1075,6 @@ private fun formatDistance(value: Double): String {
}
}
private fun bluetoothRangeString(): String = "~1050 m"
private fun meshRangeString(): String = "~1050m"
private fun formattedNamePrefix(level: GeohashChannelLevel): String = "~"

View File

@ -275,7 +275,8 @@
<string name="cd_offline_mesh_chat">Offline Mesh Chat</string>
<string name="cd_online_geohash_channels">Online Geohash Channels</string>
<string name="cd_end_to_end_encryption">End-to-End Encryption</string>
<string name="location_bluetooth_subtitle">#bluetooth • %1$s</string>
<string name="location_bluetooth_subtitle">Bluetooth • %1$s</string>
<string name="location_bluetooth_wifi_subtitle">Bluetooth • Wifi • %1$s</string>
<string name="image_page_of">Image %1$d of %2$d</string>
<string name="image_unavailable">Image unavailable</string>
@ -305,7 +306,7 @@
<string name="location_channels_heading">Location Channels</string>
<string name="location_channels_desc">Chat by coarse location. Never shares exact GPS.</string>
<string name="location_channels_nearby">Nearby</string>
<string name="mesh_section_subtitle">Offline mesh via Bluetooth. No internet required.</string>
<string name="mesh_section_subtitle">Offline mesh. No internet required.</string>
<!-- Location channels sheet: sections and Tor routing -->
<string name="section_nearby">Nearby</string>