Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Material Design Divider Color

Tags:

android

Following color UI application of Material design i want to use an divider for the white theme. Guide told me that divider have 12% of white color, but how i can define 12% of white color divider in xml layout file?

enter image description here

like image 897
Sergey Shustikov Avatar asked Jan 08 '15 11:01

Sergey Shustikov


People also ask

What is the material of divider?

The MaterialDivider is a view that can be used in layouts to separate content into clear groups. Note: Make sure to set android:layout_height="wrap_content" on the MaterialDivider to ensure that the correct size is set for the divider.

What is inset divider?

Inset dividers separate related content, such as sections in a list of contacts or emails in a conversation. Inset dividers should be used in conjunction with anchoring elements such as icons or avatars aligned with the Title Key Line. Example of inset divider.


2 Answers

12% refers to the alpha channel. The max alpa is 255, and 12% of 255 is 31. Hex of 31 is 1F. So the color is #1FFFFFFF

like image 71
Blackbelt Avatar answered Sep 23 '22 02:09

Blackbelt


You can also use the official color which is also used in the Settings app:

<View android:id="@+id/tile_divider"       android:layout_width="match_parent"       android:layout_height="1dp"       android:background="?android:attr/dividerVertical" /> 

The important line is:

android:background="?android:attr/dividerVertical" 
like image 40
Andrea Lazzarotto Avatar answered Sep 24 '22 02:09

Andrea Lazzarotto