From 7e0cdda6aa0941d143d76531c1f7c47b8e8dac46 Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Fri, 9 Feb 2024 11:41:54 +0100 Subject: [PATCH] error interface --- .../feature/buffer/fragment/BufferLoadFragment.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt index 1f24b721..dc598e5e 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferLoadFragment.kt @@ -7,6 +7,7 @@ import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import es.verdnatura.R import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding +import es.verdnatura.domain.toast import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.common.OnSmartTagRowClickListener import es.verdnatura.presentation.view.component.CustomDialogList @@ -93,10 +94,11 @@ class BufferLoadFragment( it.response?.let { it1 -> ma.messageWithSound(it1, false, true) } } else { - ma.messageWithSound(it.response,isError = true,true) + ma.messageWithSound(it.response, isError = true, true) } listTags.clear() tagsAdapter!!.notifyDataSetChanged() + customDialogList.dismiss() showExpeditionOrBufferScan() }) @@ -137,8 +139,11 @@ class BufferLoadFragment( customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ -> if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (!customDialogList.getValue().isNullOrEmpty()) { - - checkLoadExpedition(customDialogList.getValue().toInt()) + try { + checkLoadExpedition(customDialogList.getValue().toInt()) + } catch (ex: Exception) { + ex.message!!.toast(requireContext()) + } } customDialogList.setValue("") ma.hideKeyboard(customDialogList.getEditText())