summaryrefslogtreecommitdiffstats
path: root/res/layout/compose_message_view.xml
blob: fd60e2aeb6dbe60cc519a6585f6367b8f49f48da (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
184
185
186
187
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2015 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.
-->
<com.android.messaging.ui.conversation.ComposeMessageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/message_compose_view_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <!-- Note it may seem off to have the layout_weight="1" on the compose bar and attachment view
     when it's the media picker that expands, but this is correct because weight also works when
     there's not enough space.  Any views with positive weights will be shrunk to make space.
     When the media picker goes full screen, it fills the parent, leaving no room for the compose
     bar -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:orientation="vertical">

        <View
            android:id="@+id/top_margin"
            android:layout_width="match_parent"
            android:layout_height="16dp" />

        <include layout="@layout/attachment_preview"
            android:id="@+id/attachment_draft_view"
            style="@style/ComposeMessageViewDraftViewStyle"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginBottom="4dp"
            android:layout_weight="1"
            android:visibility="gone" />

        <RelativeLayout
            android:id="@+id/subject_view"
            style="@style/SubjectViewStyle"
            android:paddingTop="@dimen/compose_message_subject_top_padding"
            android:paddingBottom="@dimen/compose_message_subject_bottom_padding"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="gone"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:orientation="horizontal">

            <com.android.messaging.ui.PlainTextEditText
                android:background="@drawable/subject_editor_bubble"
                android:id="@+id/compose_subject_text"
                style="@style/ConversationComposeSubjectText"
                android:hint="@string/compose_message_view_subject_hint_text"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:imeOptions="flagNoExtractUi" />

            <ImageButton
                android:id="@+id/delete_subject_button"
                style="@style/AttachmentPreviewCloseButtonStyle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@null"
                android:src="@drawable/ic_remove_light"
                android:translationY="@dimen/compose_message_subject_cancel_top_offset"
                android:contentDescription="@string/delete_subject_content_description" />

        </RelativeLayout>

        <!-- Holds all views that create the actual compose box -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <!-- Contains compose message bubble and character counter for SMS which should be left
            aligned -->
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <!-- Contains media button and compose message bubble whose centers should be
                vertically aligned -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <ImageButton
                        android:id="@+id/attach_media_button"
                        style="@style/ComposeMessageViewAttachMediaButtonStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:src="@drawable/ic_attachment_dark"
                        android:paddingTop="@dimen/compose_message_attachment_padding_topBottom"
                        android:paddingBottom="@dimen/compose_message_attachment_padding_topBottom"
                        android:contentDescription="@string/attachMediaButtonContentDescription" />

                    <com.android.messaging.ui.PlainTextEditText
                        android:id="@+id/compose_message_text"
                        style="@style/ConversationComposeSendText"
                        android:layout_height="wrap_content"
                        android:layout_width="0dp"
                        android:layout_weight="1"
                        android:layout_gravity="center"
                        android:background="@drawable/msg_bubble_input"
                        android:hint="@string/compose_message_view_hint_text"
                        android:imeOptions="actionSend|flagNoEnterAction|flagNoExtractUi" />

                </LinearLayout>

                <TextView
                    android:id="@+id/char_counter"
                    style="@style/ComposeMessageViewTextCounterStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:singleLine="true"
                    android:maxLines="1"
                    android:visibility="invisible" />
            </LinearLayout>

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <FrameLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    style="@style/ComposeMessageViewFrameLayoutStyle"
                    android:layout_gravity="top" >
                    <com.android.messaging.ui.conversation.SimIconView
                        android:id="@+id/self_send_icon"
                        android:layout_width="@dimen/conversation_message_contact_icon_size"
                        android:layout_height="@dimen/conversation_message_contact_icon_size"
                        android:importantForAccessibility="no"
                        app:iconSize="normal"
                        app:reveal="true"
                        android:clickable="true" />
                    <ImageButton
                        android:id="@+id/send_message_button"
                        android:layout_width="@dimen/conversation_message_contact_icon_size"
                        android:layout_height="@dimen/conversation_message_contact_icon_size"
                        android:src="@drawable/ic_send_light"
                        android:background="@drawable/send_arrow_background"
                        android:contentDescription="@string/sendButtonContentDescription"
                        android:visibility="gone" />
                </FrameLayout>

                <TextView
                    android:id="@+id/mms_indicator"
                    style="@style/MmsIndicatorStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:singleLine="true"
                    android:maxLines="1"
                    android:visibility="invisible"
                    android:text="@string/mms_text" />
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <FrameLayout
        android:id="@+id/mediapicker_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0" />

</com.android.messaging.ui.conversation.ComposeMessageView>