<?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>

        <import type="android.view.View" />

        <import type="it.integry.integrywmsnative.R" />

        <import type="androidx.core.content.ContextCompat" />

        <import type="it.integry.integrywmsnative.core.utility.UtilityString" />


        <variable
            name="viewModel"
            type="it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaViewModel" />

        <variable
            name="view"
            type="it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaActivity" />
    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/gray_detail_background_round8">


        <androidx.appcompat.widget.LinearLayoutCompat
            android:id="@+id/header_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">


            <it.integry.integrywmsnative.ui.ElevatedToolbar
                android:id="@+id/elevated_toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?actionBarSize">


                </androidx.appcompat.widget.Toolbar>

            </it.integry.integrywmsnative.ui.ElevatedToolbar>

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

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:background="@color/white"
                android:padding="16dp">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="@style/TextAppearance.AppCompat.Headline"
                        android:text="@{view.lineaLabel}"
                        tools:text="L2 - Linea 2"

                        />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/add_extra_items_toolbar"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        android:adjustViewBounds="true"
                        android:background="?attr/selectableItemBackground"
                        android:onClick="@{()->viewModel.settings()}"
                        android:padding="6dp"
                        android:src="@drawable/ic_settings_24dp"
                        android:tint="@color/colorPrimaryGray" />


                </RelativeLayout>


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

                    <androidx.appcompat.widget.AppCompatImageView
                        android:id="@+id/image"
                        android:layout_width="18dp"
                        android:layout_height="18dp"
                        android:layout_gravity="center_horizontal"
                        android:src="@{ContextCompat.getDrawable(context, view.isStarted.get() ? R.drawable.ic_baseline_play_arrow_24 : view.isPaused.get() ? R.drawable.ic_baseline_pause_24 : R.drawable.ic_baseline_stop_24)}"
                        app:tint="@{ContextCompat.getColor(context, view.isStarted.get() ? R.color.green_600 : view.isPaused.get() ? R.color.orange_600 : R.color.red_600)}"
                        tools:tint="@color/green_600"
                        tools:src="@drawable/ic_baseline_play_arrow_24" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/peso_lordo_collo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        app:text="@{view.isStarted.get() ? R.string.in_progress : view.isPaused.get() ? R.string.stand_by : R.string.stopped}"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Small"
                        app:textColor="@{ContextCompat.getColor(context, view.isStarted.get() ? R.color.green_600 : view.isPaused.get() ? R.color.orange_600 : R.color.red_600)}"
                        tools:textColor="@color/green_600"
                        android:textStyle="bold"
                        tools:text="In lavorazione" />
                </androidx.appcompat.widget.LinearLayoutCompat>

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:visibility="@{view.isStarted}"
                    android:layout_marginTop="16dp">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/risorse_impostate"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        tools:text="Risorse assegnate" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        app:text="@{view.hrNum}"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        android:textStyle="bold"
                        tools:text="25" />


                </RelativeLayout>


            </androidx.appcompat.widget.LinearLayoutCompat>


            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/white"
                android:orientation="vertical"
                app:visibility="@{view.flagShowProdInfo}"
                android:layout_marginTop="16dp"
                android:padding="16dp">


                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/production_in_progress"
                    tools:text="Lavorazione in corso"
                    android:textAppearance="@style/AppTheme.NewMaterial.Text.TextBoxGroupTitleDashboard" />

                <com.google.android.material.divider.MaterialDivider
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp" />

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/article"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        tools:text="Articolo" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        app:text="@{view.codMart}"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        android:textStyle="bold"
                        tools:text="150150-09" />


                </RelativeLayout>


                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/batch_lot"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        tools:text="Lotto" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        app:text="@{view.partitaMag}"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        android:textStyle="bold"
                        tools:text="20220530" />


                </RelativeLayout>

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

                    >

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/label_descrizione"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/description"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        tools:text="Descrizione" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        android:gravity="end"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        android:textStyle="bold"
                        android:layout_marginStart="8dp"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@id/label_descrizione"
                        app:layout_constraintTop_toTopOf="parent"
                        app:text="@{view.productDescription}"
                        tools:text="UVA VITTORIA IN CASSE " />


                </androidx.constraintlayout.widget.ConstraintLayout>


                <com.google.android.material.divider.MaterialDivider
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/orders_in_progress"
                    tools:text="Ordini in lavorazione"
                    android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium" />

                <HorizontalScrollView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content">

                    <com.google.android.material.chip.ChipGroup
                        android:id="@+id/orders_list"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">


                    </com.google.android.material.chip.ChipGroup>
                </HorizontalScrollView>

            </androidx.appcompat.widget.LinearLayoutCompat>

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:padding="16dp"
                android:background="@color/white"
                android:orientation="vertical">


                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/versamento_merce_fragment_title"
                    android:textAppearance="@style/AppTheme.NewMaterial.Text.TextBoxGroupTitleDashboard" />

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/scan_art_spinner"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="24dp"
                    android:orientation="horizontal"
                    android:visibility="visible"
                    app:layout_constraintTop_toBottomOf="@id/header_content"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent">


                    <ProgressBar
                        android:id="@+id/progressBar"
                        style="?android:attr/progressBarStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />

                    <androidx.appcompat.widget.AppCompatTextView
                        style="@style/AppTheme.NewMaterial.Text"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="8dp"
                        android:layout_marginEnd="12dp"
                        android:gravity="center_horizontal"
                        android:text="@string/scan_lu_to_deposit"
                        android:textSize="16sp" />
                </androidx.appcompat.widget.LinearLayoutCompat>
            </androidx.appcompat.widget.LinearLayoutCompat>


        </androidx.appcompat.widget.LinearLayoutCompat>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

</layout>