I currently have a two checkboxes, where when one is clicked, the other automatically unchecks. I would like to keep that however have the unchecked one become a faded white color, yet still be clickable and readable if the user decides to change his/her mind.
This is the current code I have:
chk1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (CheckBox.isChecked(chk1)) {
chk2.setChecked(false);
chk1.setChecked(b);
chk2.setAlpha(0.5f);
}
});
chk2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (CheckBox.isChecked(chk2)) {
chk1.setChecked(false);
chk2.setChecked(b);
chk1.setAlpha(0.5f);
}
});