Implementata empty view su ultimi arrivi e ultime consegne
This commit is contained in:
parent
b25c94f38d
commit
88f00fa195
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
@ -56,13 +57,6 @@ public class UltimeConsegneClienteViewModel {
|
||||
}).show();
|
||||
}
|
||||
|
||||
|
||||
public void refreshItems(List<DocumentoResoDTO> items){
|
||||
mRenderedItems.clear();
|
||||
mRenderedItems.addAll(items);
|
||||
mAdapter.updateItems(mRenderedItems);
|
||||
}
|
||||
|
||||
private void initList() {
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
@ -75,7 +69,7 @@ public class UltimeConsegneClienteViewModel {
|
||||
this.mItems = consegne;
|
||||
|
||||
this.initDataAdapter(consegne);
|
||||
refreshRenderedOrdini(consegne);
|
||||
refreshItems(consegne);
|
||||
|
||||
progressDialog.dismiss();
|
||||
}, ex -> {
|
||||
@ -83,11 +77,6 @@ public class UltimeConsegneClienteViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshRenderedOrdini(List<DocumentoResoDTO> items) {
|
||||
mRenderedItems.clear();
|
||||
if(items != null) mRenderedItems.addAll(items);
|
||||
}
|
||||
|
||||
private void initDataAdapter(ArrayList<DocumentoResoDTO> dataset) {
|
||||
mAdapter = new UltimeConsegneMainListAdapter(mContext, dataset);
|
||||
mAdapter.setOnSelectionChanged(this::onSingleSelectionChanged);
|
||||
@ -99,6 +88,13 @@ public class UltimeConsegneClienteViewModel {
|
||||
|
||||
}
|
||||
|
||||
private void refreshItems(List<DocumentoResoDTO> items){
|
||||
mBinding.emptyView.setVisibility((items != null && items.size() > 0) ? View.GONE : View.VISIBLE);
|
||||
|
||||
mRenderedItems.clear();
|
||||
if(items != null) mRenderedItems.addAll(items);
|
||||
mAdapter.updateItems(mRenderedItems);
|
||||
}
|
||||
|
||||
private void onSingleSelectionChanged(DocumentoResoDTO dto) {
|
||||
List<DocumentoResoDTO> selectedOrders = getSelectedItems();
|
||||
|
||||
@ -125,7 +125,7 @@ public class UltimiArriviFornitoreFragment extends Fragment implements ITitledFr
|
||||
this.mItems = consegne;
|
||||
|
||||
this.initDataAdapter(consegne);
|
||||
refreshRenderedOrdini(consegne);
|
||||
refreshItems(consegne);
|
||||
|
||||
progressDialog.dismiss();
|
||||
}, ex -> {
|
||||
@ -134,10 +134,6 @@ public class UltimiArriviFornitoreFragment extends Fragment implements ITitledFr
|
||||
}
|
||||
|
||||
|
||||
private void refreshRenderedOrdini(List<DocumentoResoDTO> items) {
|
||||
mRenderedItems.clear();
|
||||
if(items != null) mRenderedItems.addAll(items);
|
||||
}
|
||||
|
||||
private void initDataAdapter(ArrayList<DocumentoResoDTO> dataset) {
|
||||
mAdapter = new UltimiArriviFornitoreListAdapter(getActivity(), dataset);
|
||||
@ -196,8 +192,10 @@ public class UltimiArriviFornitoreFragment extends Fragment implements ITitledFr
|
||||
|
||||
|
||||
private void refreshItems(List<DocumentoResoDTO> items){
|
||||
mBinding.emptyView.setVisibility((items != null && items.size() > 0) ? View.GONE : View.VISIBLE);
|
||||
|
||||
mRenderedItems.clear();
|
||||
mRenderedItems.addAll(items);
|
||||
if(items != null) mRenderedItems.addAll(items);
|
||||
mAdapter.updateItems(mRenderedItems);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,58 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3">
|
||||
|
||||
<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_docs_to_show_text"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@ -37,6 +37,59 @@
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3">
|
||||
|
||||
<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_docs_to_show_text"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@ -156,6 +156,7 @@
|
||||
|
||||
<string name="no_lu_already_registered_text">Nessuna UL registrata a magazzino</string>
|
||||
<string name="no_item_to_pick_text">Nessun articolo da prelevare</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_item_text">Nessun articolo</string>
|
||||
|
||||
|
||||
@ -157,6 +157,7 @@
|
||||
|
||||
<string name="no_lu_already_registered_text">No LU already registered</string>
|
||||
<string name="no_item_to_pick_text">No items to pick</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_item_text">No items</string>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user