I have created a custom SeekBar which uses a LayerList. I haven’t used a drawable resource.
It says here that my “item”…
Drawable resource. Required. Reference to a drawable resource.
Will I encounter any problems if I do not create a drawable resource for this item?
custom_seek_bar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/bkg">
<shape>
<corners android:radius="12dp" />
<solid
android:color="@color/white" />
</shape>
</item>
<item android:id="@android:id/prog">
<clip>
<shape>
<corners android:radius="12dp" />
<solid
android:color="@color/blue" />
</shape>
</clip>
</item>
</layer-list>
As the docs says:
A LayerDrawable is a drawable object that manages an array of other drawables.
The equivalent of in Java code is the Layer Drawable.
( http://developer.android.com/reference/android/graphics/drawable/LayerDrawable.html )
So it will probably not accept it without the resources. It was really a bad idea to give such a generic name (layer-list) to something related only to drawables.
Hope that it helps!