Implementato messaggio info extra in DialogInputQuantity (attualmente mostra un testo Human Readable delle quantità da prelevare).
This commit is contained in:
parent
47f29899a2
commit
fc1681d111
@ -52,9 +52,12 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
@Inject
|
||||
DialogInputQuantityV2ViewModel mViewModel;
|
||||
|
||||
private DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
||||
private RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
||||
private Runnable mOnAbort;
|
||||
private final DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
||||
private final RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
||||
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> 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) -> {
|
||||
if (this.mEnableDataCallback) {
|
||||
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) -> {
|
||||
if (this.mEnableDataCallback) {
|
||||
this.mViewModel.setNumCnf(value);
|
||||
@ -374,6 +377,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
this.enabledNotes.set(this.mDialogInputQuantityV2DTO.isNotesAllowed());
|
||||
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
android:background="@android:color/white">
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -183,6 +183,94 @@
|
||||
|
||||
</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 && 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
|
||||
android:layout_width="match_parent"
|
||||
@ -413,9 +501,9 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
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:paddingEnd="4dp"
|
||||
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -525,8 +613,8 @@
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/tot_qty"
|
||||
android:digits="0123456789"
|
||||
android:hint="@string/tot_qty"
|
||||
android:inputType="number"
|
||||
app:binding="@{view.currentQtaTot}" />
|
||||
|
||||
@ -557,12 +645,12 @@
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_ped_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_art"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/gray_400"
|
||||
app:binding="@{view.currentTaraArticolo}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -580,13 +668,13 @@
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_col_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
android:textColor="@color/gray_400"
|
||||
app:binding="@{view.currentTaraTot}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -609,8 +697,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/LU_weight"
|
||||
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:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }"
|
||||
app:binding="@{view.currentPesoLordo}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@ -75,15 +75,15 @@
|
||||
tools:text="COD MART (Partita mag)" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:id="@+id/unt_mis"
|
||||
style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:visibility="@{viewmodel.mtbAart.untMis != null ? View.VISIBLE : View.GONE}"
|
||||
android:ellipsize="end"
|
||||
android:text="@{viewmodel.mtbAart.untMis}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:visibility="@{viewmodel.mtbAart.untMis != null ? View.VISIBLE : View.GONE}"
|
||||
tools:text="UM" />
|
||||
|
||||
</RelativeLayout>
|
||||
@ -195,6 +195,95 @@
|
||||
|
||||
</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 && 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
|
||||
android:layout_width="match_parent"
|
||||
@ -425,9 +514,9 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
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:paddingEnd="4dp"
|
||||
android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -493,9 +582,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/num_pcks"
|
||||
android:imeOptions="actionDone"
|
||||
android:selectAllOnFocus="true"
|
||||
android:nextFocusForward="@+id/input_qta_cnf_text"
|
||||
android:inputType="number"
|
||||
android:nextFocusForward="@+id/input_qta_cnf_text"
|
||||
android:selectAllOnFocus="true"
|
||||
app:binding="@{view.currentNumCnf}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -518,9 +607,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/qty_x_pck"
|
||||
android:imeOptions="actionDone"
|
||||
android:selectAllOnFocus="true"
|
||||
android:nextFocusForward="@+id/input_qta_tot_text"
|
||||
android:inputType="numberDecimal"
|
||||
android:nextFocusForward="@+id/input_qta_tot_text"
|
||||
android:selectAllOnFocus="true"
|
||||
app:binding="@{view.currentQtaCnf}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -574,12 +663,12 @@
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_ped_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_art"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/gray_400"
|
||||
app:binding="@{view.currentTaraArticolo}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -597,13 +686,13 @@
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_tara_col_text"
|
||||
style="@style/TextInputEditText.OutlinePrimary"
|
||||
android:textColor="@color/gray_400"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
android:textColor="@color/gray_400"
|
||||
app:binding="@{view.currentTaraTot}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -617,6 +706,7 @@
|
||||
android:enabled="@{view.enabledPesoLordo}"
|
||||
android:focusableInTouchMode="false"
|
||||
android:imeOptions="actionDone"
|
||||
tools:enabled="false"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
|
||||
@ -99,8 +99,8 @@
|
||||
<item quantity="other">pezzi</item>
|
||||
</plurals>
|
||||
<plurals name="item_package">
|
||||
<item quantity="one">collo</item>
|
||||
<item quantity="other">colli</item>
|
||||
<item quantity="one">confezione</item>
|
||||
<item quantity="other">confezioni</item>
|
||||
</plurals>
|
||||
<string name="unt_mis">Unt mis</string>
|
||||
<string name="unt_mis_col">col</string>
|
||||
|
||||
@ -46,6 +46,9 @@
|
||||
|
||||
<color name="blue_100">#BBDEFB</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_800">#1565C0</color>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user