1

I have a custom Seekbar that I have made using 9 patch images so I can have different aspects for the main progress, the secondary progress and the background.

As of now, this is the result I have:

enter image description here

And the code to generate it is:

    <item
        android:id="@android:id/secondaryProgress">
        <clip>
            <nine-patch android:src="@drawable/dw_sec_prog" android:dither="true"/>
        </clip>
    </item>

    <item
        android:id="@android:id/progress">
        <clip>
            <nine-patch android:src="@drawable/dw_prog" android:dither="true"/>
        </clip>
    </item>

    <item
        android:id="@android:id/background">

        <nine-patch android:src="@drawable/dw_bg" android:dither="true"/>

    </item>

The problem is that for the secondary progress (dw_sec_prog) I have a transparent background and the background (dw_bg) is being shown below it.

The desired result shall be something like this:

enter image description here

This result shall keep the background of the secondary progress transparent. I know that in the layer-list there is an option to write a layer mask (mentioned here) but that is not useful for me since I'm restricted to api 16 and this solution only works on 21.

Is there then a way to make that happen ?

EDIT: Small clarification

Community
  • 1
  • 1
Carlos
  • 147
  • 10
  • 1
    http://stackoverflow.com/questions/3480456/seek-bar-change-path-color-from-yellow-to-white – Apurva Feb 17 '15 at 18:14
  • 1
    @Apurva this is not the same question I am asking. In my case the the progress and the secondary progress should behave normally, but the background drawable should not be seen behind the secondary progress but the secondary progress should anyway remain transparent with the background. – Carlos Feb 18 '15 at 08:01

0 Answers0