a custom view for dash line with several colors
It's easy to use.
in xml
<com.arjinmc.dashcolorline.DashLine
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:dashGap="6dp"
app:dashWidth="50dp"
app:orientation="horizontal"
app:thickness="10dp" />
You can change your colors by edite DashLine.java
private int[] mColors = {Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW};
or in Activity/Fragment/View
((DashLine) findViewById(R.id.dashline_h))
.setColors(Color.GRAY, Color.parseColor("#23d290"));
You also can use setXXXX to change these attributes as above in the xml file.
If you set the dashGap to zero,you will see a solid line.