org.robobinding.widget.seekbar.OnSeekBarChangeAttribute 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.seekbar;
import org.robobinding.attribute.Command;
import org.robobinding.viewattribute.event.EventViewAttribute;
import org.robobinding.widgetaddon.seekbar.SeekBarAddOn;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
/**
*
* @since 1.0
* @version $Revision: 1.0 $
* @author Robert Taylor
* @author Cheng Wei
*/
public class OnSeekBarChangeAttribute implements EventViewAttribute {
@Override
public void bind(SeekBarAddOn viewAddOn, final Command command, SeekBar view) {
viewAddOn.addOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
SeekBarChangeEvent seekBarEvent = new SeekBarChangeEvent(seekBar, progress, fromUser);
command.invoke(seekBarEvent);
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
});
}
@Override
public Class getEventType() {
return SeekBarChangeEvent.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy