conversation_list_row.xml

  1<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2             xmlns:app="http://schemas.android.com/apk/res-auto"
  3             android:layout_width="fill_parent"
  4             android:layout_height="wrap_content"
  5             android:descendantFocusability="blocksDescendants">
  6
  7    <View
  8        android:layout_width="fill_parent"
  9        android:layout_height="match_parent"
 10        android:background="?attr/conversations_overview_background"/>
 11
 12    <FrameLayout
 13        android:id="@+id/swipeable_item"
 14        android:layout_width="fill_parent"
 15        android:layout_height="wrap_content"
 16        android:background="?attr/color_background_primary">
 17
 18        <RelativeLayout
 19            android:layout_width="fill_parent"
 20            android:layout_height="wrap_content"
 21            android:background="?android:selectableItemBackground"
 22            android:orientation="horizontal"
 23            android:padding="8dp">
 24
 25            <com.makeramen.roundedimageview.RoundedImageView
 26                android:id="@+id/conversation_image"
 27                android:layout_width="56dp"
 28                android:layout_height="56dp"
 29                android:layout_alignParentLeft="true"
 30                android:scaleType="centerCrop"
 31                app:riv_corner_radius="2dp"/>
 32
 33            <RelativeLayout
 34                android:layout_width="fill_parent"
 35                android:layout_height="wrap_content"
 36                android:layout_centerVertical="true"
 37                android:layout_toRightOf="@+id/conversation_image"
 38                android:paddingLeft="8dp">
 39
 40                <android.support.text.emoji.widget.EmojiTextView
 41                    android:id="@+id/conversation_name"
 42                    android:layout_width="wrap_content"
 43                    android:layout_height="wrap_content"
 44                    android:layout_alignLeft="@+id/conversation_lastwrapper"
 45                    android:layout_toLeftOf="@+id/conversation_lastupdate"
 46                    android:paddingRight="4dp"
 47                    android:singleLine="true"
 48                    android:text="Awesome groupchat"
 49                    android:textColor="?attr/color_text_primary"
 50                    android:textSize="?attr/TextSizeHeadline"
 51                    android:typeface="sans"/>
 52
 53                <RelativeLayout
 54                    android:id="@+id/conversation_lastwrapper"
 55                    android:layout_width="match_parent"
 56                    android:layout_height="wrap_content"
 57                    android:layout_below="@id/conversation_name"
 58                    android:layout_marginTop="4dp">
 59
 60                    <TextView
 61                        android:id="@+id/sender_name"
 62                        android:layout_width="wrap_content"
 63                        android:layout_height="wrap_content"
 64                        android:minHeight="?attr/IconSize"
 65                        android:layout_centerVertical="true"
 66                        android:gravity="center_vertical"
 67                        android:layout_alignParentLeft="true"
 68                        android:text="@string/me"
 69                        android:layout_marginRight="?attr/TextSeparation"
 70                        android:textColor="?attr/color_text_secondary"
 71                        android:visibility="visible"
 72                        android:textSize="?attr/TextSizeBody"/>
 73
 74                    <LinearLayout android:layout_width="match_parent"
 75                                  android:layout_height="wrap_content"
 76                                  android:layout_centerVertical="true"
 77                                  android:orientation="vertical"
 78                                  android:layout_toRightOf="@id/sender_name"
 79                                  android:layout_alignWithParentIfMissing="true"
 80                                  android:layout_toLeftOf="@+id/notification_status"
 81                                  android:id="@+id/txt_img_wrapper">
 82                        <android.support.text.emoji.widget.EmojiTextView
 83                            android:id="@+id/conversation_lastmsg"
 84                            android:layout_width="match_parent"
 85                            android:layout_height="wrap_content"
 86                            android:minHeight="?attr/IconSize"
 87                            android:gravity="center_vertical"
 88                            android:scrollHorizontally="false"
 89                            android:singleLine="true"
 90                            android:text="This is a placeholder text to show the last messages"
 91                            android:textColor="?attr/color_text_primary"
 92                            android:textSize="?attr/TextSizeBody"/>
 93
 94                        <com.makeramen.roundedimageview.RoundedImageView
 95                            android:id="@+id/conversation_lastimage"
 96                            android:layout_width="fill_parent"
 97                            android:layout_height="36dp"
 98                            android:background="@color/black87"
 99                            android:scaleType="centerCrop"
100                            android:visibility="gone"
101                            app:riv_corner_radius="2dp"/>
102                    </LinearLayout>
103                    <ImageView
104                        android:visibility="visible"
105                        android:id="@+id/notification_status"
106                        android:layout_width="?attr/IconSize"
107                        android:layout_height="?attr/IconSize"
108                        android:layout_toLeftOf="@+id/unread_count"
109                        android:layout_alignWithParentIfMissing="true"
110                        android:layout_centerVertical="true"
111                        android:layout_marginLeft="4dp"
112                        android:alpha="?attr/icon_alpha"
113                        android:src="?attr/icon_notifications"
114                        />
115                    <eu.siacs.conversations.ui.widget.UnreadCountCustomView
116                        android:id="@+id/unread_count"
117                        android:layout_width="?attr/IconSize"
118                        android:layout_height="?attr/IconSize"
119                        android:layout_centerVertical="true"
120                        android:layout_marginLeft="3dp"
121                        android:layout_marginTop="2dp"
122                        android:layout_marginBottom="1dp"
123                        android:visibility="gone"
124                        android:layout_alignParentRight="true"
125                        app:backgroundColor="?attr/unread_count" />
126
127                </RelativeLayout>
128
129                <TextView
130                    android:id="@+id/conversation_lastupdate"
131                    android:layout_width="wrap_content"
132                    android:layout_height="wrap_content"
133                    android:layout_alignBaseline="@+id/conversation_name"
134                    android:layout_alignParentRight="true"
135                    android:gravity="right"
136                    android:text="23:42"
137                    android:textColor="?attr/color_text_secondary"
138                    android:textSize="?attr/TextSizeInfo"/>
139            </RelativeLayout>
140        </RelativeLayout>
141    </FrameLayout>
142</FrameLayout>