Version 9.2.1 en producción. Borrada Voz y Ajustes impresora
This commit is contained in:
parent
840abbcd2b
commit
841974a026
|
@ -13,8 +13,9 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21 //21
|
minSdkVersion 21 //21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 135
|
versionCode 136
|
||||||
versionName = "9.2.1Beta"
|
versionName = "9.1"
|
||||||
|
//versionName = "9.2.1Beta" versioncode 135
|
||||||
//versionName = "9.2Beta" versionCode 133
|
//versionName = "9.2Beta" versionCode 133
|
||||||
//versionName = "9" versionCode 133
|
//versionName = "9" versionCode 133
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,7 @@ import android.app.PendingIntent
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.media.AudioManager
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.speech.RecognitionListener
|
|
||||||
import android.speech.RecognizerIntent
|
|
||||||
import android.speech.SpeechRecognizer
|
|
||||||
import android.speech.tts.TextToSpeech
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
@ -28,8 +22,6 @@ import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ToolbarFragmentBinding
|
import es.verdnatura.databinding.ToolbarFragmentBinding
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||||
import es.verdnatura.domain.toast
|
|
||||||
import es.verdnatura.presentation.common.mediaCurrentVolume
|
|
||||||
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
@ -41,7 +33,7 @@ import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
|
||||||
abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelClass: KClass<V>) :
|
abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelClass: KClass<V>) :
|
||||||
Fragment(), TextToSpeech.OnInitListener, RecognitionListener {
|
Fragment() {
|
||||||
|
|
||||||
protected val TAG = "VERDNATURA::"
|
protected val TAG = "VERDNATURA::"
|
||||||
protected val PREFS_USER = "es.verdnatura.user.prefs"
|
protected val PREFS_USER = "es.verdnatura.user.prefs"
|
||||||
|
@ -61,7 +53,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
protected val DEVICENAME = "devicename"
|
protected val DEVICENAME = "devicename"
|
||||||
protected val TRAINNAME = "trainName"
|
protected val TRAINNAME = "trainName"
|
||||||
protected val TRAINFK = "trainFk"
|
protected val TRAINFK = "trainFk"
|
||||||
protected val WORKFORMSELECTED="workFormSelected"
|
protected val WORKFORMSELECTED = "workFormSelected"
|
||||||
|
|
||||||
protected val ITEMPACKING = "itemPackingType"
|
protected val ITEMPACKING = "itemPackingType"
|
||||||
protected val ITEMPACKINGFK = "itemPackingTypeFk"
|
protected val ITEMPACKINGFK = "itemPackingTypeFk"
|
||||||
|
@ -79,22 +71,23 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
|
|
||||||
protected val viewModel: V by viewModel(viewModelClass)
|
protected val viewModel: V by viewModel(viewModelClass)
|
||||||
protected lateinit var binding: T
|
protected lateinit var binding: T
|
||||||
private var isOnReadyForSpeech = false
|
|
||||||
|
// private var isOnReadyForSpeech = false
|
||||||
protected lateinit var ma: MainActivity
|
protected lateinit var ma: MainActivity
|
||||||
|
|
||||||
private var textToSpeech: TextToSpeech? = null
|
/* private var textToSpeech: TextToSpeech? = null
|
||||||
private var mAudioManager: AudioManager? = null
|
private var mAudioManager: AudioManager? = null
|
||||||
protected var mSpeechRecognizer: SpeechRecognizer? = null
|
protected var mSpeechRecognizer: SpeechRecognizer? = null
|
||||||
private var mSpeechRecognizerIntent: Intent? = null
|
private var mSpeechRecognizerIntent: Intent? = null*/
|
||||||
|
|
||||||
protected val NEW_COLLECTION = 0
|
/* protected val NEW_COLLECTION = 0
|
||||||
protected val LISTO = 1
|
protected val LISTO = 1
|
||||||
protected val CANCEL = 2
|
protected val CANCEL = 2
|
||||||
protected val VOLVER = 3
|
protected val VOLVER = 3
|
||||||
protected val REPITE = 4
|
protected val REPITE = 4
|
||||||
protected val OTRO = 5
|
protected val OTRO = 5
|
||||||
protected val FALTA = 6
|
protected val FALTA = 6
|
||||||
protected val ERROR = -1
|
protected val ERROR = -1*/
|
||||||
|
|
||||||
|
|
||||||
/*val allowedStrings =
|
/*val allowedStrings =
|
||||||
|
@ -140,7 +133,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
initDataBinding()
|
initDataBinding()
|
||||||
getBundleArguments()
|
getBundleArguments()
|
||||||
observeViewModel()
|
observeViewModel()
|
||||||
runSound()
|
//runSound()
|
||||||
//requestRecordAudioPermission()
|
//requestRecordAudioPermission()
|
||||||
//requestRecordAudioPermissionNew()
|
//requestRecordAudioPermissionNew()
|
||||||
|
|
||||||
|
@ -158,11 +151,11 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
open fun getBundleArguments() {}
|
open fun getBundleArguments() {}
|
||||||
open fun addBindingVariables() {}
|
open fun addBindingVariables() {}
|
||||||
|
|
||||||
open fun setSpeak() {
|
/*open fun setSpeak() {
|
||||||
//VOZ
|
//VOZ
|
||||||
textToSpeech = TextToSpeech(requireContext(), this)
|
// textToSpeech = TextToSpeech(requireContext(), this)
|
||||||
mAudioManager = requireActivity().getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
// mAudioManager = requireActivity().getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||||
}
|
}*/
|
||||||
|
|
||||||
open fun restartapp(f: Fragment) {
|
open fun restartapp(f: Fragment) {
|
||||||
val mStartActivity = Intent(context, f::class.java)
|
val mStartActivity = Intent(context, f::class.java)
|
||||||
|
@ -179,28 +172,28 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun initialize() {
|
/* open fun initialize() {
|
||||||
//ESCUCHA
|
//ESCUCHA
|
||||||
try {
|
try {
|
||||||
mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(requireContext())
|
mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(requireContext())
|
||||||
mSpeechRecognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
mSpeechRecognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||||
mSpeechRecognizerIntent!!.putExtra(
|
mSpeechRecognizerIntent!!.putExtra(
|
||||||
RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
||||||
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM
|
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM
|
||||||
)
|
)
|
||||||
mSpeechRecognizerIntent!!.putExtra(
|
mSpeechRecognizerIntent!!.putExtra(
|
||||||
RecognizerIntent.EXTRA_LANGUAGE,
|
RecognizerIntent.EXTRA_LANGUAGE,
|
||||||
Locale.getDefault()
|
Locale.getDefault()
|
||||||
)
|
)
|
||||||
mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, false)
|
mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, false)
|
||||||
mSpeechRecognizer?.setRecognitionListener(this)
|
mSpeechRecognizer?.setRecognitionListener(this)
|
||||||
isOnReadyForSpeech = false
|
isOnReadyForSpeech = false
|
||||||
startListening()
|
startListening()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
cancelSpeech()
|
cancelSpeech()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
private fun initDataBinding() {
|
private fun initDataBinding() {
|
||||||
binding = DataBindingUtil.bind<T>(requireView())!!
|
binding = DataBindingUtil.bind<T>(requireView())!!
|
||||||
|
@ -261,14 +254,14 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
R.drawable.ic_flash_auto_black_24dp -> getString(R.string.allowAutomaticAddItem)
|
R.drawable.ic_flash_auto_black_24dp -> getString(R.string.allowAutomaticAddItem)
|
||||||
R.drawable.ic_logo_salix -> getString(R.string.accessSalix)
|
R.drawable.ic_logo_salix -> getString(R.string.accessSalix)
|
||||||
R.drawable.ic_eye_ui -> getString(R.string.icViewCollection)
|
R.drawable.ic_eye_ui -> getString(R.string.icViewCollection)
|
||||||
R.drawable.ic_collection->getString(R.string.icViewCollection)
|
R.drawable.ic_collection -> getString(R.string.icViewCollection)
|
||||||
else -> {
|
else -> {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
override fun onInit(status: Int) {
|
override fun onInit(status: Int) {
|
||||||
/* if (status == TextToSpeech.SUCCESS) {
|
/* if (status == TextToSpeech.SUCCESS) {
|
||||||
val spanish = Locale("es", "ES")
|
val spanish = Locale("es", "ES")
|
||||||
|
@ -301,28 +294,28 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
"La voz no se ha podido iniciar".toast(requireContext())
|
"La voz no se ha podido iniciar".toast(requireContext())
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
/* private fun runSound() {
|
||||||
|
// Get the maximum media/music volume
|
||||||
|
//sergio: se quita por no utilizar
|
||||||
|
// val maxVolume = mAudioManager?.mediaMaxVolume
|
||||||
|
// mAudioManager?.setMediaVolume(maxVolume!!)
|
||||||
|
}*/
|
||||||
|
|
||||||
private fun runSound() {
|
/* private fun muteSound() {
|
||||||
// Get the maximum media/music volume
|
if (mAudioManager?.mediaCurrentVolume != 0) {
|
||||||
//sergio: se quita por no utilizar
|
// mAudioManager?.setMediaVolume(0)
|
||||||
// val maxVolume = mAudioManager?.mediaMaxVolume
|
}
|
||||||
// mAudioManager?.setMediaVolume(maxVolume!!)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun muteSound() {
|
}*/
|
||||||
if (mAudioManager?.mediaCurrentVolume != 0) {
|
|
||||||
// mAudioManager?.setMediaVolume(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
/* fun speak(frase: String) {
|
||||||
|
|
||||||
fun speak(frase: String) {
|
|
||||||
textToSpeech!!.speak(frase, TextToSpeech.QUEUE_FLUSH, null, "frase")
|
textToSpeech!!.speak(frase, TextToSpeech.QUEUE_FLUSH, null, "frase")
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun startListening() {
|
open fun startListening() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
muteSound()
|
//muteSound()
|
||||||
}
|
}
|
||||||
mSpeechRecognizer!!.startListening(mSpeechRecognizerIntent)
|
mSpeechRecognizer!!.startListening(mSpeechRecognizerIntent)
|
||||||
}
|
}
|
||||||
|
@ -355,7 +348,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
//Log.i("Speech", "onError " + error)
|
//Log.i("Speech", "onError " + error)
|
||||||
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
|
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
|
||||||
mSpeechRecognizer = null
|
mSpeechRecognizer = null
|
||||||
initialize()
|
//initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -366,75 +359,77 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
//Log.i("Speech", "onPartialResults")
|
//Log.i("Speech", "onPartialResults")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
override fun onEvent(eventType: Int, params: Bundle?) {
|
override fun onEvent(eventType: Int, params: Bundle?) {
|
||||||
//Log.i("Speech", "onEvent")
|
//Log.i("Speech", "onEvent")
|
||||||
}
|
}*/
|
||||||
|
|
||||||
open fun checkText(text: String): Int {
|
/* open fun checkText(text: String): Int {
|
||||||
|
|
||||||
//check for nuevo
|
//check for nuevo
|
||||||
val nuevo = getMatch(text, "nuevo")
|
val nuevo = getMatch(text, "nuevo")
|
||||||
|
|
||||||
//check for listo
|
//check for listo
|
||||||
val listo = getMatch(text, "listo")
|
val listo = getMatch(text, "listo")
|
||||||
|
|
||||||
//check for cancelar
|
//check for cancelar
|
||||||
val cancelar = getMatch(text, getString(R.string.cancel))
|
val cancelar = getMatch(text, getString(R.string.cancel))
|
||||||
|
|
||||||
//check for volver
|
//check for volver
|
||||||
val volver = getMatch(text, "volver")
|
val volver = getMatch(text, "volver")
|
||||||
|
|
||||||
//check for repite
|
//check for repite
|
||||||
val repite = getMatch(text, "repite")
|
val repite = getMatch(text, "repite")
|
||||||
|
|
||||||
//check for siguiente
|
//check for siguiente
|
||||||
val otro = getMatch(text, "otro")
|
val otro = getMatch(text, "otro")
|
||||||
|
|
||||||
//check for FALTA
|
//check for FALTA
|
||||||
val falta = getMatch(text, "falta")
|
val falta = getMatch(text, "falta")
|
||||||
val words = IntArray(7)
|
val words = IntArray(7)
|
||||||
words[0] = nuevo
|
words[0] = nuevo
|
||||||
words[1] = listo
|
words[1] = listo
|
||||||
words[2] = cancelar
|
words[2] = cancelar
|
||||||
words[3] = volver
|
words[3] = volver
|
||||||
words[4] = repite
|
words[4] = repite
|
||||||
words[5] = otro
|
words[5] = otro
|
||||||
words[6] = falta
|
words[6] = falta
|
||||||
return getMax(words)
|
return getMax(words)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getMax(a: IntArray): Int {
|
private fun getMax(a: IntArray): Int {
|
||||||
var max = a[0]
|
var max = a[0]
|
||||||
var pos = 0
|
var pos = 0
|
||||||
for (i in a.indices) {
|
for (i in a.indices) {
|
||||||
if (a[i] > max) {
|
if (a[i] > max) {
|
||||||
max = a[i]
|
max = a[i]
|
||||||
pos = i
|
pos = i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return if (max < 80) {
|
return if (max < 80) {
|
||||||
-1
|
-1
|
||||||
} else pos
|
} else pos
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getMatch(a: String, b: String): Int {
|
private fun getMatch(a: String, b: String): Int {
|
||||||
var count = 0
|
var count = 0
|
||||||
val cha = a.toCharArray()
|
val cha = a.toCharArray()
|
||||||
val chb = b.toCharArray()
|
val chb = b.toCharArray()
|
||||||
for (i in cha) {
|
for (i in cha) {
|
||||||
for (x in chb) {
|
for (x in chb) {
|
||||||
if (x == i) {
|
if (x == i) {
|
||||||
count += 1
|
count += 1
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val numChar = a.length
|
val numChar = a.length
|
||||||
if (numChar != 0)
|
if (numChar != 0)
|
||||||
return count * 100 / numChar
|
return count * 100 / numChar
|
||||||
else
|
else
|
||||||
return 100
|
return 100
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/* private fun requestReadPhoneStatePermission(){
|
/* private fun requestReadPhoneStatePermission(){
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
@ -513,12 +508,12 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
tool.backButton.visibility = View.INVISIBLE
|
tool.backButton.visibility = View.INVISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
fun cancelSpeech() {
|
/* fun cancelSpeech() {
|
||||||
if (mSpeechRecognizer != null) {
|
if (mSpeechRecognizer != null) {
|
||||||
mSpeechRecognizer!!.destroy()
|
mSpeechRecognizer!!.destroy()
|
||||||
mSpeechRecognizer = null
|
mSpeechRecognizer = null
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
private fun getDefaults(key: String?, context: Context?): String? {
|
private fun getDefaults(key: String?, context: Context?): String? {
|
||||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
@ -551,7 +546,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
TRAINNAME -> prefs.getString(name, "").toString()
|
TRAINNAME -> prefs.getString(name, "").toString()
|
||||||
ITEMPACKING -> prefs.getString(name, "").toString()
|
ITEMPACKING -> prefs.getString(name, "").toString()
|
||||||
ITEMPACKINGFK -> prefs.getString(name, "").toString()
|
ITEMPACKINGFK -> prefs.getString(name, "").toString()
|
||||||
WORKFORMSELECTED->prefs.getString(name, "Producción").toString()
|
WORKFORMSELECTED -> prefs.getString(name, "Producción").toString()
|
||||||
|
|
||||||
|
|
||||||
"base_url" -> {
|
"base_url" -> {
|
||||||
|
@ -612,6 +607,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
editor.remove(nameWorkForm).commit()
|
editor.remove(nameWorkForm).commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun getWorkForm(): List<WorkForms> {
|
fun getWorkForm(): List<WorkForms> {
|
||||||
var listForms: ArrayList<WorkForms> = ArrayList()
|
var listForms: ArrayList<WorkForms> = ArrayList()
|
||||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_SERVER, 0)
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_SERVER, 0)
|
||||||
|
@ -659,7 +655,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
urlSalix = "https://test-salix.verdnatura.es/api/"
|
urlSalix = "https://test-salix.verdnatura.es/api/"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
/*saveWorkForm(
|
/* saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"TestLocalhost",
|
"TestLocalhost",
|
||||||
"http://10.1.4.42:9000",
|
"http://10.1.4.42:9000",
|
||||||
|
@ -674,12 +670,12 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
)
|
)
|
||||||
)*/
|
)*/
|
||||||
|
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"Añadir...",
|
"Añadir...",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
created = Calendar.getInstance().timeInMillis+Calendar.getInstance().timeInMillis
|
created = Calendar.getInstance().timeInMillis + Calendar.getInstance().timeInMillis
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.content.Context.CLIPBOARD_SERVICE
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.View.VISIBLE
|
||||||
import androidx.appcompat.widget.TooltipCompat.setTooltipText
|
import androidx.appcompat.widget.TooltipCompat.setTooltipText
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
@ -62,7 +63,6 @@ class AjustesFragment :
|
||||||
hideBackButton(binding.mainToolbar)
|
hideBackButton(binding.mainToolbar)
|
||||||
viewModel.worker_isF11Allowed(getData(USER), getData(PASSWORD))
|
viewModel.worker_isF11Allowed(getData(USER), getData(PASSWORD))
|
||||||
|
|
||||||
|
|
||||||
binding.userText.setText(getData(USER))
|
binding.userText.setText(getData(USER))
|
||||||
val versionName = requireActivity().packageManager.getPackageInfo(
|
val versionName = requireActivity().packageManager.getPackageInfo(
|
||||||
requireActivity().packageName,
|
requireActivity().packageName,
|
||||||
|
@ -203,6 +203,7 @@ class AjustesFragment :
|
||||||
|
|
||||||
}
|
}
|
||||||
setSettings(isWorkerAllowed)
|
setSettings(isWorkerAllowed)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
actionUpdate.observe(viewLifecycleOwner) {
|
actionUpdate.observe(viewLifecycleOwner) {
|
||||||
|
@ -213,6 +214,12 @@ class AjustesFragment :
|
||||||
getString(R.string.itemUpdated)
|
getString(R.string.itemUpdated)
|
||||||
}, it.isError, false
|
}, it.isError, false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
binding.splashProgress.visibility = VISIBLE
|
||||||
|
viewModel.printer_get(getData(USER), getData(PASSWORD))
|
||||||
|
// viewModel.worker_isF11Allowed(getData(USER), getData(PASSWORD))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
workerupdatePrinter.observe(viewLifecycleOwner) {
|
workerupdatePrinter.observe(viewLifecycleOwner) {
|
||||||
|
@ -378,7 +385,6 @@ class AjustesFragment :
|
||||||
private fun showDialogPrinters(array: Array<String>) {
|
private fun showDialogPrinters(array: Array<String>) {
|
||||||
val builder = AlertDialog.Builder(this.context)
|
val builder = AlertDialog.Builder(this.context)
|
||||||
|
|
||||||
|
|
||||||
builder.setTitle(getString(R.string.Selecccionaimpresoara))
|
builder.setTitle(getString(R.string.Selecccionaimpresoara))
|
||||||
builder.setItems(array) { _, which ->
|
builder.setItems(array) { _, which ->
|
||||||
val selected = array[which]
|
val selected = array[which]
|
||||||
|
@ -448,6 +454,12 @@ class AjustesFragment :
|
||||||
val selected = array[which]
|
val selected = array[which]
|
||||||
sectorListVO.forEach {
|
sectorListVO.forEach {
|
||||||
if (it.description.equals(selected)) {
|
if (it.description.equals(selected)) {
|
||||||
|
|
||||||
|
//borra la impresora
|
||||||
|
viewModel.ajustesitem.get(2).selected = getString(R.string.noprinter)
|
||||||
|
saveData(PRINTERNAME, getString(R.string.noprinter))
|
||||||
|
saveDataInt(PRINTERFK, -1)
|
||||||
|
|
||||||
val editor = prefs!!.edit()
|
val editor = prefs!!.edit()
|
||||||
editor.putString(SECTORDESCRIP, it.description)
|
editor.putString(SECTORDESCRIP, it.description)
|
||||||
editor.putInt(SECTORFK, it.id)
|
editor.putInt(SECTORFK, it.id)
|
||||||
|
@ -555,19 +567,6 @@ class AjustesFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* fun setDefaults(key: String?, value: String?, context: Context?) {
|
|
||||||
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
|
||||||
val editor = preferences.edit()
|
|
||||||
editor.putString(key, value)
|
|
||||||
editor.commit()
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* private fun getDefaults(key: String?, context: Context?): String? {
|
|
||||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
|
||||||
return preferences.getString(key, null)
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
private fun copyanddrag(string: String): Boolean {
|
private fun copyanddrag(string: String): Boolean {
|
||||||
val clipboard = getActivity()?.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
|
val clipboard = getActivity()?.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
val clip: ClipData = ClipData.newPlainText(getString(R.string.androidid), string)
|
val clip: ClipData = ClipData.newPlainText(getString(R.string.androidid), string)
|
||||||
|
|
|
@ -1001,14 +1001,8 @@ class CollectionFragment(
|
||||||
//CREATE LIST
|
//CREATE LIST
|
||||||
private fun createCollectionList() {
|
private fun createCollectionList() {
|
||||||
state = 0
|
state = 0
|
||||||
/* if (type == SACADOR && getData(VOZ) != "NO") {
|
|
||||||
// initialize()
|
|
||||||
speak("Colección cargada, diga listo para empezar.")
|
|
||||||
}*/
|
|
||||||
|
|
||||||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
|
binding.mainToolbar.toolbarTitle.text = collection.collectionFk
|
||||||
|
|
||||||
|
|
||||||
binding.splashProgress.visibility = View.GONE
|
binding.splashProgress.visibility = View.GONE
|
||||||
var salesList: ArrayList<SaleVO> = ArrayList()
|
var salesList: ArrayList<SaleVO> = ArrayList()
|
||||||
tickets = ArrayList()
|
tickets = ArrayList()
|
||||||
|
@ -1656,7 +1650,7 @@ class CollectionFragment(
|
||||||
.setHintValueTwo(getString(R.string.scanItem))
|
.setHintValueTwo(getString(R.string.scanItem))
|
||||||
.setValueTwo("").show()
|
.setValueTwo("").show()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
//////Log.i("VERDNATURA:","${e.message.toString()}")
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
customDialogList.getEditTextTwo().post(Runnable {
|
customDialogList.getEditTextTwo().post(Runnable {
|
||||||
|
@ -2775,7 +2769,7 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
//VOZ
|
//VOZ
|
||||||
override fun onResults(results: Bundle) {
|
/* override fun onResults(results: Bundle) {
|
||||||
super.onResults(results)
|
super.onResults(results)
|
||||||
//Log.i("Speech", "onResults")
|
//Log.i("Speech", "onResults")
|
||||||
val matches = results
|
val matches = results
|
||||||
|
@ -2786,9 +2780,9 @@ class CollectionFragment(
|
||||||
mSpeechRecognizer!!.cancel()
|
mSpeechRecognizer!!.cancel()
|
||||||
getText(matches[0])
|
getText(matches[0])
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
private fun getText(text: String) {
|
/* private fun getText(text: String) {
|
||||||
val pos = checkText(text)
|
val pos = checkText(text)
|
||||||
when (pos) {
|
when (pos) {
|
||||||
NEW_COLLECTION -> {
|
NEW_COLLECTION -> {
|
||||||
|
@ -2814,7 +2808,7 @@ class CollectionFragment(
|
||||||
// speak("Orden no registrada")
|
// speak("Orden no registrada")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/*private fun speakOrder() {
|
/*private fun speakOrder() {
|
||||||
if (type == SACADOR) {
|
if (type == SACADOR) {
|
||||||
|
@ -2951,9 +2945,9 @@ class CollectionFragment(
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
override fun onDestroy() {
|
/* override fun onDestroy() {
|
||||||
cancelSpeech()
|
//cancelSpeech()
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,17 +120,17 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
||||||
)
|
)
|
||||||
|
|
||||||
//Tarea #3754 --> Falta arreglar la colección que se le pasa a ReubicationCollectionFragment
|
//Tarea #3754 --> Falta arreglar la colección que se le pasa a ReubicationCollectionFragment
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
1,
|
1,
|
||||||
R.drawable.ic_reubication,
|
R.drawable.ic_reubication,
|
||||||
contextApp.getString(R.string.titleReUbicator),
|
contextApp.getString(R.string.titleReUbicator),
|
||||||
R.string.titleReUbicator,
|
R.string.titleReUbicator,
|
||||||
contextApp.getString(
|
contextApp.getString(
|
||||||
R.string.titleReubicatorDescrip
|
R.string.titleReubicatorDescrip
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
|
@ -156,17 +156,17 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
//Tarea 4585
|
//Tarea 4585
|
||||||
/* _pasillerositem.add(
|
/* _pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
7,
|
7,
|
||||||
R.drawable.ic_packing_mistake,
|
R.drawable.ic_packing_mistake,
|
||||||
contextApp.getString(R.string.titlePackingMistake),
|
contextApp.getString(R.string.titlePackingMistake),
|
||||||
R.string.titlePackingMistake,
|
R.string.titlePackingMistake,
|
||||||
contextApp.getString(
|
contextApp.getString(
|
||||||
R.string.titlePackingMistakeDescrip
|
R.string.titlePackingMistakeDescrip
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)*/
|
||||||
)*/
|
|
||||||
|
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
|
@ -250,17 +250,17 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
||||||
)
|
)
|
||||||
|
|
||||||
//Tarea 3335 Borrat proced(Carles)
|
//Tarea 3335 Borrat proced(Carles)
|
||||||
/* _pasillerositem.add(
|
/* _pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
8,
|
8,
|
||||||
R.drawable.ic_baseline_star_24,
|
R.drawable.ic_baseline_star_24,
|
||||||
contextApp.getString(R.string.titleQuality),
|
contextApp.getString(R.string.titleQuality),
|
||||||
R.string.titleQuality,
|
R.string.titleQuality,
|
||||||
contextApp.getString(
|
contextApp.getString(
|
||||||
R.string.titleQualityDescrip
|
R.string.titleQualityDescrip
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)*/
|
)
|
||||||
|
)*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,15 +313,15 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
||||||
)
|
)
|
||||||
|
|
||||||
//Tarea #3986
|
//Tarea #3986
|
||||||
/* _pasillerositem.add(
|
/* _pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
31,
|
31,
|
||||||
R.drawable.ic_cmr,
|
R.drawable.ic_cmr,
|
||||||
contextApp.getString(R.string.titleCMRState),
|
contextApp.getString(R.string.titleCMRState),
|
||||||
R.string.titleCMRState,
|
R.string.titleCMRState,
|
||||||
contextApp.getString(R.string.titleCMRDescrip)
|
contextApp.getString(R.string.titleCMRDescrip)
|
||||||
)
|
)
|
||||||
)*/
|
)*/
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
40,
|
40,
|
||||||
|
@ -502,15 +502,15 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
||||||
val working_in_test=false
|
val working_in_test=false
|
||||||
|
|
||||||
if (working_in_test){
|
if (working_in_test){
|
||||||
_pasillerositem.add(
|
_pasillerositem.add(
|
||||||
PasillerosItemVO(
|
PasillerosItemVO(
|
||||||
6,
|
6,
|
||||||
R.drawable.ic_star_ko,
|
R.drawable.ic_star_ko,
|
||||||
contextApp.getString(R.string.testing),
|
contextApp.getString(R.string.testing),
|
||||||
R.string.testing,
|
R.string.testing,
|
||||||
contextApp.getString(R.string.testing)
|
contextApp.getString(R.string.testing)
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue