Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I get a working vertical SeekBar in Android?
    primarykey
    data
    text
    <p>I've implemented the commonly-pointed-to VerticalSeekBar post <a href="https://stackoverflow.com/questions/631238/modifying-the-android-seekbar-widget-to-operate-vertically">here</a>. As it is, the SeekBar operates a little quirky. Here is my slightly adapted <code>onTouchEvent()</code> from that example:</p> <pre><code>public boolean onTouchEvent(MotionEvent event) { xPos = event.getX(); yPos = event.getY(); oOffset = this.getThumbOffset(); oProgress = this.getProgress(); //Code from example - Not working //this.setThumbOffset( progress * (this.getBottom()-this.getTop()) ); this.setProgress((int)(29*yPos/this.getBottom())); return true; } </code></pre> <p>I've managed to implement one VerticalSeekBar in which the progress updates as expected and is fully-functional, but the thumb does not follow suit. This is only a graphical glitch, so I'm overlooking it for now. But, it <em>would</em> be nice to have that working. This SeekBar has <code>max = 20</code>.</p> <p>However, I tried implementing another VerticalSeekBar with <code>max = 1000</code>. Obviously, it uses the same code, so you'd assume the same behavior. I'm only able to achieve a progress of 0~35, even as my finger slides beyond the SeekBar and eventually off the screen. If I just tap near the end of the progress bar (which <em>should</em> be <code>progress ~ 900</code>) it returns a progress of about 35 and the yellow progress bar reflects that value by staying near the top.</p> <p>My question is: Does anyone have a link to a working vertical SeekBar, <em>or</em> know how to adapt this particular example?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload