I'd better answer my own question...
It seems styles.xml - style - item
takes the color of the last item
in layer-list
as background for the entire divider. This last item
is on top of other layers, and that is why other items in the layer-list don't show up.
The key is padding
.
styles.xml
<style name="ListView" parent="android:style/Widget.ListView">
<item name="android:divider">@drawable/divider</item>
<item name="android:dividerHeight">10dp</item>
</style>
divider.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#0000ff" />
<padding android:top="5dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="#ff0000" />
</shape>
</item>
</layer-list>
So in my case I just need to change 10dp/5dp to 2dp/1dp to get 2 thin horizontal lines.