BrowseSourceToolbar: Match display mode dropdown to stable and change toolbar icon based on display mode (#8200)

* BrowseSourceToolbar: Match display mode dropdown to stable and change toolbar icon based on display mode

* Review changes

* Review changes 2
This commit is contained in:
zbue
2022-10-15 23:16:01 +08:00
committed by GitHub
parent 147455f99c
commit 3d7e44726d
2 changed files with 39 additions and 31 deletions

View File

@@ -2,6 +2,11 @@ package eu.kanade.presentation.components
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.RadioButtonChecked
import androidx.compose.material.icons.outlined.RadioButtonUnchecked
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.DpOffset
@@ -26,3 +31,28 @@ fun DropdownMenu(
content = content,
)
}
@Composable
fun RadioButton(
text: @Composable () -> Unit,
onClick: () -> Unit,
isChecked: Boolean,
) {
DropdownMenuItem(
text = text,
onClick = onClick,
trailingIcon = {
if (isChecked) {
Icon(
imageVector = Icons.Outlined.RadioButtonChecked,
contentDescription = "",
)
} else {
Icon(
imageVector = Icons.Outlined.RadioButtonUnchecked,
contentDescription = "",
)
}
},
)
}