diff --git a/app/build.gradle b/app/build.gradle index adfe2de9..cd7a090c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId "es.verdnatura" minSdkVersion 21 targetSdkVersion 29 - versionCode 49 - versionName "5.3.9" + versionCode 50 + versionName "5.4.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt index e15c81a5..7ac47e05 100644 --- a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt @@ -114,7 +114,7 @@ abstract class BaseFragment(viewModelCla RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault() ) - mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, true) + mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, false) mSpeechRecognizer?.setRecognitionListener(this) isOnReadyForSpeech = false; startListening() @@ -193,7 +193,6 @@ abstract class BaseFragment(viewModelCla override fun onReadyForSpeech(params: Bundle?) { isOnReadyForSpeech = true; Log.i("Speech", "onReadyForSpeech") - "onReadyForSpeech".toast(requireContext()) } override fun onBeginningOfSpeech() { @@ -212,10 +211,10 @@ abstract class BaseFragment(viewModelCla override fun onError(error: Int) { if (!isOnReadyForSpeech && error == SpeechRecognizer.ERROR_NO_MATCH) { - startListening() + ("Problemas con la velocidad de internet. No se puede usar la voz").toast(requireContext()) + return }else{ Log.i("Speech", "onError "+error) - ("onError "+error).toast(requireContext()) if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy() mSpeechRecognizer = null initialize() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/mapper/SaleMapper.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/mapper/SaleMapper.kt index 8a6f6c2b..08a17f1d 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/mapper/SaleMapper.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/mapper/SaleMapper.kt @@ -10,7 +10,7 @@ fun PreSacadorItemVO.toSale() : SaleVO { saleFk = idMovimiento, itemFk = itemFk, quantity = saldo.toString(), - longName = longName, + longName = if (longName != null) longName else "", isPreviousPrepared = if (quantity == picked) "1" else "0", line1 = longName, line2 = if (subName.isNullOrEmpty()) "" else subName, @@ -30,7 +30,7 @@ fun PreSacadorItemVO.toSaleReposicion() : SaleVO { saleFk = idMovimiento, itemFk = itemFk, quantity = quantity.toString(), - longName = longName, + longName = if (longName != null) longName else "", isPreviousPrepared = if ((quantity - saldo) == 0) "1" else "0", line1 = longName, line2 = if (subName.isNullOrEmpty()) "" else subName,