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

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    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.DialogAskAction" />
    </data>

    <androidx.cardview.widget.CardView
        android:id="@+id/base_root"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:orientation="vertical"
        app:cardCornerRadius="12dp"
        app:cardElevation="0dp">


        <LinearLayout
            android:id="@+id/bottom_sheet_actions"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#fff"
            android:orientation="vertical"
            android:padding="16dp"
            app:behavior_hideable="true"
            app:behavior_peekHeight="0dp"
            app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

            <RelativeLayout
                android:id="@+id/dialog_actions"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                >

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/dialog_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:ellipsize="end"
                    android:text="@string/choose_action"
                    android:paddingTop="6dp"
                    android:paddingBottom="6dp"
                    android:gravity="center"
                    android:textColor="@android:color/primary_text_light"
                    android:textSize="18sp"
                    android:textStyle="bold"/>

            </RelativeLayout>
            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="center_vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/bottom_sheet_actions_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:paddingEnd="8dp"
                        android:paddingStart="0dp"
                        android:textColor="#444"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        tools:text="Title" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/bottom_sheet_actions_subtitle"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="14sp"
                        android:textStyle="bold"
                        tools:text="subtitle" />

                </LinearLayout>

            </androidx.constraintlayout.widget.ConstraintLayout>

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


                <androidx.constraintlayout.widget.Guideline
                    android:id="@+id/guideline_action"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    app:layout_constraintGuide_percent="0.50" />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:orientation="vertical"
                    app:layout_constraintEnd_toStartOf="@id/guideline_action"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/bottom_sheet_actions_edit_btn"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="@android:color/white"
                        android:padding="16dp"
                        android:scaleX="1.5"
                        android:scaleY="1.5"
                        android:src="@drawable/ic_edit_24dp"
                        android:onClick="@{()->viewmodel.onEdit()}"
                        android:tint="@color/green_600" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/edit" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:orientation="vertical"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="@id/guideline_action"
                    app:layout_constraintTop_toTopOf="parent">

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/bottom_sheet_actions_delete_btn"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="@android:color/white"
                        android:padding="16dp"
                        android:scaleX="1.5"
                        android:scaleY="1.5"
                        android:src="@drawable/ic_delete_24dp"
                        android:onClick="@{()->viewmodel.onDelete()}"
                        android:tint="@color/red_600" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/delete" />

                </LinearLayout>

            </androidx.constraintlayout.widget.ConstraintLayout>


        </LinearLayout>

    </androidx.cardview.widget.CardView>

</layout>