mirror of
https://github.com/bitwarden/android.git
synced 2026-04-29 20:38:41 -05:00
PM-24786: Move radio button to UI module (#5708)
This commit is contained in:
@@ -15,9 +15,9 @@ import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.semantics.selected
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.bitwarden.ui.platform.components.radio.BitwardenRadioButton
|
||||
import com.bitwarden.ui.platform.theme.BitwardenTheme
|
||||
import com.bitwarden.ui.util.Text
|
||||
import com.x8bit.bitwarden.ui.platform.components.radio.BitwardenRadioButton
|
||||
|
||||
/**
|
||||
* A clickable item that displays a radio button and text.
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.x8bit.bitwarden.ui.platform.components.radio
|
||||
|
||||
import androidx.compose.material3.RadioButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.x8bit.bitwarden.ui.platform.components.radio.color.bitwardenRadioButtonColors
|
||||
|
||||
/**
|
||||
* A custom Bitwarden-themed radio button.
|
||||
*
|
||||
* @param isSelected Whether this radio button is selected or not.
|
||||
* @param onClick The lambda to be invoked when the item is clicked.
|
||||
* @param modifier The [Modifier] to be applied to this radio button.
|
||||
*/
|
||||
@Composable
|
||||
fun BitwardenRadioButton(
|
||||
isSelected: Boolean,
|
||||
onClick: (() -> Unit)?,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
RadioButton(
|
||||
modifier = modifier,
|
||||
selected = isSelected,
|
||||
onClick = onClick,
|
||||
colors = bitwardenRadioButtonColors(),
|
||||
)
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.x8bit.bitwarden.ui.platform.components.radio.color
|
||||
|
||||
import androidx.compose.material3.RadioButtonColors
|
||||
import androidx.compose.runtime.Composable
|
||||
import com.bitwarden.ui.platform.theme.BitwardenTheme
|
||||
|
||||
/**
|
||||
* Provides a default set of Bitwarden-styled colors for radio buttons.
|
||||
*/
|
||||
@Composable
|
||||
fun bitwardenRadioButtonColors(): RadioButtonColors = RadioButtonColors(
|
||||
selectedColor = BitwardenTheme.colorScheme.filledButton.background,
|
||||
unselectedColor = BitwardenTheme.colorScheme.icon.primary,
|
||||
disabledSelectedColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
|
||||
disabledUnselectedColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
|
||||
)
|
||||
@@ -51,6 +51,7 @@ import com.bitwarden.ui.platform.components.content.BitwardenErrorContent
|
||||
import com.bitwarden.ui.platform.components.content.BitwardenLoadingContent
|
||||
import com.bitwarden.ui.platform.components.field.BitwardenTextField
|
||||
import com.bitwarden.ui.platform.components.model.CardStyle
|
||||
import com.bitwarden.ui.platform.components.radio.BitwardenRadioButton
|
||||
import com.bitwarden.ui.platform.components.snackbar.BitwardenSnackbarHost
|
||||
import com.bitwarden.ui.platform.components.snackbar.rememberBitwardenSnackbarHostState
|
||||
import com.bitwarden.ui.platform.components.util.rememberVectorPainter
|
||||
@@ -68,7 +69,6 @@ import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenMasterPassword
|
||||
import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenOverwritePasskeyConfirmationDialog
|
||||
import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenPinDialog
|
||||
import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenTwoButtonDialog
|
||||
import com.x8bit.bitwarden.ui.platform.components.radio.BitwardenRadioButton
|
||||
import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold
|
||||
import com.x8bit.bitwarden.ui.platform.components.text.BitwardenClickableText
|
||||
import com.x8bit.bitwarden.ui.platform.composition.LocalBiometricsManager
|
||||
|
||||
Reference in New Issue
Block a user