org.robobinding.widget.seekbar.TwoWayProgressAttribute 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.property.ValueModel;
import org.robobinding.viewattribute.property.TwoWayPropertyViewAttribute;
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 TwoWayProgressAttribute implements TwoWayPropertyViewAttribute {
@Override
public void updateView(SeekBar view, Integer progress, SeekBarAddOn viewAddOn) {
view.setProgress(progress);
}
@Override
public void observeChangesOnTheView(SeekBarAddOn viewAddOn, final ValueModel valueModel, SeekBar view) {
viewAddOn.addOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
valueModel.setValue(progress);
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy