<!--
  ~ Copyright (C) 2024 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.
  -->

<!-- This layout is the AlertDialog template. It overrides the system layout with the same name.
    Make sure to include all the existing id of the overridden alert_dialog_material.-->
<com.android.internal.widget.WatchListDecorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/parentPanel"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

        <requestFocus />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_marginStart="@dimen/alertDialog_material_side_margin"
            android:layout_marginEnd="@dimen/alertDialog_material_side_margin"
            android:gravity="center_vertical">

            <!-- Top Spacer -->
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/alertDialog_material_top_margin" />

            <!-- Top Panel -->
            <FrameLayout
                android:id="@+id/topPanel"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/dialog_list_padding_top_no_title">

                <include
                    android:id="@+id/title_template"
                    layout="@layout/alert_dialog_title_watch"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </FrameLayout>

            <!-- Content Panel -->
            <FrameLayout
                android:id="@+id/contentPanel"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingTop="12dp">

                <TextView
                    android:id="@+id/message"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/alertDialog_material_side_margin_body"
                    android:layout_marginEnd="@dimen/alertDialog_material_side_margin_body"
                    android:textAppearance="@style/TextAppearance.AlertDialog.Body1"
                    android:gravity="center_horizontal|top" />
            </FrameLayout>

            <!-- Custom Panel, to replace content panel if needed -->
            <FrameLayout
                android:id="@+id/customPanel"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:minHeight="64dp">

                <FrameLayout
                    android:id="@+android:id/custom"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </FrameLayout>

            <!-- Button Panel -->
            <FrameLayout
                android:id="@+id/buttonPanel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:minHeight="@dimen/dialog_list_padding_bottom_no_buttons">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:layout_gravity="bottom"
                    android:orientation="vertical">
                    <!-- Positive Button -->
                    <Button
                        android:id="@+id/button1"
                        style="@*android:style/Widget.Material3.Button.Filled"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_gravity="center"
                        android:gravity="center" />
                    <!--Neutral Button -->
                    <Button
                        android:id="@+id/button3"
                        style="@*android:style/Widget.Material3.Button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:gravity="center" />
                    <!-- Negative Button -->
                    <Button
                        android:id="@+id/button2"
                        style="@*android:style/Widget.Material3.Button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="4dp"
                        android:layout_gravity="center"
                        android:gravity="center" />
                </LinearLayout>
            </FrameLayout>

            <!-- Bottom Spacer -->
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/alertDialog_material_bottom_margin" />

        </LinearLayout>
    </ScrollView>
</com.android.internal.widget.WatchListDecorLayout>
