title: Android 6.0 Marshmallow stops showing Vertical SeekBar thumb
body: <p>I've been using <a href="https://stackoverflow.com/a/28397530/250340">this basic wrapper</a> around a SeekBar but find it hides the thumb, or does something funky like make it white on a white background, under Marshmallow.</p>
  
  <p>I used the AS "BlankActivity" wizard to create a project to illustrate this, changing nothing except what is described here, from the defaults. On the left is Lollipop, and the same code is running on the right under Marshmallow:</p>
  
  <p><a href="https://i.stack.imgur.com/U3j1C.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U3j1C.jpg" alt="enter image description here"></a></p>
  
  <p>There is a custom horizontal SeekBar to test if there was a general problem customizing them, which there isn't. The first vertical one on the left has no style, which is fine pre-Marshmallow but not otherwise, the central one explicity uses the Widget.Material.Light.SeekBar style to test if the default somehow wasn't being picked up, and the last one gives a big clue because it uses the old Widget.Holo.SeekBar style where it then appears, albeit looking like it came out a few years ago.</p>
  
  <p>Here's the layout for this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
      android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
      tools:context=".MainActivity"
      &gt;
  
      &lt;com.otamate.seekbarmarshbug.CustomSeekBar
          android:id="@+id/seekBarCustom"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          /&gt;
  
      &lt;com.otamate.seekbarmarshbug.VerticalSeekBar
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_below="@+id/seekBarCustom"
          /&gt;
  
      &lt;com.otamate.seekbarmarshbug.VerticalSeekBar
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:gravity="center_horizontal"
          android:layout_below="@+id/seekBarCustom"
          android:layout_centerHorizontal="true"
          style="@android:style/Widget.Material.Light.SeekBar"
          /&gt;
  
      &lt;com.otamate.seekbarmarshbug.VerticalSeekBar
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_alignParentRight="true"
          android:layout_below="@+id/seekBarCustom"
          style="@android:style/Widget.Holo.SeekBar"
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The CustomSeekBar:</p>
  
  <pre><code>package com.otamate.seekbarmarshbug;
  
  import android.content.Context;
  import android.util.AttributeSet;
  import android.widget.SeekBar;
  
  public class CustomSeekBar extends SeekBar {
  
      public CustomSeekBar(Context context) {
          super(context);
      }
  
      public CustomSeekBar(Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
      }
  
      public CustomSeekBar(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  }
  </code></pre>
  
  <p>and the VerticalSeekBar:</p>
  
  <pre><code>package com.otamate.seekbarmarshbug;
  
  import android.content.Context;
  import android.graphics.Canvas;
  import android.util.AttributeSet;
  import android.view.MotionEvent;
  import android.widget.SeekBar;
  
  public class VerticalSeekBar extends SeekBar {
  
      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());
      }
  
      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:
              case MotionEvent.ACTION_MOVE:
              case MotionEvent.ACTION_UP:
                  setProgress(getMax() - (int) (getMax() * event.getY() / getHeight()));
                  onSizeChanged(getWidth(), getHeight(), 0, 0);
                  break;
  
              case MotionEvent.ACTION_CANCEL:
                  break;
          }
          return true;
      }
  
  }
  </code></pre>