Skip to content

Switches are here! And they are super cool!

Compare
Choose a tag to compare
@Stjin Stjin released this 02 Feb 10:42

Switches are here! And they are super cool!

use app:showSwitch="true" to show a Materialswitch when a card is collapsed.
You can listen to the state of the switch with

card.setOnSwitchChangeListener { view, isChecked ->
    Toast.makeText(applicationContext, if(isChecked) "Checked!" else "Not checked!", Toast.LENGTH_SHORT).show()
 }

Added more styling for titles

app:expandableCardTitleColor="@color/colorAccent"
app:expandableCardTitleBold="true"
app:expandableCardTitleSize="30"