<!--
  ~ 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:fillViewport="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <!-- Top Panel -->
            <FrameLayout
                android:paddingLeft="?dialogPreferredPadding"
                android:paddingRight="?dialogPreferredPadding"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/topPanel"
                android:minHeight="@dimen/dialog_list_padding_top_no_title">
                <include android:id="@+id/title_template"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         layout="@layout/alert_dialog_title_material"/>
            </FrameLayout>

            <!-- Content Panel -->
            <FrameLayout android:id="@+id/contentPanel"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:clipToPadding="false">
                <TextView android:id="@+id/message"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:gravity="center_horizontal|top"
                          android:textAppearance="@style/TextAppearance.DeviceDefault.Body1"
                          android:paddingStart="?dialogPreferredPadding"
                          android:paddingEnd="?dialogPreferredPadding"
                          android:paddingTop="8dip"
                          android:paddingBottom="8dip"/>
            </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:minHeight="@dimen/dialog_list_padding_bottom_no_buttons"
                android:layout_weight="1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center">
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:orientation="horizontal"
                    android:paddingBottom="?dialogPreferredPadding"
                    style="?android:attr/buttonBarStyle"
                    android:measureWithLargestChild="true">
                    <Button android:id="@+id/button2"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:gravity="center"
                            android:layout_weight="1"
                            style="@style/Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3.Negative" />
                    <Button android:id="@+id/button3"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:gravity="center"
                            android:layout_weight="1"
                            style="?android:attr/buttonBarButtonStyle"/>
                    <FrameLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">
                        <Button android:id="@+id/button1"
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:layout_gravity="center"
                                android:gravity="center"
                                android:layout_weight="1"
                                style="@style/Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3.Confirm" />
                        <!-- This works as background. -->
                        <ImageView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:src="@drawable/dialog_alert_button_positive_watch"/>
                    </FrameLayout>
                </LinearLayout>
            </FrameLayout>
        </LinearLayout>
    </ScrollView>
</com.android.internal.widget.WatchListDecorLayout>
