RadioButton
Default
Day | Night |
---|---|
Installation
Backpack Android is available through Maven Central. Check the main Readme for a complete installation guide.
Usage
The RadioButton component can be used in both XML and Kotlin/Java
Example of a RadioButton in XML
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkedButton="@+id/radio_button_checked">
<net.skyscanner.backpack.radiobutton.BpkRadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Unchecked" />
<net.skyscanner.backpack.radiobutton.BpkRadioButton
android:id="@+id/radio_button_checked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Checked" />
</RadioGroup>
Example of a RadioButton in Kotlin
import net.skyscanner.backpack.radiobutton.BpkRadioButton
val radioButton = BpkRadioButton(context).apply {
isChecked = true
}
radioGroup.addView(radioButton)
Theme Props
- radioButtonColorChecked
- radioButtonColorDisabled
- radioButtonColor
Styles can be changed globally through bpkRadioButtonStyle. Check theming for more information.