org.robobinding.widget.ratingbar.OnRatingBarChangeAttribute 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
The newest version!
package org.robobinding.widget.ratingbar;
import org.robobinding.attribute.Command;
import org.robobinding.viewattribute.event.EventViewAttribute;
import org.robobinding.widgetaddon.ratingbar.RatingBarAddOn;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
/**
*
* @since 1.0
* @version $Revision: 1.0 $
* @author Robert Taylor
*/
public class OnRatingBarChangeAttribute implements EventViewAttribute {
@Override
public void bind(RatingBarAddOn viewAddOn, final Command command, RatingBar view) {
viewAddOn.addOnRatingBarChangeListener(new OnRatingBarChangeListener() {
@Override
public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
RatingBarChangeEvent ratingBarEvent = new RatingBarChangeEvent(ratingBar, rating, fromUser);
command.invoke(ratingBarEvent);
}
});
}
@Override
public Class getEventType() {
return RatingBarChangeEvent.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy