mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-16 19:26:12 -04:00
refactor(device-settings): Group Reactions items with dividers
Three dividers separate the logical clusters inside the Reactions section: ear-detection behaviors, AAP auto-behaviors (when connected), connection settings, and pop-up notifications. AAP divider only renders when at least one AAP item is shown.
This commit is contained in:
@@ -352,9 +352,12 @@ fun DeviceSettingsScreen(
|
|||||||
text = stringResource(R.string.settings_eardetection_info_description),
|
text = stringResource(R.string.settings_eardetection_info_description),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
ReactionsDivider()
|
||||||
}
|
}
|
||||||
if (device.isAapConnected) {
|
if (device.isAapConnected) {
|
||||||
val convAwareness = device.conversationalAwareness
|
val convAwareness = device.conversationalAwareness
|
||||||
|
val hasAnyAapReaction =
|
||||||
|
(features.hasConversationAwareness && convAwareness != null) || features.hasSleepDetection
|
||||||
if (features.hasConversationAwareness && convAwareness != null) {
|
if (features.hasConversationAwareness && convAwareness != null) {
|
||||||
SettingsSwitchItem(
|
SettingsSwitchItem(
|
||||||
icon = Icons.TwoTone.Hearing,
|
icon = Icons.TwoTone.Hearing,
|
||||||
@@ -378,6 +381,9 @@ fun DeviceSettingsScreen(
|
|||||||
requiresUpgrade = !isPro,
|
requiresUpgrade = !isPro,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (hasAnyAapReaction) {
|
||||||
|
ReactionsDivider()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SettingsSwitchItem(
|
SettingsSwitchItem(
|
||||||
icon = Icons.TwoTone.BluetoothConnected,
|
icon = Icons.TwoTone.BluetoothConnected,
|
||||||
@@ -393,6 +399,7 @@ fun DeviceSettingsScreen(
|
|||||||
onClick = { if (reactions.autoConnect) showAutoConnectConditionDialog = true },
|
onClick = { if (reactions.autoConnect) showAutoConnectConditionDialog = true },
|
||||||
enabled = reactions.autoConnect,
|
enabled = reactions.autoConnect,
|
||||||
)
|
)
|
||||||
|
ReactionsDivider()
|
||||||
if (features.hasCase) {
|
if (features.hasCase) {
|
||||||
SettingsSwitchItem(
|
SettingsSwitchItem(
|
||||||
icon = Icons.AutoMirrored.TwoTone.Message,
|
icon = Icons.AutoMirrored.TwoTone.Message,
|
||||||
@@ -681,6 +688,14 @@ fun DeviceSettingsScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun ReactionsDivider() {
|
||||||
|
HorizontalDivider(
|
||||||
|
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp),
|
||||||
|
color = MaterialTheme.colorScheme.outlineVariant,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ToneVolumeSlider(
|
private fun ToneVolumeSlider(
|
||||||
level: Int,
|
level: Int,
|
||||||
|
|||||||
Reference in New Issue
Block a user