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" applicationId "es.verdnatura"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 49 versionCode 50
versionName "5.3.9" versionName "5.4.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@ -114,7 +114,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
RecognizerIntent.EXTRA_LANGUAGE, RecognizerIntent.EXTRA_LANGUAGE,
Locale.getDefault() Locale.getDefault()
) )
mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, true) mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, false)
mSpeechRecognizer?.setRecognitionListener(this) mSpeechRecognizer?.setRecognitionListener(this)
isOnReadyForSpeech = false; isOnReadyForSpeech = false;
startListening() startListening()
@ -193,7 +193,6 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
override fun onReadyForSpeech(params: Bundle?) { override fun onReadyForSpeech(params: Bundle?) {
isOnReadyForSpeech = true; isOnReadyForSpeech = true;
Log.i("Speech", "onReadyForSpeech") Log.i("Speech", "onReadyForSpeech")
"onReadyForSpeech".toast(requireContext())
} }
override fun onBeginningOfSpeech() { override fun onBeginningOfSpeech() {
@ -212,10 +211,10 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
override fun onError(error: Int) { override fun onError(error: Int) {
if (!isOnReadyForSpeech && error == SpeechRecognizer.ERROR_NO_MATCH) { if (!isOnReadyForSpeech && error == SpeechRecognizer.ERROR_NO_MATCH) {
startListening() ("Problemas con la velocidad de internet. No se puede usar la voz").toast(requireContext())
return
}else{ }else{
Log.i("Speech", "onError "+error) Log.i("Speech", "onError "+error)
("onError "+error).toast(requireContext())
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy() if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
mSpeechRecognizer = null mSpeechRecognizer = null
initialize() initialize()

View File

@ -10,7 +10,7 @@ fun PreSacadorItemVO.toSale() : SaleVO {
saleFk = idMovimiento, saleFk = idMovimiento,
itemFk = itemFk, itemFk = itemFk,
quantity = saldo.toString(), quantity = saldo.toString(),
longName = longName, longName = if (longName != null) longName else "",
isPreviousPrepared = if (quantity == picked) "1" else "0", isPreviousPrepared = if (quantity == picked) "1" else "0",
line1 = longName, line1 = longName,
line2 = if (subName.isNullOrEmpty()) "" else subName, line2 = if (subName.isNullOrEmpty()) "" else subName,
@ -30,7 +30,7 @@ fun PreSacadorItemVO.toSaleReposicion() : SaleVO {
saleFk = idMovimiento, saleFk = idMovimiento,
itemFk = itemFk, itemFk = itemFk,
quantity = quantity.toString(), quantity = quantity.toString(),
longName = longName, longName = if (longName != null) longName else "",
isPreviousPrepared = if ((quantity - saldo) == 0) "1" else "0", isPreviousPrepared = if ((quantity - saldo) == 0) "1" else "0",
line1 = longName, line1 = longName,
line2 = if (subName.isNullOrEmpty()) "" else subName, line2 = if (subName.isNullOrEmpty()) "" else subName,