<?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>
        <import type="android.text.Html" />
        <import type="it.integry.integrywmsnative.R" />
        <import type="it.integry.integrywmsnative.core.utility.UtilityString" />
        <import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
        <variable
            name="mContext"
            type="android.content.Context" />

        <variable
            name="viewModel"
            type="it.integry.integrywmsnative.view.dialogs.input_quantity_to_return.DialogInputQuantityToReturnViewModel" />
    </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="16dp"
            app:cardElevation="0dp">


            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingHorizontal="16dp"
                android:paddingVertical="16dp">

                <androidx.appcompat.widget.AppCompatImageView
                    style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
                    android:layout_width="36dp"
                    android:layout_height="36dp"
                    android:src="@drawable/ic_error_white_24dp"
                    app:tint="?colorPrimary" />


                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/title_text"
                    style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_horizontal"
                    android:layout_marginBottom="16dp"
                    android:text="@string/action_insert_quantity" />


                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/TextViewMaterial"
                    tools:text="descrizione estesa articolo"
                    android:text="@{UtilityString.isNullOrEmpty(viewModel.mtbAart.descrizioneEstesa) ? viewModel.mtbAart.descrizione : viewModel.mtbAart.descrizioneEstesa}"
                    android:gravity="center" />

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_horizontal">


                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/TextViewMaterial"
                        android:text="max:"
                        android:gravity="center" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="4dp"
                        style="@style/TextViewMaterial"
                        tools:text="50.00"
                        android:text="@{UtilityNumber.decimalToString(viewModel.maxQuantity)}"
                        android:gravity="center" />

                </androidx.appcompat.widget.LinearLayoutCompat>


                <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.20"/>

                    <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.80"/>

                    <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/additional_notes_text"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:hint="@string/quantity"
                            android:inputType="numberDecimal"
                            android:selectAllOnFocus="true"
                            app:binding="@{viewModel.inputQuantity}"
                            style="@style/TextInputEditText.OutlinePrimary"/>

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

            </androidx.appcompat.widget.LinearLayoutCompat>
        </androidx.cardview.widget.CardView>


</layout>