Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Valerio Castellana 2022-02-14 17:47:36 +01:00
commit 4da2c43251
5 changed files with 216 additions and 28 deletions

View File

@ -52,9 +52,12 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
@Inject @Inject
DialogInputQuantityV2ViewModel mViewModel; DialogInputQuantityV2ViewModel mViewModel;
private DialogInputQuantityV2DTO mDialogInputQuantityV2DTO; private final DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
private RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete; private final RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
private Runnable mOnAbort; private final Runnable mOnAbort;
public ObservableField<Integer> currentTextNumCnfToTake = new ObservableField<>(0);
public ObservableField<Integer> currentTextNumPezziToTake = new ObservableField<>(0);
public ObservableField<String> currentPartitaMag = new ObservableField<>(); public ObservableField<String> currentPartitaMag = new ObservableField<>();
public ObservableField<String> currentNotes = new ObservableField<>(); public ObservableField<String> currentNotes = new ObservableField<>();
@ -215,12 +218,6 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
} }
}); });
UtilityObservable.addPropertyChanged(this.currentNotes, (value) -> {
if (this.mEnableDataCallback) {
this.mViewModel.setNote(value);
}
});
UtilityObservable.addPropertyChanged(this.currentDataScad, (value) -> { UtilityObservable.addPropertyChanged(this.currentDataScad, (value) -> {
if (this.mEnableDataCallback) { if (this.mEnableDataCallback) {
MtbAart mtbAart = this.mViewModel.getMtbAart(); MtbAart mtbAart = this.mViewModel.getMtbAart();
@ -246,6 +243,12 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
} }
}); });
UtilityObservable.addPropertyChanged(this.currentNotes, (value) -> {
if (this.mEnableDataCallback) {
this.mViewModel.setNote(value);
}
});
UtilityObservable.addPropertyChanged(this.currentNumCnf, (value) -> { UtilityObservable.addPropertyChanged(this.currentNumCnf, (value) -> {
if (this.mEnableDataCallback) { if (this.mEnableDataCallback) {
this.mViewModel.setNumCnf(value); this.mViewModel.setNumCnf(value);
@ -374,6 +377,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
this.enabledNotes.set(this.mDialogInputQuantityV2DTO.isNotesAllowed()); this.enabledNotes.set(this.mDialogInputQuantityV2DTO.isNotesAllowed());
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed()); this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg()); this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg());
this.currentTextNumCnfToTake.set(this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue());
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().intValue() % this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue();
this.currentTextNumPezziToTake.set(qtaText);
} }

View File

@ -31,10 +31,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:background="@android:color/white"
android:orientation="vertical" android:orientation="vertical"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
app:cardElevation="0dp" app:cardElevation="0dp">
android:background="@android:color/white">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -183,6 +183,94 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:visibility="@{view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/qta_ord_text_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/badge_round_corner"
android:backgroundTint="@color/light_blue_100"
android:gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="12dp"
android:paddingVertical="4dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_info_78dp"
android:tint="@color/gray_600" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="@{view.currentTextNumCnfToTake.toString()}"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="1" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="4dp"
android:text="@{@plurals/item_package(view.currentTextNumCnfToTake)}"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="conf" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="4dp"
android:text="e"
android:textColor="@color/gray_600"
android:visibility="@{view.currentTextNumPezziToTake > 0 &amp;&amp; view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="@{view.currentTextNumPezziToTake.toString()}"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="4" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="2dp"
android:text="@{@plurals/pieces(view.currentTextNumPezziToTake)}"
android:textAllCaps="false"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="Pezzi" />
</androidx.appcompat.widget.LinearLayoutCompat>
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
@ -413,9 +501,9 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}" android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}"
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
android:enabled="@{view.enabledChangePartitaMag}" android:enabled="@{view.enabledChangePartitaMag}"
android:paddingEnd="4dp" android:paddingEnd="4dp"
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
tools:layout_weight="1"> tools:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
@ -525,8 +613,8 @@
style="@style/TextInputEditText.OutlinePrimary" style="@style/TextInputEditText.OutlinePrimary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/tot_qty"
android:digits="0123456789" android:digits="0123456789"
android:hint="@string/tot_qty"
android:inputType="number" android:inputType="number"
app:binding="@{view.currentQtaTot}" /> app:binding="@{view.currentQtaTot}" />
@ -557,12 +645,12 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_tara_ped_text" android:id="@+id/input_tara_ped_text"
style="@style/TextInputEditText.OutlinePrimary" style="@style/TextInputEditText.OutlinePrimary"
android:textColor="@color/gray_400"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:enabled="false" android:enabled="false"
android:hint="@string/tare_art" android:hint="@string/tare_art"
android:inputType="number" android:inputType="number"
android:textColor="@color/gray_400"
app:binding="@{view.currentTaraArticolo}" /> app:binding="@{view.currentTaraArticolo}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -580,13 +668,13 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_tara_col_text" android:id="@+id/input_tara_col_text"
style="@style/TextInputEditText.OutlinePrimary" style="@style/TextInputEditText.OutlinePrimary"
android:textColor="@color/gray_400"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:enabled="false" android:enabled="false"
android:hint="@string/tare_pckg" android:hint="@string/tare_pckg"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:textColor="@color/gray_400"
app:binding="@{view.currentTaraTot}" /> app:binding="@{view.currentTaraTot}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -609,8 +697,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/LU_weight" android:hint="@string/LU_weight"
android:inputType="number" android:inputType="number"
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
android:textColor="@{ContextCompat.getColor(context, view.enabledQtaCnf ? android.R.color.black : R.color.gray_400)}" android:textColor="@{ContextCompat.getColor(context, view.enabledQtaCnf ? android.R.color.black : R.color.gray_400)}"
android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
app:binding="@{view.currentPesoLordo}" /> app:binding="@{view.currentPesoLordo}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View File

@ -75,15 +75,15 @@
tools:text="COD MART (Partita mag)" /> tools:text="COD MART (Partita mag)" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
android:id="@+id/unt_mis" android:id="@+id/unt_mis"
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:visibility="@{viewmodel.mtbAart.untMis != null ? View.VISIBLE : View.GONE}" android:ellipsize="end"
android:text="@{viewmodel.mtbAart.untMis}" android:text="@{viewmodel.mtbAart.untMis}"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:visibility="@{viewmodel.mtbAart.untMis != null ? View.VISIBLE : View.GONE}"
tools:text="UM" /> tools:text="UM" />
</RelativeLayout> </RelativeLayout>
@ -195,6 +195,95 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:visibility="@{view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/qta_ord_text_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/badge_round_corner"
android:backgroundTint="@color/light_blue_100"
android:gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="12dp"
android:paddingVertical="4dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_info_78dp"
android:tint="@color/gray_600" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="@{view.currentTextNumCnfToTake.toString()}"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="1" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="4dp"
android:text="@{@plurals/item_package(view.currentTextNumCnfToTake)}"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="conf" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="4dp"
android:text="e"
android:textColor="@color/gray_600"
android:visibility="@{view.currentTextNumPezziToTake > 0 &amp;&amp; view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="@{view.currentTextNumPezziToTake.toString()}"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="4" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/AppTheme.NewMaterial.Text.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="2dp"
android:text="@{@plurals/pieces(view.currentTextNumPezziToTake)}"
android:textAllCaps="false"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
tools:text="Pezzi" />
</androidx.appcompat.widget.LinearLayoutCompat>
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
@ -425,9 +514,9 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}" android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}"
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
android:enabled="@{view.enabledChangePartitaMag}" android:enabled="@{view.enabledChangePartitaMag}"
android:paddingEnd="4dp" android:paddingEnd="4dp"
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
tools:layout_weight="1"> tools:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
@ -493,9 +582,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/num_pcks" android:hint="@string/num_pcks"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:selectAllOnFocus="true"
android:nextFocusForward="@+id/input_qta_cnf_text"
android:inputType="number" android:inputType="number"
android:nextFocusForward="@+id/input_qta_cnf_text"
android:selectAllOnFocus="true"
app:binding="@{view.currentNumCnf}" /> app:binding="@{view.currentNumCnf}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -518,9 +607,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/qty_x_pck" android:hint="@string/qty_x_pck"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:selectAllOnFocus="true"
android:nextFocusForward="@+id/input_qta_tot_text"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:nextFocusForward="@+id/input_qta_tot_text"
android:selectAllOnFocus="true"
app:binding="@{view.currentQtaCnf}" /> app:binding="@{view.currentQtaCnf}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -574,12 +663,12 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_tara_ped_text" android:id="@+id/input_tara_ped_text"
style="@style/TextInputEditText.OutlinePrimary" style="@style/TextInputEditText.OutlinePrimary"
android:textColor="@color/gray_400"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:enabled="false" android:enabled="false"
android:hint="@string/tare_art" android:hint="@string/tare_art"
android:inputType="number" android:inputType="number"
android:textColor="@color/gray_400"
app:binding="@{view.currentTaraArticolo}" /> app:binding="@{view.currentTaraArticolo}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -597,13 +686,13 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_tara_col_text" android:id="@+id/input_tara_col_text"
style="@style/TextInputEditText.OutlinePrimary" style="@style/TextInputEditText.OutlinePrimary"
android:textColor="@color/gray_400"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:enabled="false" android:enabled="false"
android:hint="@string/tare_pckg" android:hint="@string/tare_pckg"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:textColor="@color/gray_400"
app:binding="@{view.currentTaraTot}" /> app:binding="@{view.currentTaraTot}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -617,6 +706,7 @@
android:enabled="@{view.enabledPesoLordo}" android:enabled="@{view.enabledPesoLordo}"
android:focusableInTouchMode="false" android:focusableInTouchMode="false"
android:imeOptions="actionDone" android:imeOptions="actionDone"
tools:enabled="false"
tools:layout_weight="1"> tools:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText

View File

@ -99,8 +99,8 @@
<item quantity="other">pezzi</item> <item quantity="other">pezzi</item>
</plurals> </plurals>
<plurals name="item_package"> <plurals name="item_package">
<item quantity="one">collo</item> <item quantity="one">confezione</item>
<item quantity="other">colli</item> <item quantity="other">confezioni</item>
</plurals> </plurals>
<string name="unt_mis">Unt mis</string> <string name="unt_mis">Unt mis</string>
<string name="unt_mis_col">col</string> <string name="unt_mis_col">col</string>

View File

@ -46,6 +46,9 @@
<color name="blue_100">#BBDEFB</color> <color name="blue_100">#BBDEFB</color>
<color name="blue_300">#64B5F6</color> <color name="blue_300">#64B5F6</color>
<color name="blue_400">#42A5F5</color>
<color name="blue_500">#2196F3</color>
<color name="blue_600">#1E88E5</color>
<color name="blue_700">#1976D2</color> <color name="blue_700">#1976D2</color>
<color name="blue_800">#1565C0</color> <color name="blue_800">#1565C0</color>