Reuse the chat portable radio icon in Android settings
This commit is contained in:
1 parent
bd453311ac
commit
d4a2dac903
1 file changed
+6
-2
@@ -36,6 +36,7 @@ import androidx.compose.ui.unit.dp
|
||||
import com.utun.chat.ChatApplication
|
||||
import com.utun.chat.data.NativeLib
|
||||
import com.utun.chat.ui.components.ProfileAvatarControls
|
||||
import com.utun.chat.ui.components.PortableRadioIcon
|
||||
import com.utun.chat.data.NotificationSound
|
||||
import com.utun.chat.data.IncomingCallManager
|
||||
import com.utun.chat.data.RadioOverlayService
|
||||
@@ -112,7 +113,7 @@ fun SettingsScreen(vm: ChatViewModel, onBack: () -> Unit, onExit: () -> Unit = {
|
||||
|
||||
var tabIndex by rememberSaveable { mutableStateOf(0) }
|
||||
val tabs = listOf(R.string.settings to Icons.Default.Settings, R.string.audio to Icons.Default.VolumeUp,
|
||||
R.string.storage to Icons.Default.Storage, R.string.radio to Icons.Default.Radio,
|
||||
R.string.storage to Icons.Default.Storage, R.string.radio to null,
|
||||
R.string.broadcast to Icons.Default.LiveTv, R.string.dev to Icons.Default.Code, R.string.bluetooth to Icons.Default.Bluetooth)
|
||||
|
||||
val handleBack: () -> Unit = back@{
|
||||
@@ -171,7 +172,10 @@ fun SettingsScreen(vm: ChatViewModel, onBack: () -> Unit, onExit: () -> Unit = {
|
||||
Tab(selected = tabIndex == idx, onClick = {
|
||||
LogManager.addLog("DEBUG", "Settings", "Section selected index=$idx")
|
||||
tabIndex = idx
|
||||
}, icon = { Icon(image, contentDescription = title, modifier = Modifier.size(24.dp)) })
|
||||
}, icon = {
|
||||
if (image == null) PortableRadioIcon(title)
|
||||
else Icon(image, contentDescription = title, modifier = Modifier.size(24.dp))
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user