I use some Toggle buttons, I was missing a getter to set the listeners:
/**
* Gets the current view as a compound button.
*
* @return Button
*/
public CompoundButton getCompoundButton(){
return (CompoundButton) view;
}
Additionally, instead of limiting checked() to CompoundButton subclasses, you
could allow it to affect all Checkable implementations:
/**
* Set checked state of a compound button.
*
* @param checked state
* @return self
*/
public T checked(boolean checked){
if(view instanceof android.widget.Checkable){
android.widget.Checkable cb = (android.widget.Checkable) view;
cb.setChecked(checked);
}
return self();
}
/**
* Get checked state of a compound button.
*
* @return checked
*/
public boolean isChecked(){
boolean checked = false;
if(view instanceof android.widget.Checkable){
android.widget.Checkable cb = (android.widget.Checkable) view;
checked = cb.isChecked();
}
return checked;
}
Original issue reported on code.google.com by marvinl...@gmail.com on 12 Jan 2013 at 4:01
Original issue reported on code.google.com by
marvinl...@gmail.com
on 12 Jan 2013 at 4:01