Fix pulsante in dialogScanArt.

Aggiunta where cond su ricerca pedane versate su linea.
Aggiunta emptyView in recupera ul.
This commit is contained in:
Giuseppe Scorrano 2019-12-23 11:44:39 +01:00
parent bcb4766df3
commit 00afb7db53
7 changed files with 137 additions and 73 deletions

View File

@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale.core;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.databinding.DataBindingUtil; import androidx.databinding.DataBindingUtil;
@ -27,6 +28,7 @@ public class HistoryULsListAdapter extends SectionedRecyclerViewAdapter<HistoryU
private List<HistoryVersamentoProdUL> mOriginalDataset; private List<HistoryVersamentoProdUL> mOriginalDataset;
private List<HistoryVersamentoProdUL> mDataset; private List<HistoryVersamentoProdUL> mDataset;
private View mEmptyView;
private RunnableArgs<HistoryVersamentoProdUL> mOnItemClicked; private RunnableArgs<HistoryVersamentoProdUL> mOnItemClicked;
@ -54,9 +56,10 @@ public class HistoryULsListAdapter extends SectionedRecyclerViewAdapter<HistoryU
public HistoryULsListAdapter(Context context, List<HistoryVersamentoProdUL> myDataset) { public HistoryULsListAdapter(Context context, List<HistoryVersamentoProdUL> myDataset, View emptyView) {
mContext = context; mContext = context;
mOriginalDataset = myDataset; mOriginalDataset = myDataset;
mEmptyView = emptyView;
mDataset = orderItems(myDataset); mDataset = orderItems(myDataset);
} }
@ -68,6 +71,8 @@ public class HistoryULsListAdapter extends SectionedRecyclerViewAdapter<HistoryU
mDataset.clear(); mDataset.clear();
mDataset.addAll(orderItems(updatedDataset)); mDataset.addAll(orderItems(updatedDataset));
notifyDataChanged(); notifyDataChanged();
mEmptyView.setVisibility(mDataset.size() > 0 ? View.GONE : View.VISIBLE);
} }

View File

@ -61,6 +61,7 @@ public class ProdRecuperoMaterialeHelper {
"LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " + "LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
"WHERE jtb_fasi.cod_jfas IS NOT NULL " + "WHERE jtb_fasi.cod_jfas IS NOT NULL " +
"AND segno = -1 " + "AND segno = -1 " +
"AND mtb_colr.data_collo > DATEADD(DAY, -1, GETDATE()) " +
"GROUP BY jtb_fasi.cod_jfas, " + "GROUP BY jtb_fasi.cod_jfas, " +
"jtb_fasi.descrizione, " + "jtb_fasi.descrizione, " +
"mtb_colr.gestione, " + "mtb_colr.gestione, " +

View File

@ -87,7 +87,7 @@ public class ProdRecuperoMaterialeViewModel {
private void initRecyclerView() { private void initRecyclerView() {
mAdapter = new HistoryULsListAdapter(mContext, new ArrayList<>()); mAdapter = new HistoryULsListAdapter(mContext, new ArrayList<>(), mBinding.emptyView);
mAdapter.setOnItemClicked(data -> this.dispatchItem(data, null, null)); mAdapter.setOnItemClicked(data -> this.dispatchItem(data, null, null));
mBinding.prodRecuperoMaterialeMainList.setLayoutManager(new LinearLayoutManager(mContext)); mBinding.prodRecuperoMaterialeMainList.setLayoutManager(new LinearLayoutManager(mContext));

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
<layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/base_root" android:id="@+id/base_root"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -17,49 +17,54 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/title_container" android:id="@+id/title_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/light_blue_300"
android:gravity="center_horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/title_icon"
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:padding="24dp">
<TextView
android:id="@+id/title_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/TextViewMaterial.DialogTitle" android:background="@color/light_blue_300"
android:text="@string/title_open_lu" android:gravity="center_horizontal">
android:gravity="center_horizontal"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/title_icon"
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:paddingBottom="16dp"
android:paddingStart="8dp"
android:paddingEnd="8dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:layout_marginTop="16dp"> android:paddingStart="16dp"
android:paddingEnd="16dp">
<TextView
android:id="@+id/title_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextViewMaterial.DialogTitle"
android:text="@string/title_open_lu"
android:gravity="center_horizontal"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:weightSum="10"> android:layout_marginTop="16dp">
<ProgressBar <ProgressBar
@ -81,63 +86,63 @@
</LinearLayout> </LinearLayout>
<LinearLayout
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/dialog_scan_or_create_lu__creation_layout" android:id="@+id/dialog_scan_or_create_lu__creation_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:layout_marginTop="8dp">
<androidx.appcompat.widget.AppCompatTextView
<LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:orientation="vertical"
android:layout_marginTop="12dp" app:layout_constraintStart_toStartOf="parent"
android:layout_marginBottom="12dp" app:layout_constraintEnd_toEndOf="parent"
android:textSize="16sp" app:layout_constraintTop_toTopOf="parent">
android:textStyle="bold"
android:layout_gravity="center_horizontal"
style="@style/TextViewMaterial"
android:text="OPPURE" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/ok_left_buttons_guideline" android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:gravity="center_horizontal"
app:layout_constraintGuide_percent="0.15"/> android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
<androidx.constraintlayout.widget.Guideline android:textSize="16sp"
android:id="@+id/ok_right_buttons_guideline" android:textStyle="bold"
android:layout_width="0dp" android:layout_gravity="center_horizontal"
android:layout_height="wrap_content" style="@style/TextViewMaterial"
android:orientation="vertical" android:text="OPPURE" />
app:layout_constraintGuide_percent="0.85"/>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/create_new_lu_button" android:id="@+id/create_new_lu_button"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/Button.PrimaryFull" style="@style/Button.PrimaryFull"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/ok_left_buttons_guideline"
app:layout_constraintEnd_toEndOf="@id/ok_right_buttons_guideline"
android:text="@string/button_create_new_ul"/> android:text="@string/button_create_new_ul"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</layout> </layout>

View File

@ -3,9 +3,11 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/apk/res-auto"> xmlns:fab="http://schemas.android.com/apk/res-auto">
<data> <data>
</data> </data>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -13,14 +15,63 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:background="@color/gray_200" android:background="@android:color/white"
android:id="@+id/prod_recupero_materiale_main_list" android:id="@+id/prod_recupero_materiale_main_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/empty_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.3">
</androidx.recyclerview.widget.RecyclerView> <androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_empty_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.2" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_empty_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.15" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_empty_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.85" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="72dp"
android:layout_height="wrap_content"
android:src="@drawable/ic_playlist_add_check_24dp"
android:adjustViewBounds="true"/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textColor="@android:color/black"
android:textSize="18sp"
android:text="@string/no_item_in_recupera_materiale"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout> </RelativeLayout>

View File

@ -165,6 +165,7 @@
<string name="no_docs_to_show_text">Nessun documento da mostrare</string> <string name="no_docs_to_show_text">Nessun documento da mostrare</string>
<string name="no_orders_to_pick_text">Nessun ordine da evadere</string> <string name="no_orders_to_pick_text">Nessun ordine da evadere</string>
<string name="no_item_text">Nessun articolo</string> <string name="no_item_text">Nessun articolo</string>
<string name="no_item_in_recupera_materiale">Nessuna UL versata in produzione</string>
<string name="already_used_anonymous_barcode"><![CDATA[L\'etichetta scansionata è stata già utilizzata]]></string> <string name="already_used_anonymous_barcode"><![CDATA[L\'etichetta scansionata è stata già utilizzata]]></string>
<string name="no_result_from_barcode">Il barcode scansionato non ha fornito alcun risultato</string> <string name="no_result_from_barcode">Il barcode scansionato non ha fornito alcun risultato</string>

View File

@ -166,6 +166,7 @@
<string name="no_docs_to_show_text">No documents to show</string> <string name="no_docs_to_show_text">No documents to show</string>
<string name="no_orders_to_pick_text">No orders to dispatch</string> <string name="no_orders_to_pick_text">No orders to dispatch</string>
<string name="no_item_text">No items</string> <string name="no_item_text">No items</string>
<string name="no_item_in_recupera_materiale">No LU poured into production</string>
<string name="already_used_anonymous_barcode">The scanned label has already been used</string> <string name="already_used_anonymous_barcode">The scanned label has already been used</string>
<string name="no_result_from_barcode">The scanned barcode did not produce any results</string> <string name="no_result_from_barcode">The scanned barcode did not produce any results</string>