Refactoring DialogSelectDocRows
This commit is contained in:
@@ -1,141 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView" />
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/base_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/buttons"
|
||||
android:layout_below="@id/title_container"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_item_to_pick_text"
|
||||
android:textColor="@color/empty_view_gray"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lista_doc_rows"
|
||||
android:layout_width="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/title_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/doc_interni_select_row_to_edit" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/center_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/negative_button"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/abort"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/positive_button"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:layout_constrainedHeight="true"
|
||||
android:enabled="@{view.selectedRow != null}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
43
app/src/main/res/layout/dialog_select_doc_rows.xml
Normal file
43
app/src/main/res/layout/dialog_select_doc_rows.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<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:paddingVertical="16dp">
|
||||
|
||||
|
||||
<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:layout_marginHorizontal="16dp"
|
||||
android:singleLine="false"
|
||||
android:maxLines="2"
|
||||
android:text="@string/doc_interni_select_row_to_edit" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/item_list"
|
||||
android:layout_width="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:layout_height="wrap_content"
|
||||
tools:listitem="@layout/dialog_select_doc_rows__item_model"
|
||||
tools:itemCount="5"/>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
@@ -1,55 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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="it.integry.integrywmsnative.R" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<variable
|
||||
name="row"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.dto.DialogChooseRowFromListaDocRowsListModel" />
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsItemListModel" />
|
||||
</data>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginVertical="2dp"
|
||||
android:background="@drawable/bg_checked_layout"
|
||||
app:backgroundTintResID="@{row.checked.get() ? R.color.bg_checked_layout : android.R.color.transparent}"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:onClick="@{() -> row.checked.toggle()}"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:onClick="@{() -> row.toggleCheck()}">
|
||||
app:backgroundTintResID="@{row.checked.get() ? R.color.bg_checked_layout : android.R.color.transparent}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
<androidx.appcompat.widget.AppCompatRadioButton
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp"
|
||||
android:clickable="false"
|
||||
app:checked="@{row.checked}" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/qta_box"
|
||||
android:layout_toEndOf="@id/checkbox"
|
||||
android:layout_toStartOf="@id/qta_box">
|
||||
android:layout_marginStart="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
@@ -58,11 +57,10 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/bottom_sheet_actions_delete_btn"
|
||||
android:id="@+id/icon_new"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@android:color/white"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:src="@drawable/ic_baseline_new_24"
|
||||
@@ -71,6 +69,7 @@
|
||||
android:visibility="@{row.isNew ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{row.codMart}"
|
||||
@@ -79,16 +78,18 @@
|
||||
android:textStyle="bold"
|
||||
tools:text="COD MART" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{row.barcode}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="0000000000000" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{row.barcode}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_below="@id/cod_mart_label"
|
||||
tools:text="0000000000000" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -105,33 +106,44 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/qta_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true">
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="6dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/qta_textview"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(row.qtaOrd)}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:text="@{row.qtaOrdReadable}"
|
||||
tools:text="280.45\nCONF" />
|
||||
tools:text="280.45" />
|
||||
|
||||
</RelativeLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@{row.untMisOrd}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
tools:text="CONF" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
Reference in New Issue
Block a user