All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robobinding.widget.radiogroup.OnCheckedChangeAttribute Maven / Gradle / Ivy

There is a newer version: 0.8.14
Show newest version
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