Switch
Default
Day | Night |
---|---|
Installation
Backpack Android is available through Maven Central. Check the main Readme for a complete installation guide.
Usage
The Switch component can be used in both XML and Kotlin/Java
Example of a switch in XML
<net.skyscanner.backpack.toggle.BpkSwitch
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true" />
Example of a switch in Kotlin
import net.skyscanner.backpack.toggle.BpkSwitch
BpkSwitch(context).apply {
isChecked = true
}
Theme Props
- switchPrimaryColor
Styles can be changed globally through bpkSwitchStyle. Check theming for more information.