Is there a way of only changing the left drawable in kotlin using code? In my case I have a speedmode selector from 1 to 8 and when a car(s) is selected you then press a speedmode and the icon changes in the button of the car. I have this but it removes the right drawable.
for (speedModeSelecter in speedList)
{
speedModeSelecter.setOnClickListener{
for(kartBox in kartList)
{
if(kartBox.isChecked) {
kartBox.setCompoundDrawablesWithIntrinsicBounds(R.mipmap.ic_speedmode1, 0 ,0 ,0)
}
}
}
}