1<!--
2  ~ Copyright (C) 2023 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<com.android.wm.shell.compatui.LetterboxEduDialogLayout
17    xmlns:android="http://schemas.android.com/apk/res/android"
18    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    style="@style/LetterboxDialog">
21
22    <!-- The background of the top-level layout acts as the background dim. -->
23
24    <!-- Vertical margin will be set dynamically since it depends on task bounds.
25         Setting the alpha of the dialog container to 0, since it shouldn't be visible until the
26         enter animation starts. -->
27    <FrameLayout
28        android:id="@+id/letterbox_education_dialog_container"
29        android:layout_width="0dp"
30        android:layout_height="wrap_content"
31        android:layout_marginHorizontal="@dimen/letterbox_education_dialog_margin"
32        android:background="@drawable/letterbox_education_dialog_background"
33        android:alpha="0"
34        app:layout_constraintTop_toTopOf="parent"
35        app:layout_constraintBottom_toBottomOf="parent"
36        app:layout_constraintStart_toStartOf="parent"
37        app:layout_constraintEnd_toEndOf="parent"
38        app:layout_constraintWidth_max="@dimen/letterbox_education_dialog_width"
39        app:layout_constrainedHeight="true">
40
41        <!-- The ScrollView should only wrap the content of the dialog, otherwise the background
42             corner radius will be cut off when scrolling to the top/bottom. -->
43        <ScrollView
44            android:layout_width="match_parent"
45            android:layout_height="wrap_content">
46
47            <LinearLayout
48                android:layout_width="match_parent"
49                android:layout_height="wrap_content"
50                android:gravity="center_horizontal"
51                android:orientation="vertical"
52                android:paddingTop="32dp"
53                android:paddingBottom="32dp"
54                android:paddingLeft="56dp"
55                android:paddingRight="56dp">
56
57                <ImageView
58                    android:layout_width="@dimen/letterbox_education_dialog_title_icon_width"
59                    android:layout_height="@dimen/letterbox_education_dialog_title_icon_height"
60                    android:layout_marginBottom="17dp"
61                    android:src="@drawable/letterbox_education_ic_light_bulb"/>
62
63                <TextView
64                    android:id="@+id/letterbox_education_dialog_title"
65                    android:layout_width="match_parent"
66                    android:layout_height="wrap_content"
67                    android:lineSpacingExtra="4sp"
68                    android:text="@string/letterbox_education_dialog_title"
69                    android:textAlignment="center"
70                    android:textColor="?android:attr/textColorPrimary"
71                    android:fontFamily="@*android:string/config_bodyFontFamilyMedium"
72                    android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Headline"
73                    android:textSize="24sp"/>
74
75                <LinearLayout
76                    android:layout_width="wrap_content"
77                    android:layout_height="wrap_content"
78                    android:gravity="top"
79                    android:orientation="horizontal"
80                    android:paddingTop="48dp">
81
82                    <com.android.wm.shell.compatui.LetterboxEduDialogActionLayout
83                        android:layout_width="wrap_content"
84                        android:layout_height="wrap_content"
85                        app:icon="@drawable/letterbox_education_ic_reposition"
86                        app:text="@string/letterbox_education_reposition_text"/>
87
88                    <com.android.wm.shell.compatui.LetterboxEduDialogActionLayout
89                        android:layout_width="wrap_content"
90                        android:layout_height="wrap_content"
91                        android:layout_marginStart=
92                            "@dimen/letterbox_education_dialog_space_between_actions"
93                        app:icon="@drawable/letterbox_education_ic_split_screen"
94                        app:text="@string/letterbox_education_split_screen_text"/>
95
96                </LinearLayout>
97
98                <Button
99                    android:fontFamily="@*android:string/config_bodyFontFamily"
100                    android:fontWeight="500"
101                    android:lineHeight="20dp"
102                    android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Small"
103                    android:id="@+id/letterbox_education_dialog_dismiss_button"
104                    android:textStyle="bold"
105                    android:layout_width="match_parent"
106                    android:layout_height="56dp"
107                    android:layout_marginTop="40dp"
108                    android:textSize="14sp"
109                    android:background=
110                        "@drawable/letterbox_education_dismiss_button_background_ripple"
111                    android:text="@string/letterbox_education_got_it"
112                    android:textColor="?android:attr/textColorPrimaryInverse"
113                    android:textAlignment="center"
114                    android:contentDescription="@string/letterbox_education_got_it"/>
115
116            </LinearLayout>
117
118        </ScrollView>
119
120    </FrameLayout>
121
122</com.android.wm.shell.compatui.LetterboxEduDialogLayout>
123