I’m using the following code to display a separator view in my activity:
<View
android:id="@+id/view"
android:layout_width="2dp"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_toLeftOf="@id/signoutbutton"
android:background="@drawable/separator" />
My separator.xml file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<stroke
android:height="54dp"
android:width="1dp"
android:color="#FFFFFF" />
<solid android:color="#FFFFFF" />
</shape>
</item>
<item>
<shape android:shape="rectangle" >
<stroke
android:height="54dp"
android:width="1dp"
android:color="@color/blue" />
<solid android:color="@color/blue" />
</shape>
</item>
</layer-list>
however, I am achieving this 
The problem is that only the blue color is shown and not the white as I had stated in the drawable file. How can I correct this?
you should try to use as below:
For more info here LayerList
Hope this help you