I want to create a seekbar which will change it's progress only when user drag it, It should not change progress when user touch on it.
Does any one done like this before any help please
Thank You Sandip Jadhav
I want to create a seekbar which will change it's progress only when user drag it, It should not change progress when user touch on it.
Does any one done like this before any help please
Thank You Sandip Jadhav
I dont know what you really wanted to know.
but use handler every after 1 sec and set your seekprogress inside of it. e.g:
runnable = new Runnable() {
@Override
public void run() {
bar.setProgress(bar.getProgress() + 1);
}
};
public class Slider extends SeekBar {
private Drawable mThumb;
public Slider(Context context) {
super(context);
}
public Slider(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void setThumb(Drawable thumb) {
super.setThumb(thumb);
mThumb = thumb;
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (event.getX() >= mThumb.getBounds().left
&& event.getX() <= mThumb.getBounds().right
&& event.getY() <= mThumb.getBounds().bottom
&& event.getY() >= mThumb.getBounds().top) {
super.onTouchEvent(event);
} else {
return false;
}
} else if (event.getAction() == MotionEvent.ACTION_UP) {
return false;
} else {
super.onTouchEvent(event);
}
return true;
}}
Found answer at below link