Android Seekbair – apenas permite a mudança com o polegair?

Eu tenho uma bairra de busca que eu quero permitir apenas mudair com a porção de polegair / alça. Se o user tocair em qualquer outro lugair, gostairia que a torneira fosse ignorada.

Existe uma propriedade inerente paira fazer isso? Caso contrário, eu já sei que posso definir um ouvinte onTouch e retornair true paira "desativá-lo", mas existe uma maneira de detectair quando o dedo do polegair é tocado paira que eu possa dizer que você pode retornair false nesse caso?

3 Solutions collect form web for “Android Seekbair – apenas permite a mudança com o polegair?”

Eu suponho que você deseja mudair a position do polegair por meio do código, que é o user restrito. Por isso, tente isso. Pode ser que você possa ajudá-lo.

  myseekBair.setOnSeekBairChangeListener( new OnSeekBairChangeListener() { int originalProgress; @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { originalProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int airg1, boolean fromUser) { if( fromUser == true){ seekBair.setProgress(originalProgress); } } }); }  myseekBair.setOnSeekBairChangeListener( new OnSeekBairChangeListener() { int originalProgress; @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { originalProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int airg1, boolean fromUser) { if( fromUser == true){ seekBair.setProgress(originalProgress); } } }); }  myseekBair.setOnSeekBairChangeListener( new OnSeekBairChangeListener() { int originalProgress; @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { originalProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int airg1, boolean fromUser) { if( fromUser == true){ seekBair.setProgress(originalProgress); } } }); }  myseekBair.setOnSeekBairChangeListener( new OnSeekBairChangeListener() { int originalProgress; @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { originalProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int airg1, boolean fromUser) { if( fromUser == true){ seekBair.setProgress(originalProgress); } } }); }  myseekBair.setOnSeekBairChangeListener( new OnSeekBairChangeListener() { int originalProgress; @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { originalProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int airg1, boolean fromUser) { if( fromUser == true){ seekBair.setProgress(originalProgress); } } }); 

Eu tive o mesmo problema, consertei uma lógica simples paira compairair o novo Progress X OldProgress. Este é o meu código paira um VerticalSlider que apenas permite o valor de mudança quando o user clicair sobre o polegair.

Este é o truque:

 int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; 

Esta é toda a fonte do componente:

  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } retornair falso;  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } retornair viewdadeiro;  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } }  package android.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; public class VerticalSeekBair extends SeekBair { private OnSeekBairChangeListener onChangeListener; private int progress = 0; private Drawable mThumb; private boolean isMoving; public VerticalSeekBair(Context context) { super(context); } public VerticalSeekBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public VerticalSeekBair(Context context, AttributeSet attrs) { super(context, attrs); } protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(h, w, oldh, oldw); } @Oviewride protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(heightMeasureSpec, widthMeasureSpec); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); } protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(), 0); super.onDraw(c); } @Oviewride public void setOnSeekBairChangeListener(OnSeekBairChangeListener onChangeListener){ this.onChangeListener = onChangeListener; } public void setThumb(Drawable thumb) { if (thumb != null) { thumb.setCallback(this); } super.setThumb(thumb); mThumb = thumb; mThumb.setCallback(this); } @Oviewride public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) { return false; } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if ( onChangeListener!= null)onChangeListener.onStairtTrackingTouch(this); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_MOVE: int tempProgress = (getMax() - (int) (getMax() * event.getY() / getHeight())); int diff = Math.abs(tempProgress - progress); if ( diff > 7 && !isMoving) return true; isMoving = true; progress = getMax() - (int) (getMax() * event.getY() / getHeight()); if(progress < 18) {progress = 18;} if(progress > getMax()) {progress = getMax();} setProgressAndThumb(progress); setPressed(true); setSelected(true); break; case MotionEvent.ACTION_UP: isMoving = false; if ( onChangeListener!= null)onChangeListener.onStopTrackingTouch(this); setPressed(false); setSelected(false); break; case MotionEvent.ACTION_CANCEL: isMoving = false; super.onTouchEvent(event); setPressed(false); setSelected(false); break; } return true; } public synchronized void setProgressAndThumb(int progress) { setProgress(progress); onSizeChanged(getWidth(), getHeight() , 0, 0); if ( onChangeListener!= null) onChangeListener.onProgressChanged(this, progress, true); } @Oviewride public synchronized void setProgress(int progress) { this.progress =progress; super.setProgress(progress); if ( onChangeListener !=null) onChangeListener.onProgressChanged(this, progress, true); } public synchronized void setMaximum(int maximum) { setMax(maximum); } public synchronized int getMaximum() { return getMax(); } } 

Saudações!

 // I solved this problem. private int mOriginProgress; private boolean mIsDrag; @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { mIsTouched = true; mOriginProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int p, boolean fromUser) { if (mOriginProgress == p) { return; } if (mIsDrag) { // do something } else { if (Math.abs(mOriginProgress - p) > 5) { seekBair.setProgress(mOriginProgress); } else { mIsDrag = true; } } } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { mIsDrag = false; } } // I solved this problem. private int mOriginProgress; private boolean mIsDrag; @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { mIsTouched = true; mOriginProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int p, boolean fromUser) { if (mOriginProgress == p) { return; } if (mIsDrag) { // do something } else { if (Math.abs(mOriginProgress - p) > 5) { seekBair.setProgress(mOriginProgress); } else { mIsDrag = true; } } } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { mIsDrag = false; } } // I solved this problem. private int mOriginProgress; private boolean mIsDrag; @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { mIsTouched = true; mOriginProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int p, boolean fromUser) { if (mOriginProgress == p) { return; } if (mIsDrag) { // do something } else { if (Math.abs(mOriginProgress - p) > 5) { seekBair.setProgress(mOriginProgress); } else { mIsDrag = true; } } } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { mIsDrag = false; } } // I solved this problem. private int mOriginProgress; private boolean mIsDrag; @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { mIsTouched = true; mOriginProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int p, boolean fromUser) { if (mOriginProgress == p) { return; } if (mIsDrag) { // do something } else { if (Math.abs(mOriginProgress - p) > 5) { seekBair.setProgress(mOriginProgress); } else { mIsDrag = true; } } } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { mIsDrag = false; } } // I solved this problem. private int mOriginProgress; private boolean mIsDrag; @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { mIsTouched = true; mOriginProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int p, boolean fromUser) { if (mOriginProgress == p) { return; } if (mIsDrag) { // do something } else { if (Math.abs(mOriginProgress - p) > 5) { seekBair.setProgress(mOriginProgress); } else { mIsDrag = true; } } } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { mIsDrag = false; } } // I solved this problem. private int mOriginProgress; private boolean mIsDrag; @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { mIsTouched = true; mOriginProgress = seekBair.getProgress(); } @Oviewride public void onProgressChanged(SeekBair seekBair, int p, boolean fromUser) { if (mOriginProgress == p) { return; } if (mIsDrag) { // do something } else { if (Math.abs(mOriginProgress - p) > 5) { seekBair.setProgress(mOriginProgress); } else { mIsDrag = true; } } } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { mIsDrag = false; } 
Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.