1 package com.xtremelabs.robolectric.shadows; 2 3 import android.widget.SeekBar; 4 5 import com.xtremelabs.robolectric.internal.Implementation; 6 import com.xtremelabs.robolectric.internal.Implements; 7 import com.xtremelabs.robolectric.internal.RealObject; 8 9 @Implements(SeekBar.class) 10 public class ShadowSeekBar extends ShadowAbsSeekBar { 11 12 @RealObject 13 private SeekBar realSeekBar; 14 15 private SeekBar.OnSeekBarChangeListener listener; 16 17 @Implementation 18 public void setOnSeekBarChangeListener(SeekBar.OnSeekBarChangeListener listener) { 19 this.listener = listener; 20 } 21 22 @Override 23 @Implementation 24 public void setProgress(int progress) { 25 super.setProgress(progress); 26 if(listener != null) { 27 listener.onProgressChanged( realSeekBar, progress, true); 28 } 29 } 30 31 public SeekBar.OnSeekBarChangeListener getOnSeekBarChangeListener() { 32 return this.listener; 33 } 34 } 35