<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">
    <data>
        <variable
            name="viewmodel"
            type="it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputViewModel" />
    </data>

    <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:cardCornerRadius="12dp"
        app:cardElevation="0dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/light_blue_300"
                android:gravity="center_horizontal">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_error_white_24dp"
                    android:layout_margin="24dp"/>

            </RelativeLayout>



            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingTop="24dp"
                android:paddingLeft="24dp"
                android:paddingRight="24dp">

                <TextView
                    android:id="@+id/title_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/TextViewMaterial.DialogTitle"
                    tools:text="Insert here"
                    android:gravity="center_horizontal"/>


                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp">


                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">

                        <androidx.constraintlayout.widget.Guideline
                            android:id="@+id/guide_left"
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:orientation="vertical"
                            app:layout_constraintGuide_percent="0.10"/>
                        <androidx.constraintlayout.widget.Guideline
                            android:id="@+id/guide_right"
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:orientation="vertical"
                            app:layout_constraintGuide_percent="0.90"/>

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/level_number_layout"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            app:layout_constraintTop_toTopOf="parent"
                            app:layout_constraintStart_toStartOf="@id/guide_left"
                            app:layout_constraintEnd_toStartOf="@id/guide_right"
                            android:layout_marginBottom="16dp"
                            style="@style/TextInputLayout.OutlinePrimary">

                            <com.google.android.material.textfield.TextInputEditText
                                android:id="@+id/general_input"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                tools:hint="input here"
                                style="@style/TextInputEditText.OutlinePrimary"/>

                        </com.google.android.material.textfield.TextInputLayout>
                    </androidx.constraintlayout.widget.ConstraintLayout>


                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="horizontal"
                        android:paddingTop="12dp"
                        android:paddingBottom="8dp"
                        android:gravity="bottom|center_horizontal">


                        <com.google.android.material.button.MaterialButton
                            android:id="@+id/button_abort"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/Button.PrimaryOutline"
                            app:icon="@drawable/ic_clear_24dp"
                            android:onClick="@{() -> viewmodel.onNegativeClick()}"
                            app:strokeColor="@color/colorPrimary"
                            android:layout_marginEnd="8dp"
                            android:text="@string/abort"/>


                        <com.google.android.material.button.MaterialButton
                            android:id="@+id/button_confirm"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/Button.PrimaryFull"
                            app:icon="@drawable/ic_save_24dp"
                            android:onClick="@{() -> viewmodel.onPositiveClick()}"
                            android:text="@string/confirm"/>
                    </LinearLayout>

                </LinearLayout>

            </LinearLayout>


        </LinearLayout>


    </androidx.cardview.widget.CardView>

</layout>