summaryrefslogtreecommitdiffstats
path: root/res/layout/conversation_item_view.xml
blob: 2b8065a60e63c3ca3557c8ca0dae53b1e911fb57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2013 Google Inc.
     Licensed to The Android Open Source Project.

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- This layout is used as a template to create custom view CanvasConversationHeaderView
    in normal mode. To be able to get the correct measurements, every source field should
    be populated with data here. E.g:
    - Text View should set text to a random long string (android:text="@string/long_string")
    - Image View should set source to a specific asset -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="88dp"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/conversation_item_frame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/conv_list_padding"
        android:layout_marginRight="@dimen/conv_list_padding"
        android:orientation="horizontal">

        <View
            android:id="@+id/contact_image"
            android:layout_width="@dimen/contact_image_width"
            android:layout_height="@dimen/contact_image_height"
            android:layout_marginTop="@dimen/conv_list_padding"
            style="@style/ConversationListContactImageStyle" />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <!-- these views overlap horizontally, that's okay. -->
                <!-- we are only interested in the left edge of senders and the right edge -->
                <!-- of the date. -->
                <!-- sendersWidth, clipX, and dateX are dynamically determined later. -->

                <FrameLayout
                    android:id="@+id/senders_decoration"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content">

                    <!-- for Email -->
                    <!-- top margin should be 12dp, but the asset has 2dp built-in padding -->
                    <ImageView
                        android:id="@+id/reply_state"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/conv_list_padding"
                        android:src="@drawable/ic_badge_reply_holo_light"
                        style="@style/ConversationListReplyStateStyle" />

                    <!-- for Gmail -->
                    <ImageView
                        android:id="@+id/personal_indicator"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/conv_list_padding"
                        android:src="@drawable/ic_email_caret_single"
                        style="@style/ConversationListPersonalIndicatorStyle" />

                </FrameLayout>

                <TextView
                    android:id="@+id/senders"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/conv_list_padding"
                    android:textSize="16sp"
                    android:lines="1"
                    android:includeFontPadding="false"
                    android:text="@string/long_string"
                    style="@style/ConversationListSendersStyle" />

                <ImageView
                    android:id="@+id/info_icon"
                    android:layout_width="14dp"
                    android:layout_height="14dp"
                    android:layout_marginTop="@dimen/conv_list_padding"
                    style="@style/ConversationListInfoIconStyle" />

                <TextView
                    android:id="@+id/date"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/conv_list_padding"
                    android:layout_alignBaseline="@id/senders"
                    android:textSize="12sp"
                    android:lines="1"
                    android:includeFontPadding="false"
                    android:text="@string/long_string"
                    style="@style/ConversationListDateStyle" />

                <ImageView
                    android:id="@+id/paperclip"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="17dp"
                    android:src="@drawable/ic_attach_file_20dp"
                    style="@style/ConversationListPaperclipStyle" />

                <!-- for Email -->
                <View android:id="@+id/color_block"
                      android:layout_width="@dimen/color_block_width"
                      android:layout_height="@dimen/color_block_height"
                      style="@style/ConversationListColorBlockStyle" />

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/conv_list_padding">

                <ImageView
                    android:id="@+id/star"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingBottom="3dp"
                    android:src="@drawable/ic_star_outline_20dp"
                    style="@style/ConversationListStarStyle"/>

                <TextView
                    android:id="@+id/subject"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dp"
                    android:includeFontPadding="false"
                    android:textSize="14sp"
                    style="@style/ConversationListSubjectStyle"/>

                <!-- snippet overlaps folders completely in the layout;
                     code will later remove the overlap -->
                <TextView
                    android:id="@+id/snippet"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dp"
                    android:includeFontPadding="false"
                    android:textSize="14sp"
                    style="@style/ConversationListSnippetAndFoldersStyle"/>

                <!-- folders overlap snippet completely in the layout;
                     code will later remove the overlap -->
                <TextView
                    android:id="@+id/folders"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:includeFontPadding="false"
                    android:textSize="12sp"
                    style="@style/ConversationListSnippetAndFoldersStyle"/>

            </RelativeLayout>

        </LinearLayout>

    </LinearLayout>

</LinearLayout>