alert_dialog_material.xml revision d04675d507e158114a1884df94450afc486c9c96
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3     Copyright (C) 2014 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
18<LinearLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    android:id="@+id/parentPanel"
21    android:layout_width="match_parent"
22    android:layout_height="wrap_content"
23    android:orientation="vertical"
24    android:background="@drawable/dialog_background_material"
25    android:translationZ="@dimen/floating_window_z"
26    android:layout_marginLeft="@dimen/floating_window_margin_left"
27    android:layout_marginTop="@dimen/floating_window_margin_top"
28    android:layout_marginRight="@dimen/floating_window_margin_right"
29    android:layout_marginBottom="@dimen/floating_window_margin_bottom">
30
31    <LinearLayout android:id="@+id/topPanel"
32        android:layout_width="match_parent"
33        android:layout_height="wrap_content"
34        android:orientation="vertical">
35        <LinearLayout android:id="@+id/title_template"
36            android:layout_width="match_parent"
37            android:layout_height="wrap_content"
38            android:orientation="horizontal"
39            android:gravity="center_vertical|start"
40            android:paddingStart="16dip"
41            android:paddingEnd="16dip"
42            android:paddingTop="16dip"
43            android:paddingBottom="8dip">
44            <ImageView android:id="@+id/icon"
45                android:layout_width="32dip"
46                android:layout_height="32dip"
47                android:layout_marginEnd="8dip"
48                android:scaleType="fitCenter"
49                android:src="@null" />
50            <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
51                style="?attr/windowTitleStyle"
52                android:singleLine="true"
53                android:ellipsize="end"
54                android:layout_width="match_parent"
55                android:layout_height="wrap_content"
56                android:textAlignment="viewStart" />
57        </LinearLayout>
58        <!-- If the client uses a customTitle, it will be added here. -->
59    </LinearLayout>
60
61    <LinearLayout android:id="@+id/contentPanel"
62        android:layout_width="match_parent"
63        android:layout_height="wrap_content"
64        android:layout_weight="1"
65        android:orientation="vertical"
66        android:minHeight="64dp">
67        <ScrollView android:id="@+id/scrollView"
68            android:layout_width="match_parent"
69            android:layout_height="wrap_content"
70            android:clipToPadding="false">
71            <TextView android:id="@+id/message"
72                style="?attr/textAppearanceMedium"
73                android:layout_width="match_parent"
74                android:layout_height="wrap_content"
75                android:paddingStart="16dip"
76                android:paddingEnd="16dip"
77                android:paddingTop="16dip" />
78        </ScrollView>
79    </LinearLayout>
80
81    <FrameLayout android:id="@+id/customPanel"
82        android:layout_width="match_parent"
83        android:layout_height="wrap_content"
84        android:layout_weight="1"
85        android:minHeight="64dp">
86        <FrameLayout android:id="@+id/custom"
87            android:layout_width="match_parent"
88            android:layout_height="wrap_content" />
89    </FrameLayout>
90
91    <LinearLayout android:id="@+id/buttonPanel"
92        android:layout_width="match_parent"
93        android:layout_height="wrap_content"
94        android:minHeight="@dimen/alert_dialog_button_bar_height"
95        android:orientation="vertical"
96        android:gravity="end"
97        android:padding="16dip">
98        <LinearLayout
99            style="?attr/buttonBarStyle"
100            android:layout_width="match_parent"
101            android:layout_height="wrap_content"
102            android:layoutDirection="locale">
103            <Button android:id="@+id/button3"
104                style="?attr/buttonBarNeutralButtonStyle"
105                android:layout_width="wrap_content"
106                android:layout_height="wrap_content"
107                android:maxLines="2"
108                android:minHeight="@dimen/alert_dialog_button_bar_height" />
109            <Space
110                android:layout_width="0dp"
111                android:layout_height="0dp"
112                android:layout_weight="1"
113                android:visibility="invisible" />
114            <Button android:id="@+id/button2"
115                style="?attr/buttonBarNegativeButtonStyle"
116                android:layout_width="wrap_content"
117                android:layout_height="wrap_content"
118                android:maxLines="2"
119                android:minHeight="@dimen/alert_dialog_button_bar_height" />
120            <Button android:id="@+id/button1"
121                style="?attr/buttonBarPositiveButtonStyle"
122                android:layout_width="wrap_content"
123                android:layout_height="wrap_content"
124                android:maxLines="2"
125                android:minHeight="@dimen/alert_dialog_button_bar_height" />
126        </LinearLayout>
127     </LinearLayout>
128</LinearLayout>
129