• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2020 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.internal.widget.ConversationLayout
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    android:id="@+id/status_bar_latest_event_content"
20    android:layout_width="match_parent"
21    android:layout_height="wrap_content"
22    android:clipChildren="false"
23    android:tag="conversation"
24    android:theme="@style/Theme.DeviceDefault.Notification"
25    >
26
27    <include layout="@layout/notification_template_conversation_icon_container" />
28
29    <!-- Wraps entire "expandable" notification -->
30    <com.android.internal.widget.RemeasuringLinearLayout
31        android:layout_width="match_parent"
32        android:layout_height="wrap_content"
33        android:layout_gravity="top"
34        android:clipToPadding="false"
35        android:clipChildren="false"
36        android:orientation="vertical"
37        >
38        <!-- LinearLayout for Expand Button-->
39        <com.android.internal.widget.RemeasuringLinearLayout
40            android:id="@+id/expand_button_and_content_container"
41            android:layout_width="match_parent"
42            android:layout_height="wrap_content"
43            android:layout_weight="1"
44            android:gravity="start|top"
45            android:orientation="horizontal"
46            android:clipChildren="false"
47            android:clipToPadding="false">
48            <!--TODO: move this into a separate layout and share logic with the header to bring back app opps etc-->
49            <com.android.internal.widget.RemeasuringLinearLayout
50                android:id="@+id/notification_action_list_margin_target"
51                android:layout_width="0dp"
52                android:orientation="vertical"
53                android:layout_height="wrap_content"
54                android:layout_weight="1">
55
56                <!-- Header -->
57
58                <!-- Use layout_marginStart instead of paddingStart to work around strange
59                     measurement behavior on lower display densities. -->
60                <include
61                    layout="@layout/notification_template_conversation_header"
62                    android:layout_width="wrap_content"
63                    android:layout_height="wrap_content"
64                    android:layout_marginBottom="2dp"
65                    android:layout_marginStart="@dimen/conversation_content_start"
66                    />
67
68                <!-- Messages -->
69                <com.android.internal.widget.MessagingLinearLayout
70                    android:id="@+id/notification_messaging"
71                    android:layout_width="match_parent"
72                    android:layout_height="wrap_content"
73                    android:minHeight="@dimen/notification_text_size"
74                    android:spacing="@dimen/notification_messaging_spacing"
75                    android:clipToPadding="false"
76                    android:clipChildren="false"
77                    />
78            </com.android.internal.widget.RemeasuringLinearLayout>
79
80            <!-- This is where the expand button container will be placed when collapsed-->
81        </com.android.internal.widget.RemeasuringLinearLayout>
82
83        <include layout="@layout/notification_template_smart_reply_container"
84            android:layout_width="match_parent"
85            android:layout_height="wrap_content"
86            android:layout_marginTop="@dimen/notification_content_margin"
87            android:layout_marginStart="@dimen/conversation_content_start"
88            android:layout_marginEnd="@dimen/notification_content_margin_end" />
89        <include layout="@layout/notification_material_action_list" />
90    </com.android.internal.widget.RemeasuringLinearLayout>
91
92    <!--expand_button_a11y_container ensures talkback focus order is correct when view is expanded.
93    The -1px of marginTop and 1px of paddingTop make sure expand_button_a11y_container is prior to
94    its sibling view in accessibility focus order.
95    {see android.view.ViewGroup.addChildrenForAccessibility()}
96    expand_button_container will be moved under expand_button_and_content_container when collapsed,
97    this dynamic movement ensures message can flow under expand button when expanded-->
98    <FrameLayout
99        android:id="@+id/expand_button_a11y_container"
100        android:layout_width="match_parent"
101        android:layout_height="match_parent"
102        android:layout_gravity="end|top"
103        android:clipChildren="false"
104        android:clipToPadding="false"
105        android:layout_marginTop="-1px"
106        android:paddingTop="1px"
107        >
108        <!--expand_button_container is dynamically placed between here and at the end of the
109        layout. It starts here since only FrameLayout layout params have gravity-->
110        <FrameLayout
111            android:id="@+id/expand_button_container"
112            android:layout_width="wrap_content"
113            android:layout_height="match_parent"
114            android:layout_gravity="end|top"
115            android:clipChildren="false"
116            android:clipToPadding="false">
117            <!--expand_button_touch_container makes sure that we can nicely center the expand
118            content in the collapsed layout while the parent makes sure that we're never laid out
119            bigger than the messaging content.-->
120            <LinearLayout
121                android:id="@+id/expand_button_touch_container"
122                android:layout_width="wrap_content"
123                android:layout_height="@dimen/conversation_expand_button_height"
124                android:orientation="horizontal"
125                android:layout_gravity="end|top"
126                android:paddingEnd="0dp"
127                android:clipToPadding="false"
128                android:clipChildren="false"
129                >
130                <!-- Images -->
131                <com.android.internal.widget.MessagingLinearLayout
132                    android:id="@+id/conversation_image_message_container"
133                    android:forceHasOverlappingRendering="false"
134                    android:layout_width="40dp"
135                    android:layout_height="40dp"
136                    android:layout_marginStart="@dimen/conversation_image_start_margin"
137                    android:spacing="0dp"
138                    android:layout_gravity="center"
139                    android:clipToPadding="false"
140                    android:clipChildren="false"
141                    />
142                <include layout="@layout/notification_expand_button"
143                    android:layout_width="wrap_content"
144                    android:layout_height="wrap_content"
145                    android:layout_gravity="center"
146                    />
147            </LinearLayout>
148        </FrameLayout>
149    </FrameLayout>
150</com.android.internal.widget.ConversationLayout>
151