This commit is contained in:
Enrique Blasco 2020-12-09 07:50:47 +01:00
parent bb521e3f7d
commit 837d23a5da
3 changed files with 7 additions and 8 deletions

View File

@ -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"
}

View File

@ -114,7 +114,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(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<T : ViewDataBinding, V : BaseViewModel>(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<T : ViewDataBinding, V : BaseViewModel>(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()

View File

@ -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,