mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2026-01-15 20:54:27 +01:00
Added CS feature not enabled.
This commit is contained in:
@@ -68,11 +68,40 @@ internal fun ChannelSoundingScreen(isNotificationPermissionGranted: Boolean?) {
|
||||
{ channelSoundingViewModel.onEvent(it) }
|
||||
ChannelSoundingView(channelSoundingState, onClickEvent)
|
||||
}
|
||||
} else if (Build.VERSION.SDK_INT_FULL == Build.VERSION_CODES_FULL.BAKLAVA && isNotificationPermissionGranted != null) {
|
||||
// It supports the Channel Sounding but we are intentionally not enabling it because of the accuracy and performance issues.
|
||||
ChannelSoundingNotEnabledView()
|
||||
} else {
|
||||
ChannelSoundingNotSupportedView()
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun ChannelSoundingNotEnabledView() {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
ScreenSection(modifier = Modifier.padding(0.dp) /* No padding */) {
|
||||
Column(modifier = Modifier.padding(top = 16.dp, start = 16.dp, end = 16.dp)) {
|
||||
SectionTitle(
|
||||
icon = Icons.Default.SocialDistance,
|
||||
title = stringResource(R.string.channel_sounding),
|
||||
)
|
||||
}
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(16.dp)
|
||||
.fillMaxWidth(),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(stringResource(R.string.channel_sounding_not_enabled))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun ChannelSoundingNotSupportedView() {
|
||||
@@ -81,14 +110,18 @@ private fun ChannelSoundingNotSupportedView() {
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
ScreenSection(modifier = Modifier.padding(0.dp) /* No padding */) {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier.padding(16.dp),
|
||||
) {
|
||||
Column(modifier = Modifier.padding(top = 16.dp, start = 16.dp, end = 16.dp)) {
|
||||
SectionTitle(
|
||||
icon = Icons.Default.SocialDistance,
|
||||
title = stringResource(R.string.channel_sounding),
|
||||
)
|
||||
}
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(16.dp)
|
||||
.fillMaxWidth(),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(stringResource(R.string.channel_sounding_not_supported))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<string name="channel_sounding">Channel Sounding</string>
|
||||
|
||||
<string name="channel_sounding_not_supported">Channel Sounding is not supported on this Android version.</string>
|
||||
<string name="channel_sounding_not_enabled">Channel Sounding is supported on this device, but it is currently disabled due to potential accuracy and performance issues. For the best experience, we recommend using a device running Android 16 (API 36, minor version 1) or later.</string>
|
||||
<string name="initiating_ranging">Initiating ranging</string>
|
||||
<string name="ranging_session_restarting">Reconnecting session</string>
|
||||
<string name="ranging_session_stopped">Ranging session stopped</string>
|
||||
|
||||
Reference in New Issue
Block a user