1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2017 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<!-- NOTE: outer layout is required to provide proper shadow. -->
18<LinearLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    android:layout_width="fill_parent"
21    android:layout_height="wrap_content"
22    android:background="@drawable/autofill_bottomsheet_background"
23    android:orientation="vertical">
24
25    <com.android.server.autofill.ui.BottomSheetLayout
26        android:id="@+id/autofill_save"
27        android:layout_width="fill_parent"
28        android:layout_height="wrap_content"
29        android:layout_marginTop="@dimen/autofill_save_outer_margin"
30        android:background="?android:attr/colorSurface"
31        android:gravity="center_horizontal"
32        android:orientation="vertical">
33        <ScrollView
34            android:layout_width="fill_parent"
35            android:layout_height="0dp"
36            android:fillViewport="true"
37            android:layout_weight="1"
38            android:layout_marginBottom="8dp">
39            <LinearLayout
40                android:layout_marginStart="@dimen/autofill_save_outer_margin"
41                android:layout_marginEnd="@dimen/autofill_save_outer_margin"
42                android:layout_width="fill_parent"
43                android:orientation="vertical"
44                android:layout_height="wrap_content"
45                >
46                <ImageView
47                    android:id="@+id/autofill_save_icon"
48                    android:scaleType="fitCenter"
49                    android:layout_gravity="center"
50                    android:layout_height="@dimen/autofill_save_icon_max_height"
51                    android:layout_width="fill_parent"/>
52
53                <TextView
54                    android:id="@+id/autofill_save_title"
55                    android:layout_width="fill_parent"
56                    android:layout_height="wrap_content"
57                    android:text="@string/autofill_save_title"
58                    android:layout_marginTop="16dp"
59                    android:paddingBottom="24dp"
60                    android:gravity="center"
61                    android:textAppearance="@style/AutofillSaveUiTitle">
62                </TextView>
63                <FrameLayout
64                    android:id="@+id/autofill_save_custom_subtitle"
65                    android:layout_width="match_parent"
66                    android:layout_height="wrap_content"
67                    android:minHeight="0dp"
68                    android:visibility="gone"/>
69
70            </LinearLayout>
71        </ScrollView>
72
73        <com.android.internal.widget.ButtonBarLayout
74            android:layout_width="match_parent"
75            android:layout_height="48dp"
76            android:layout_gravity="end"
77            android:clipToPadding="false"
78            android:layout_marginTop="16dp"
79            android:layout_marginBottom="8dp"
80            android:theme="@style/Theme.DeviceDefault.AutofillHalfScreenDialogButton"
81            android:orientation="horizontal"
82            android:gravity="center_vertical"
83            android:layout_marginStart="@dimen/autofill_save_outer_margin"
84            android:layout_marginEnd="@dimen/autofill_save_outer_margin"
85            >
86            <Button
87                android:id="@+id/autofill_save_no"
88                android:layout_width="wrap_content"
89                android:layout_height="40dp"
90                android:paddingStart="12dp"
91                android:paddingEnd="12dp"
92                android:paddingTop="0dp"
93                android:paddingBottom="0dp"
94                android:minWidth="0dp"
95                style="?android:attr/borderlessButtonStyle"
96                android:text="@string/autofill_save_no">
97            </Button>
98
99            <Space
100                android:layout_width="0dp"
101                android:layout_height="0dp"
102                android:layout_weight="1"
103                android:visibility="invisible">
104            </Space>
105
106            <Button
107                android:id="@+id/autofill_save_yes"
108                android:layout_width="wrap_content"
109                android:layout_height="40dp"
110                android:minWidth="0dp"
111                style="@style/AutofillHalfSheetTonalButton"
112                android:text="@string/autofill_save_yes">
113            </Button>
114
115        </com.android.internal.widget.ButtonBarLayout>
116
117    </com.android.server.autofill.ui.BottomSheetLayout>
118</LinearLayout>