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

org.robobinding.widget.seekbar.OnSeekBarChangeAttribute Maven / Gradle / Ivy

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