org.robobinding.widget.radiogroup.OnCheckedChangeAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of robobinding Show documentation
Show all versions of robobinding Show documentation
A Presentation Model(MVVM) framework for the Android platform
package org.robobinding.widget.radiogroup;
import org.robobinding.attribute.Command;
import org.robobinding.viewattribute.event.EventViewAttribute;
import org.robobinding.widgetaddon.radiogroup.RadioGroupAddOn;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
/**
*
* @since 1.0
* @version $Revision: 1.0 $
* @author Cheng Wei
*/
public class OnCheckedChangeAttribute implements EventViewAttribute {
@Override
public void bind(RadioGroupAddOn viewAddOn, final Command command, RadioGroup view) {
viewAddOn.addOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
CheckedChangeEvent event = new CheckedChangeEvent(group, checkedId);
command.invoke(event);
}
});
}
@Override
public Class getEventType() {
return CheckedChangeEvent.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy