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

(cherry picked from commit 3d7e44726d)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/browse/components/BrowseSourceToolbar.kt
This commit is contained in:
zbue
2022-10-15 23:16:01 +08:00
committed by Jobobby04
parent 6bcad5b13e
commit 2903e0d98e
2 changed files with 39 additions and 30 deletions
@@ -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 = "",
)
}
},
)
}