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.conversation.ComposeMessageView
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    android:id="@+id/message_compose_view_container"
21    android:layout_width="match_parent"
22    android:layout_height="wrap_content"
23    android:orientation="vertical" >
24
25    <!-- Note it may seem off to have the layout_weight="1" on the compose bar and attachment view
26     when it's the media picker that expands, but this is correct because weight also works when
27     there's not enough space.  Any views with positive weights will be shrunk to make space.
28     When the media picker goes full screen, it fills the parent, leaving no room for the compose
29     bar -->
30    <LinearLayout
31        android:layout_width="match_parent"
32        android:layout_height="wrap_content"
33        android:layout_weight="1"
34        android:clipChildren="false"
35        android:clipToPadding="false"
36        android:orientation="vertical">
37
38        <View
39            android:id="@+id/top_margin"
40            android:layout_width="match_parent"
41            android:layout_height="16dp" />
42
43        <include layout="@layout/attachment_preview"
44            android:id="@+id/attachment_draft_view"
45            style="@style/ComposeMessageViewDraftViewStyle"
46            android:layout_width="match_parent"
47            android:layout_height="0dp"
48            android:layout_marginBottom="4dp"
49            android:layout_weight="1"
50            android:visibility="gone" />
51
52        <RelativeLayout
53            android:id="@+id/subject_view"
54            style="@style/SubjectViewStyle"
55            android:paddingTop="@dimen/compose_message_subject_top_padding"
56            android:paddingBottom="@dimen/compose_message_subject_bottom_padding"
57            android:layout_width="match_parent"
58            android:layout_height="wrap_content"
59            android:visibility="gone"
60            android:clipChildren="false"
61            android:clipToPadding="false"
62            android:orientation="horizontal">
63
64            <com.android.messaging.ui.PlainTextEditText
65                android:background="@drawable/subject_editor_bubble"
66                android:id="@+id/compose_subject_text"
67                style="@style/ConversationComposeSubjectText"
68                android:hint="@string/compose_message_view_subject_hint_text"
69                android:layout_height="wrap_content"
70                android:layout_width="match_parent"
71                android:imeOptions="flagNoExtractUi" />
72
73            <ImageButton
74                android:id="@+id/delete_subject_button"
75                style="@style/AttachmentPreviewCloseButtonStyle"
76                android:layout_width="wrap_content"
77                android:layout_height="wrap_content"
78                android:background="@null"
79                android:src="@drawable/ic_remove_light"
80                android:translationY="@dimen/compose_message_subject_cancel_top_offset"
81                android:contentDescription="@string/delete_subject_content_description" />
82
83        </RelativeLayout>
84
85        <!-- Holds all views that create the actual compose box -->
86        <LinearLayout
87            android:layout_width="match_parent"
88            android:layout_height="wrap_content"
89            android:orientation="horizontal">
90
91            <!-- Contains compose message bubble and character counter for SMS which should be left
92            aligned -->
93            <LinearLayout
94                android:layout_width="0dp"
95                android:layout_weight="1"
96                android:layout_height="wrap_content"
97                android:orientation="vertical">
98
99                <!-- Contains media button and compose message bubble whose centers should be
100                vertically aligned -->
101                <LinearLayout
102                    android:layout_width="match_parent"
103                    android:layout_height="wrap_content"
104                    android:orientation="horizontal">
105
106                    <ImageButton
107                        android:id="@+id/attach_media_button"
108                        style="@style/ComposeMessageViewAttachMediaButtonStyle"
109                        android:layout_width="wrap_content"
110                        android:layout_height="wrap_content"
111                        android:layout_gravity="center_vertical"
112                        android:src="@drawable/ic_attachment_dark"
113                        android:paddingTop="@dimen/compose_message_attachment_padding_topBottom"
114                        android:paddingBottom="@dimen/compose_message_attachment_padding_topBottom"
115                        android:contentDescription="@string/attachMediaButtonContentDescription" />
116
117                    <com.android.messaging.ui.PlainTextEditText
118                        android:id="@+id/compose_message_text"
119                        style="@style/ConversationComposeSendText"
120                        android:layout_height="wrap_content"
121                        android:layout_width="0dp"
122                        android:layout_weight="1"
123                        android:layout_gravity="center"
124                        android:background="@drawable/msg_bubble_input"
125                        android:hint="@string/compose_message_view_hint_text"
126                        android:imeOptions="actionSend|flagNoEnterAction|flagNoExtractUi" />
127
128                </LinearLayout>
129
130                <TextView
131                    android:id="@+id/char_counter"
132                    style="@style/ComposeMessageViewTextCounterStyle"
133                    android:layout_width="wrap_content"
134                    android:layout_height="wrap_content"
135                    android:singleLine="true"
136                    android:maxLines="1"
137                    android:visibility="invisible" />
138            </LinearLayout>
139
140            <LinearLayout
141                android:orientation="vertical"
142                android:layout_width="wrap_content"
143                android:layout_height="wrap_content">
144
145                <FrameLayout
146                    android:layout_width="wrap_content"
147                    android:layout_height="wrap_content"
148                    style="@style/ComposeMessageViewFrameLayoutStyle"
149                    android:layout_gravity="top" >
150                    <com.android.messaging.ui.conversation.SimIconView
151                        android:id="@+id/self_send_icon"
152                        android:layout_width="@dimen/conversation_message_contact_icon_size"
153                        android:layout_height="@dimen/conversation_message_contact_icon_size"
154                        android:importantForAccessibility="no"
155                        app:iconSize="normal"
156                        app:reveal="true"
157                        android:clickable="true" />
158                    <ImageButton
159                        android:id="@+id/send_message_button"
160                        android:layout_width="@dimen/conversation_message_contact_icon_size"
161                        android:layout_height="@dimen/conversation_message_contact_icon_size"
162                        android:src="@drawable/ic_send_light"
163                        android:background="@drawable/send_arrow_background"
164                        android:contentDescription="@string/sendButtonContentDescription"
165                        android:visibility="gone" />
166                </FrameLayout>
167
168                <TextView
169                    android:id="@+id/mms_indicator"
170                    style="@style/MmsIndicatorStyle"
171                    android:layout_width="wrap_content"
172                    android:layout_height="wrap_content"
173                    android:singleLine="true"
174                    android:maxLines="1"
175                    android:visibility="invisible"
176                    android:text="@string/mms_text" />
177            </LinearLayout>
178        </LinearLayout>
179    </LinearLayout>
180
181    <FrameLayout
182        android:id="@+id/mediapicker_container"
183        android:layout_width="match_parent"
184        android:layout_height="wrap_content"
185        android:layout_weight="0" />
186
187</com.android.messaging.ui.conversation.ComposeMessageView>
188