Add identicons to contact list

This commit is contained in:
str4d
2016-01-05 06:10:36 +00:00
parent c7387ee37c
commit e62d60ff52
3 changed files with 72 additions and 37 deletions

View File

@@ -2,49 +2,71 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:padding="12dp">
android:layout_height="@dimen/listitem_height_one_line_avatar"
android:background="?attr/selectableItemBackground">
<ImageView
android:id="@+id/bulbView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_medium"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_gravity="center_vertical"
tools:src="@drawable/contact_disconnected"/>
<im.delight.android.identicons.SymmetricIdenticon
android:id="@+id/identiconView"
android:layout_width="@dimen/listitem_picture_size"
android:layout_height="@dimen/listitem_picture_size"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
android:layout_marginStart="@dimen/listitem_horizontal_margin"/>
<TextView
android:id="@+id/nameView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/margin_small"
android:layout_marginEnd="@dimen/margin_small"
android:textSize="@dimen/text_size_medium"
android:gravity="center_vertical"
tools:text="This is a name of a contact. It can be quite long."/>
<LinearLayout
android:id="@+id/bulbHolder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="@+id/dateView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/margin_small"
android:layout_marginEnd="@dimen/margin_small"
android:gravity="center_vertical"
android:textColor="@color/no_private_messages"
tools:text="Dec 24"/>
<ImageView
android:id="@+id/bulbView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/contact_disconnected"/>
</LinearLayout>
<TextView
android:id="@+id/dateView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/no_private_messages"
tools:text="Dec 24"/>
</LinearLayout>
<TextView
android:id="@+id/nameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/margin_small"
android:layout_marginLeft="@dimen/listitem_text_left_margin"
android:layout_marginRight="@dimen/margin_small"
android:layout_marginStart="@dimen/listitem_text_left_margin"
android:layout_toLeftOf="@id/bulbHolder"
android:layout_toStartOf="@id/bulbHolder"
android:gravity="center_vertical"
android:maxLines="2"
android:textSize="@dimen/text_size_medium"
tools:text="This is a name of a contact. It can be quite long."/>
</RelativeLayout>
<View style="@style/Divider.Horizontal"/>

View File

@@ -20,4 +20,10 @@
<dimen name="nav_drawer_width">300dp</dimen>
<dimen name="nav_seperator_height">1dp</dimen>
<dimen name="listitem_horizontal_margin">16dp</dimen>
<dimen name="listitem_picture_size">40dp</dimen>
<dimen name="listitem_text_left_margin">72dp</dimen>
<dimen name="listitem_height_one_line_avatar">56dp</dimen>
</resources>