Skip to content

Commit ad4e375

Browse files
committed
Add Bluetooth settings shortcut to dashboard toolbar
Adds a two-tone Bluetooth icon to the dashboard toolbar that opens system Bluetooth settings when tapped. The icon is positioned before existing settings/upgrade icons and uses localized content description.
1 parent 3cf0e28 commit ad4e375

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/src/main/java/eu/darken/bluemusic/devices/ui/dashboard/DashboardScreen.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.compose.foundation.lazy.items
1616
import androidx.compose.material.icons.Icons
1717
import androidx.compose.material.icons.filled.BluetoothDisabled
1818
import androidx.compose.material.icons.twotone.Add
19+
import androidx.compose.material.icons.twotone.Bluetooth
1920
import androidx.compose.material.icons.twotone.Lock
2021
import androidx.compose.material.icons.twotone.Settings
2122
import androidx.compose.material.icons.twotone.Stars
@@ -201,6 +202,8 @@ private fun ManagedDevicesTopBar(
201202
onNavigateToSettings: () -> Unit,
202203
onNavigateToUpgrade: () -> Unit
203204
) {
205+
val context = LocalContext.current
206+
204207
TopAppBar(
205208
title = {
206209
if (isProVersion) {
@@ -213,6 +216,15 @@ private fun ManagedDevicesTopBar(
213216
}
214217
},
215218
actions = {
219+
IconButton(onClick = {
220+
val intent = Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS)
221+
context.startActivity(intent)
222+
}) {
223+
Icon(
224+
imageVector = Icons.TwoTone.Bluetooth,
225+
contentDescription = stringResource(R.string.label_bluetooth_settings)
226+
)
227+
}
216228
if (!isProVersion) {
217229
IconButton(onClick = onNavigateToUpgrade) {
218230
Icon(

0 commit comments

Comments
 (0)