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?
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.
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.
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
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With