1

On devices running Android API <= 22, my custom SeekBar looks as follows: enter image description here

On devices running Android API >= 23, my custom SeekBar looks as follows: enter image description here

Why does my SeekBar drawable look incorrect on devices API >= 23? Here is my XML

seekbar_progress.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item
    android:id="@android:id/background"
    android:drawable="@drawable/seekbar_progress_bg" />
<item android:id="@android:id/progress">
    <scale
        android:drawable="@drawable/seekbar_progress_fill"
        android:scaleWidth="100%" />
</item>

</layer-list>

seekbar_thumb.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="oval">
        <size
            android:width="@dimen/seekbar_thumb"
            android:height="@dimen/seekbar_thumb" />
        <solid android:color="@color/white" />
        <stroke
            android:width="@dimen/seekbar_thumb_border"
            android:color="@color/gray" />
    </shape>
</item>
</layer-list>

layout file

<SeekBar
    android:thumb="@drawable/seekbar_thumb"
    android:progressDrawable="@drawable/seekbar_progress"
    android:splitTrack="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:progress="50" />
7geeky
  • 438
  • 1
  • 12
  • 26

1 Answers1

3

For reasons unknown, by playing with minHeight and maxHeight I was able to get the desired behavior