Piccoli fix su doc interni
This commit is contained in:
parent
4ff39009d2
commit
66f117186c
@ -6,14 +6,11 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniViewModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||
|
||||
|
||||
@ -94,11 +91,11 @@ public class DialogSelectDocInfoViewModel {
|
||||
}
|
||||
|
||||
public List<String> getAvailableCodDtips() {
|
||||
return Stream.of(mDocInterniSetupDTO.getTipiDoc()).map(TipiDocDTO::getLabel).toList();
|
||||
return mDocInterniSetupDTO.getTipiDoc() != null ? Stream.of(mDocInterniSetupDTO.getTipiDoc()).map(TipiDocDTO::getLabel).toList() : new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<String> getAvailableCodMgrps() {
|
||||
return Stream.of(mDocInterniSetupDTO.getGruppiArt()).map(GruppiArticoloDTO::getLabel).toList();
|
||||
return mDocInterniSetupDTO.getGruppiArt() != null ? Stream.of(mDocInterniSetupDTO.getGruppiArt()).map(GruppiArticoloDTO::getLabel).toList() : new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<String> getAvailableFornitori() {
|
||||
|
||||
@ -138,6 +138,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
this.viewModel.setProductsList(productList);
|
||||
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.viewModel.docRows.observe(this, this::refreshList);
|
||||
DocumentRowsListAdapter listAdapter = new DocumentRowsListAdapter(this, documentRowsObservableList);
|
||||
@ -156,14 +157,13 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void closeEdit() {
|
||||
this.onBackPressed();
|
||||
}
|
||||
|
||||
public void manualSearch() {
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre/codice articolo da cercare", null, this.viewModel::onSearch, BarcodeManager::enable).show();
|
||||
DialogSimpleInputHelper.makeInputDialog(this, "Ricerca articolo", null, "Cod articolo / Barcode", this.viewModel::onSearch, BarcodeManager::enable).show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ public void deleteDocument() {
|
||||
}
|
||||
|
||||
private GrigliaAcquistiChildDTO searchArticolo(String filter) {
|
||||
return Stream.of(this.productsList).filter(dto -> dto.getCodMart().equalsIgnoreCase(filter) || dto.getBarcode().equalsIgnoreCase(filter)).findFirstOrElse(null);
|
||||
return Stream.of(this.productsList).filter(dto -> filter.equalsIgnoreCase(dto.getCodMart()) || filter.equalsIgnoreCase(dto.getBarcode())).findFirstOrElse(null);
|
||||
}
|
||||
|
||||
private SaveDTO getSaveDto() {
|
||||
|
||||
@ -2,7 +2,6 @@ package it.integry.integrywmsnative.view.dialogs.base;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
@ -12,6 +11,7 @@ import androidx.databinding.DataBindingUtil;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogInputGeneralBinding;
|
||||
|
||||
/**
|
||||
@ -21,7 +21,7 @@ import it.integry.integrywmsnative.databinding.DialogInputGeneralBinding;
|
||||
public class DialogSimpleInputHelper {
|
||||
|
||||
|
||||
private static Dialog makeBase(Context mContext, String titleText, String valueText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||
private static Dialog makeBase(Context mContext, String titleText, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||
Dialog dialog = new Dialog(mContext);
|
||||
DialogSimpleInputViewModel viewModel = new DialogSimpleInputViewModel(dialog);
|
||||
|
||||
@ -39,10 +39,14 @@ public class DialogSimpleInputHelper {
|
||||
|
||||
//Title VIEW
|
||||
mBinding.titleText.setText(titleText);
|
||||
if (valueText != null){
|
||||
mBinding.generalInput.setText(valueText);
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(hintText)){
|
||||
mBinding.generalInput.setHint(hintText);
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(defaultTextValue)){
|
||||
mBinding.generalInput.setText(defaultTextValue);
|
||||
}
|
||||
ColorStateList colorStateList = ColorStateList.valueOf(Color.WHITE);
|
||||
|
||||
//Content View
|
||||
dialog.setCancelable(true);
|
||||
@ -60,17 +64,19 @@ public class DialogSimpleInputHelper {
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
null,
|
||||
null,
|
||||
onPositiveClick,
|
||||
onNegativeClick);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Dialog makeInputDialog(Context mContext, String title,String value, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||
public static Dialog makeInputDialog(Context mContext, String title, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick){
|
||||
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
value,
|
||||
defaultTextValue,
|
||||
hintText,
|
||||
onPositiveClick,
|
||||
onNegativeClick);
|
||||
|
||||
|
||||
@ -1,142 +1,122 @@
|
||||
<?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: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.base.DialogSimpleInputViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="12dp"
|
||||
android:orientation="vertical"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_blue_300"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
android:layout_margin="24dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/base"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
tools:text="Insert here"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
app:cardBackgroundColor="@color/light_blue_300"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@drawable/dialog_card_child_bg"
|
||||
android:padding="24dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_left"
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.10"/>
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_right"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.90"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Insert here" />
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/level_number_layout"
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/guide_left"
|
||||
app:layout_constraintEnd_toStartOf="@id/guide_right"
|
||||
android:layout_marginBottom="16dp"
|
||||
style="@style/TextInputLayout.OutlinePrimary">
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_text">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/general_input"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:hint="input here"
|
||||
style="@style/TextInputEditText.OutlinePrimary"/>
|
||||
tools:hint="input here" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_half_vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_buttons_top"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:gravity="bottom|center_horizontal">
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/level_number_layout" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_abort"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
app:icon="@drawable/ic_clear_24dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/abort"/>
|
||||
android:text="@string/abort"
|
||||
app:layout_constraintEnd_toStartOf="@id/guide_half_vertical"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/guide_buttons_top"
|
||||
app:strokeColor="@color/colorPrimary" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
app:icon="@drawable/ic_save_24dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
||||
android:text="@string/confirm"/>
|
||||
</LinearLayout>
|
||||
android:text="@string/confirm"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/guide_half_vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/guide_buttons_top" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</layout>
|
||||
@ -63,81 +63,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_text" />
|
||||
|
||||
<!-- <com.google.android.material.button.MaterialButton-->
|
||||
<!-- android:id="@+id/view_details_btn"-->
|
||||
<!-- style="@style/Widget.MaterialComponents.Button.TextButton.Icon"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="Vedi dettagli"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:icon="@drawable/ic_baseline_keyboard_arrow_down_24"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/description_text"-->
|
||||
<!-- app:singleClick="@{() -> view.toggleDetailVisibility()}" />-->
|
||||
|
||||
<!-- <it.integry.integrywmsnative.ui.expandablelayout.ExpandableLayout-->
|
||||
<!-- android:id="@+id/details_container"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/view_details_btn">-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:background="@color/gray_200">-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatTextView-->
|
||||
<!-- android:id="@+id/not_completed_lbl"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="Non completati"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:textAllCaps="true"-->
|
||||
<!-- android:padding="8dp"-->
|
||||
<!-- android:visibility="@{view.versamentoAutomaticoULResponseDTO.failed.empty ? View.GONE : View.VISIBLE}"-->
|
||||
<!-- style="@style/TextViewMaterial.Dialog.SupportingText"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"/>-->
|
||||
|
||||
<!-- <com.linearlistview.LinearListView-->
|
||||
<!-- android:id="@+id/details_not_completed_list"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:nestedScrollingEnabled="false"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/not_completed_lbl"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent" />-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatTextView-->
|
||||
<!-- android:id="@+id/completed_lbl"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="Completati"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:textAllCaps="true"-->
|
||||
<!-- android:padding="8dp"-->
|
||||
<!-- android:visibility="@{view.versamentoAutomaticoULResponseDTO.success.empty ? View.GONE : View.VISIBLE}"-->
|
||||
<!-- style="@style/TextViewMaterial.Dialog.SupportingText"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/details_not_completed_list"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"/>-->
|
||||
|
||||
<!-- <com.linearlistview.LinearListView-->
|
||||
<!-- android:id="@+id/details_completed_list"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/completed_lbl"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent" />-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
|
||||
<!-- </it.integry.integrywmsnative.ui.expandablelayout.ExpandableLayout>-->
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_confirm"
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/gray_detail_background_round8"
|
||||
android:orientation="vertical"
|
||||
android:onClick="@{() -> view.selectDocInfo()}"
|
||||
app:singleClick="@{() -> view.selectDocInfo()}"
|
||||
android:padding="16dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user