I would like to get the color of my Chip but this way I can't because what I get is ColorStateList.
colors.children.forEach {
val chip = it as Chip
chip.setOnCheckedChangeListener { buttonView, isChecked ->
handleSelection(chip)
}
}
//...
private fun handleSelection(chip : Chip) {
val intColor = chip.chipBackgroundColor?.defaultColor
val hexColor = "#" + Integer.toHexString(intColor!!).substring(2)
Log.d("BottomSheetFragment", hexColor)
}
How can I get the current color of my chip ?