Android Material ListView Dividers
<p>I am trying to build a listview that follows google's guidelines.</p>

<p>Here are my requirements:</p>

<ol>
<li>Allow group headers</li>
<li>Allow full width dividers between groups</li>
<li>Allow partial dividers between items</li>
</ol>

<p>Here is an image showing the header and the divider between items.
Unfortunately it's not possible to view the full width divider between the groups but that's just like a normal divider.</p>

<p><a href="https://i.stack.imgur.com/U30jb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U30jb.png" alt="Material listview"></a></p>

<p>I can build a custom adapter which receives subclasses of <code>Item</code>, like <code>HeaderItem</code> and <code>ContactItem</code>.</p>

<p>The <code>header.xml</code> would simply be</p>

<pre><code>&lt;TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:minHeight="48dp"
    android:padding="16dp"
    android:text="Today"
    android:textColor="#8A000000"
    android:textSize="14sp" /&gt;
</code></pre>

<p>As for the <code>contact.xml</code>:</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"&gt;

        &lt;ImageView
            android:id="@+id/friend_profile_picture"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:layout_margin="16dp"
            android:scaleType="fitStart"
            android:src="@drawable/ic_home" /&gt;

            &lt;TextView
                android:id="@+id/friend_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignWithParentIfMissing="true"
                android:layout_toRightOf="@+id/friend_profile_picture"
                android:paddingTop="16dp"
                android:text="random_text"
                android:textAppearance="@style/TextAppearance.AppCompat.Body2" /&gt;

            &lt;TextView
                android:id="@+id/friend_state"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/friend_name"
                android:layout_toRightOf="@+id/friend_profile_picture"
                android:paddingBottom="16dp"
                android:text="random_text"
                android:textAppearance="@style/TextAppearance.AppCompat.Body1"
                android:textSize="14sp" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>Now, my problem is the item divider. The full width divider would be a normal listview divider. I'm just not sure how to do a partial dividir and make it work alongside the normal divider. Any hints?</p>

<p>This could also be done with <code>RecyclerView</code> and <code>ItemDecorator</code>s if it's easier/better.</p>