• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3    Copyright (C) 2015 The Android Open Source Project
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9         http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16-->
17<com.android.messaging.ui.conversationlist.ConversationListItemView
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    android:layout_width="match_parent"
21    android:layout_height="wrap_content">
22
23    <!-- The background displayed when the conversation is swiped sideways -->
24    <LinearLayout
25        android:id="@+id/crossSwipeBackground"
26        android:orientation="horizontal"
27        android:layout_width="match_parent"
28        android:layout_height="match_parent"
29        android:gravity="center_vertical|start"
30        android:baselineAligned="false"
31        android:background="@drawable/swipe_shadow"
32        android:visibility="gone"
33        android:padding="@dimen/conversation_list_item_view_padding">
34        <ImageView
35            android:id="@+id/crossSwipeArchiveIconLeft"
36            android:layout_width="wrap_content"
37            android:layout_height="wrap_content"
38            android:gravity="center_vertical|left"
39            android:visibility="gone"
40            android:src="@drawable/ic_archive_small_dark"
41            android:importantForAccessibility="no"
42            android:contentDescription="@null"/>
43        <FrameLayout
44            android:layout_width="0dp"
45            android:layout_height="match_parent"
46            android:layout_weight="1" />
47        <ImageView
48            android:id="@+id/crossSwipeArchiveIconRight"
49            android:layout_width="wrap_content"
50            android:layout_height="wrap_content"
51            android:layout_gravity="center_vertical|right"
52            android:visibility="gone"
53            android:src="@drawable/ic_archive_small_dark"
54            android:importantForAccessibility="no"
55            android:contentDescription="@null"/>
56    </LinearLayout>
57
58    <FrameLayout
59        android:id="@+id/swipeableContainer"
60        android:layout_width="match_parent"
61        android:layout_height="wrap_content"
62        android:importantForAccessibility="no" >
63        <LinearLayout
64            android:id="@+id/swipeableContent"
65            android:orientation="horizontal"
66            android:layout_width="match_parent"
67            android:layout_height="wrap_content"
68            android:background="?android:attr/selectableItemBackground"
69            android:clipToPadding="false"
70            android:duplicateParentState="true"
71            android:padding="@dimen/conversation_list_item_view_padding">
72
73            <!-- Contact avatar on the left side of the view -->
74            <FrameLayout
75                android:layout_width="wrap_content"
76                android:layout_height="wrap_content"
77                android:background="@android:color/transparent">
78                <com.android.messaging.ui.ContactIconView
79                    android:id="@+id/conversation_icon"
80                    android:layout_width="@dimen/conversation_list_contact_icon_size"
81                    android:layout_height="@dimen/conversation_list_contact_icon_size"
82                    android:importantForAccessibility="no"
83                    android:contentDescription="@null"
84                    app:iconSize="large"
85                    android:clickable="true"
86                    android:background="@android:color/transparent" />
87                <ImageView
88                    android:id="@+id/conversation_checkmark"
89                    android:layout_width="@dimen/conversation_list_contact_icon_size"
90                    android:layout_height="@dimen/conversation_list_contact_icon_size"
91                    android:src="@drawable/ic_checkmark_circle_blue"
92                    android:visibility="gone"
93                    android:importantForAccessibility="no"
94                    android:background="@android:color/transparent" />
95                <ImageView
96                    android:id="@+id/conversation_failed_status_icon"
97                    android:layout_width="wrap_content"
98                    android:layout_height="wrap_content"
99                    android:layout_gravity="bottom|end"
100                    android:src="@drawable/ic_failed_status_red"
101                    android:visibility="gone"
102                    android:importantForAccessibility="no"
103                    android:contentDescription="@null"
104                    android:background="@android:color/transparent" />
105            </FrameLayout>
106
107            <!-- The conversation name, message preview, etc -->
108            <LinearLayout
109                style="@style/ConversationListItemViewPaddingStyle"
110                android:orientation="vertical"
111                android:layout_width="0dp"
112                android:layout_height="wrap_content"
113                android:layout_weight="1"
114                android:layout_gravity="top"
115                android:background="@android:color/transparent">
116                <LinearLayout
117                    android:orientation="horizontal"
118                    android:layout_width="match_parent"
119                    android:layout_height="wrap_content"
120                    android:background="@android:color/transparent">
121                    <LinearLayout
122                            android:layout_width="0dp"
123                            android:layout_height="wrap_content"
124                            android:layout_weight="1"
125                            android:background="@android:color/transparent">
126                        <ImageView
127                            android:id="@+id/conversation_notification_bell"
128                            style="@style/ConversationListNotificationBellPaddingStyle"
129                            android:layout_width="wrap_content"
130                            android:layout_height="wrap_content"
131                            android:src="@drawable/ic_notifications_off_small_light"
132                            android:visibility="gone"
133                            android:importantForAccessibility="no"
134                            android:contentDescription="@null"
135                            android:layout_gravity="center_vertical"
136                            android:background="@android:color/transparent" />
137                        <TextView
138                            android:id="@+id/conversation_name"
139                            style="@style/ConversationListItemViewConversationNameStyle"
140                            android:layout_width="match_parent"
141                            android:layout_height="wrap_content"
142                            android:singleLine="true"
143                            android:layout_gravity="center_vertical"
144                            android:paddingBottom="2dp" />
145                    </LinearLayout>
146                    <ImageView
147                            android:id="@+id/work_profile_icon"
148                            android:layout_width="wrap_content"
149                            android:layout_height="wrap_content"
150                            android:layout_gravity="right"
151                            android:background="@android:color/transparent"
152                            android:scaleType="center"
153                            android:src="@drawable/ic_work_profile"
154                            android:visibility="gone"/>
155                </LinearLayout>
156                <TextView
157                    android:id="@+id/conversation_subject"
158                    style="@style/ConversationListItemViewTextStyle"
159                    android:layout_width="match_parent"
160                    android:layout_height="wrap_content"
161                    android:singleLine="true"
162                    android:paddingBottom="3dp"
163                    android:ellipsize="end"
164                    android:visibility="gone" />
165                <TextView
166                    android:id="@+id/conversation_snippet"
167                    style="@style/ConversationListItemViewTextStyle"
168                    android:layout_width="match_parent"
169                    android:layout_height="wrap_content"
170                    android:paddingBottom="3dp"
171                    android:ellipsize="end" />
172                <TextView
173                    android:id="@+id/conversation_timestamp"
174                    style="@style/ConversationListItemViewTextStyle"
175                    android:layout_width="wrap_content"
176                    android:layout_height="wrap_content" />
177            </LinearLayout>
178
179            <!-- The attachment preview on the right side of the view -->
180            <FrameLayout
181                android:layout_width="wrap_content"
182                android:layout_height="wrap_content"
183                android:layout_gravity="top|end"
184                android:background="@android:color/transparent">
185                <com.android.messaging.ui.AsyncImageView
186                    android:id="@+id/conversation_image_preview"
187                    style="@style/ConversationListItemViewPaddingStyle"
188                    app:cornerRadius="@dimen/conversation_list_image_preview_corner_radius"
189                    android:layout_width="@dimen/conversation_list_image_preview_size"
190                    android:layout_height="@dimen/conversation_list_image_preview_size"
191                    android:visibility="gone"
192                    android:scaleType="centerCrop"
193                    android:contentDescription="@string/message_image_content_description"
194                    android:background="@android:color/transparent" />
195                <com.android.messaging.ui.AudioAttachmentView
196                    android:id="@+id/audio_attachment_view"
197                    android:layout_width="@dimen/conversation_list_image_preview_size"
198                    android:layout_height="@dimen/conversation_list_image_preview_size"
199                    app:layoutMode="subcompact"
200                    android:visibility="gone"
201                    android:background="@android:color/transparent" />
202            </FrameLayout>
203        </LinearLayout>
204    </FrameLayout>
205</com.android.messaging.ui.conversationlist.ConversationListItemView>
206