This commit is contained in:
Sergio De la torre 2023-11-16 16:44:23 +01:00
parent 4a6d0a2d73
commit ff3a9c72e8
3 changed files with 31 additions and 31 deletions

View File

@ -55,7 +55,6 @@ class SacadorFragmentNew(
setToolBar() setToolBar()
setEvents() setEvents()
callBack(type) callBack(type)
println("El sacador new y type $type")
super.init() super.init()
} }
@ -149,32 +148,19 @@ class SacadorFragmentNew(
customDialogInput.setDescription(getString(R.string.printPreviousGroup)) customDialogInput.setDescription(getString(R.string.printPreviousGroup))
.setValue("") .setValue("")
.setOkButton(getString(R.string.print)) { .setOkButton(getString(R.string.print)) {
try {
if (customDialogInput.getValue().isNotEmpty()
) {
print() print()
}
} catch (ex: Exception) {
getString(R.string.errorInput)
}
customDialogInput.setValue("")
}.setKoButton(getString(R.string.cancel)) { }.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss() customDialogInput.dismiss()
}.show() }.show()
customDialogInput.setFocusText() customDialogInput.setFocusText()
customDialogInput.setFocusText()
ma.hideKeyboard(customDialogInput.getEditText()) ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ -> customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
if (customDialogInput.getValue().isNotEmpty()
) {
print() print()
}
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -185,6 +171,10 @@ class SacadorFragmentNew(
} }
private fun print() { private fun print() {
try {
if (customDialogInput.getValue().isNotEmpty()
) {
if (ma.havePrinter()) { if (ma.havePrinter()) {
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt()) viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast( (getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
@ -195,6 +185,15 @@ class SacadorFragmentNew(
} }
} }
} catch (ex: Exception) {
getString(R.string.errorInput)
}
customDialogInput.setValue("")
}
private fun setEvents() { private fun setEvents() {
binding.sacadorSwipe.setOnRefreshListener { binding.sacadorSwipe.setOnRefreshListener {
callBack(type) callBack(type)

View File

@ -370,8 +370,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@+id/linearLayoutColor" app:layout_constraintEnd_toStartOf="@+id/linearLayoutColor"
app:layout_constraintTop_toTopOf="parent"
> >
<TextView <TextView
android:id="@+id/packingTopicker" android:id="@+id/packingTopicker"
@ -381,7 +380,8 @@
android:textSize="26sp" android:textSize="26sp"
android:gravity="end" android:gravity="end"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:textColor="@color/verdnatura_white"> android:textColor="@color/verdnatura_white"
app:layout_constraintTop_toTopOf="parent">
</TextView> </TextView>
@ -413,12 +413,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="100" android:text="100"
android:layout_weight="0.5" android:layout_weight="0.30"
android:textSize="22sp" android:textSize="22sp"
android:gravity="right" android:gravity="right"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
tool:text="20/30"> tool:text="2000/3000">
</TextView> </TextView>
@ -433,11 +433,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<View <View
android:id="@+id/item_ticketColor" android:id="@+id/item_ticketColors"
android:layout_width="@dimen/semaforo_width" android:layout_width="@dimen/semaforo_width"
android:layout_height="@dimen/ticketColor_height" android:layout_height="@dimen/ticketColor_height"
android:layout_marginBottom="1dp" android:layout_marginBottom="1dp"

View File

@ -218,7 +218,7 @@
tool:text="25 x 1" /> tool:text="25 x 1" />
<View <View
android:id="@+id/item_ticket_color" android:id="@+id/item_ticket_colors"
android:layout_width="@dimen/semaforo_width" android:layout_width="@dimen/semaforo_width"
android:layout_height="@dimen/ticketColor_height" android:layout_height="@dimen/ticketColor_height"
android:layout_marginBottom="1dp" android:layout_marginBottom="1dp"