title: Using a custom Vertical SeekBar, thumb highlight does not rotate with the bar
body: <p>I am using a custom Vertical Seekbar and everything works great, except for the Thumb highlight.</p>
  
  <p><a href="https://i.stack.imgur.com/Yig1B.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yig1B.jpg" alt="enter image description here"></a></p>
  
  <p>As I scroll the left seekbar up and down, the thumb highlight continues to scroll left to right at the top of the screen as if the seekbar is still horizontal. My custom vertical seekbar is as follows:</p>
  
  <pre><code>public class VerticalSeekBar extends SeekBar {
  
  protected OnSeekBarChangeListener changeListener;
  
  public VerticalSeekBar(Context context) {
      super(context);
  }
  
  public VerticalSeekBar(Context context, AttributeSet attrs, int defStyle) {
      super(context, attrs, defStyle);
  }
  
  public VerticalSeekBar(Context context, AttributeSet attrs) {
      super(context, attrs);
  }
  
  protected void onSizeChanged(int w, int h, int oldw, int oldh) {
      super.onSizeChanged(h, w, oldh, oldw);
  }
  
  @Override
  protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
      super.onMeasure(heightMeasureSpec, widthMeasureSpec);
      setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
  }
  
  @Override
  public synchronized void setProgress(int progress) {
      super.setProgress(progress);
      onSizeChanged(getWidth(), getHeight(), 0, 0);
  }
  
  @Override public void setOnSeekBarChangeListener(OnSeekBarChangeListener mListener)
  {
      this.changeListener = mListener;
  }
  
  protected void onDraw(Canvas c) {
      c.rotate(-90);
      c.translate(-getHeight(),0);
  
      super.onDraw(c);
  }
  
  @Override
  public boolean onTouchEvent(MotionEvent event) {
      if (!isEnabled()) {
          return false;
      }
  
      switch (event.getAction()) {
          case MotionEvent.ACTION_DOWN:
              setProgress(getMax() - (int) (getMax() * event.getY() / getHeight()));
              if (changeListener != null)
                  changeListener.onStartTrackingTouch(this);
              setSelected(true);
              setPressed(true);
              break;
          case MotionEvent.ACTION_UP:
              if (changeListener != null)
                  changeListener.onStopTrackingTouch(this);
              setSelected(false);
              setPressed(false);
              break;
          case MotionEvent.ACTION_MOVE:
              int i=getMax() - (int) (getMax() * event.getY() / getHeight());
              setProgress(i);
              onSizeChanged(getWidth(), getHeight(), 0, 0);
              if (changeListener != null)
                  changeListener.onProgressChanged(this, i, true);
              setPressed(true);
              setSelected(true);
              break;
          case MotionEvent.ACTION_CANCEL:
              break;
      }
      return true;
  }
  
  }
  </code></pre>
  
  <p>I can eliminate the highlight entirely by removing</p>
  
  <pre><code>setSelected(true);
  setPressed(true);
  </code></pre>
  
  <p>But ideally I want to keep the standard design pattern and have the highlight follow where the thumb is. Is there anyway to access the location and position of the highlight so I can rotate that as well?</p>