androidandroid-seekbar

Android seekbar discrete, how to remove step indicator


I've just discovered the seekbar discrete widget in android studio, i found it very usefull but i can't figure out how to remove the step indicators, or changing them with more appropriate drawables.

Did someone managed to do it?

Here's a screen of my current seekbar:

enter image description here

I'd like to change all the current step indicators, thank you.

EDIT:

Here's my current progress drawable:

<item android:id="@android:id/background" >
    <shape >
        <corners android:radius="20dp" />
        <gradient
            android:startColor="@color/Trasparente"
            android:centerColor="@color/Trasparente"
            android:centerX="1"
            android:endColor="@color/Trasparente"
            android:angle="0"
            />
    </shape>
</item>
<item android:id="@android:id/progress" >
    <clip android:clipOrientation="horizontal" android:gravity="left" >
        <shape>
            <corners android:radius="20dp" />
            <gradient
                android:startColor="@color/colorBluClima"
                android:centerColor="@color/colorGreenServizi"
                android:centerX="0.35"
                android:endColor="@color/colorRossoErrore"
                android:angle="0"
                />
        </shape>
    </clip>
</item>

and here's my seekbar in the layout:

 <SeekBar
            android:maxHeight="12dp"
            style="@style/Widget.AppCompat.SeekBar.Discrete"
            android:layout_width="812dp"
            android:layout_height="100dp"
            android:max="19"
            android:id="@+id/SeekBarStufa220"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:layout_marginStart="90dp"
            app:layout_constraintLeft_toLeftOf="parent"
            android:layout_marginEnd="90dp"
            app:layout_constraintRight_toRightOf="parent"
            android:paddingEnd="85dp"
            android:paddingStart="85dp"
            android:progressDrawable="@drawable/progress_seek_clima"
            android:thumb="@drawable/ic_temprature"
            app:layout_constraintVertical_bias="0.79"
            android:progress="10" />

The thumb is a simple drawable


Solution

  • I solved it creating a new style with SeekBar.Discrete as parent.

     <style name="SeekBarWithoutSteps" parent="Base.Widget.AppCompat.SeekBar.Discrete">
        <item name="tickMark">@null</item>
    </style>