Closed RoqueCampos closed 9 years ago
switch.setOnCheckedChangedListener (new MaterialAnimatedSwitch.OnCheckedChangeListener() { @Override public void onCheckedChanged(boolean b) { if (b) { // switch is set to right } else { // switch is set to left }}});
Yes, I know that way, but what if you have a lot of checkboxes? One listener per checkbox? Thats look not very optimized.
What I want is to register the interface in my activity, and when the event is triggered, I prefer to look the state of all of the checkboxes using reflection... but no method is available to read the status of the checkbox.
Hi, the new version of the library have a isChecked() method like @RoqueCampos says
Hi! Your material design switch is cool!
But, how to read the state of the switch? I know that I receive the boolean flag in my onchangestatelistener but not the id of the view that did launched the event. Because of that I try to determine the state of each view, but I don't find the method to read the state.
Como creo que eres español, te lo comento en español ya que mi ingles no es muy bueno. El componente me parece genial, esta diseñado con mucho gusto, pero no encuentro como leer el estado del switch. ¿Hay algun metodo tipo isChecked o algo asi?
Un saludo y gracias.