Version 9.2Beta-Controlador sin animacion y vuelve al sitio
This commit is contained in:
parent
efb565d32c
commit
13ca9e5c47
app
|
@ -13,8 +13,9 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21 //21
|
minSdkVersion 21 //21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 132
|
versionCode 133
|
||||||
versionName = "9.1Beta"
|
versionName = "9.2Beta"
|
||||||
|
//versionName = "9.1Beta" versionCode 132
|
||||||
//versionName = "9Beta"// versionCode 131
|
//versionName = "9Beta"// versionCode 131
|
||||||
//versionName = "8.9" versionCode 130
|
//versionName = "8.9" versionCode 130
|
||||||
//versionName = "8.9Beta" versionCode 129
|
//versionName = "8.9Beta" versionCode 129
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 132,
|
"versionCode": 133,
|
||||||
"versionName": "9.1Beta",
|
"versionName": "9.2Beta",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
Binary file not shown.
|
@ -13,12 +13,9 @@ import android.speech.RecognitionListener
|
||||||
import android.speech.RecognizerIntent
|
import android.speech.RecognizerIntent
|
||||||
import android.speech.SpeechRecognizer
|
import android.speech.SpeechRecognizer
|
||||||
import android.speech.tts.TextToSpeech
|
import android.speech.tts.TextToSpeech
|
||||||
import android.speech.tts.UtteranceProgressListener
|
|
||||||
import android.util.Log
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ImageView
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
|
@ -29,7 +26,6 @@ import com.google.gson.Gson
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ToolbarFragmentBinding
|
import es.verdnatura.databinding.ToolbarFragmentBinding
|
||||||
import es.verdnatura.domain.ConstAndValues
|
|
||||||
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.domain.toast
|
||||||
|
@ -38,6 +34,7 @@ import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import org.koin.androidx.viewmodel.ext.android.viewModel
|
import org.koin.androidx.viewmodel.ext.android.viewModel
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,6 +61,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
|
|
||||||
protected val ITEMPACKING = "itemPackingType"
|
protected val ITEMPACKING = "itemPackingType"
|
||||||
protected val ITEMPACKINGFK = "itemPackingTypeFk"
|
protected val ITEMPACKINGFK = "itemPackingTypeFk"
|
||||||
|
|
||||||
//protected val VOZ = "voz"
|
//protected val VOZ = "voz"
|
||||||
//nuevo campo número carros ajustes y campos para guardar el buyerid y buyernickname
|
//nuevo campo número carros ajustes y campos para guardar el buyerid y buyernickname
|
||||||
protected val BUYER = "buyernickname"
|
protected val BUYER = "buyernickname"
|
||||||
|
@ -133,8 +131,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
init()
|
init()
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
{
|
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
initDataBinding()
|
initDataBinding()
|
||||||
getBundleArguments()
|
getBundleArguments()
|
||||||
|
@ -148,7 +145,6 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
init()
|
init()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LayoutRes
|
@LayoutRes
|
||||||
|
@ -224,6 +220,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
return textScanned
|
return textScanned
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTooltip(image: Int): String {
|
fun getTooltip(image: Int): String {
|
||||||
|
|
||||||
return when (image) {
|
return when (image) {
|
||||||
|
@ -260,7 +257,9 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
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)
|
||||||
|
|
||||||
else -> {""}
|
else -> {
|
||||||
|
""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -465,15 +464,14 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
{ isGranted ->
|
{ isGranted ->
|
||||||
if (isGranted) {
|
if (isGranted) {
|
||||||
Timber.i("permisos ok")
|
Timber.i("permisos ok")
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
Timber.i("Denegados permisos")
|
Timber.i("Denegados permisos")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
permissionLauncher.launch(Manifest.permission.CALL_PHONE)
|
permissionLauncher.launch(Manifest.permission.CALL_PHONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun requestRecordAudioPermissionNew() {
|
private fun requestRecordAudioPermissionNew() {
|
||||||
|
|
||||||
val permissionLauncher = registerForActivityResult(
|
val permissionLauncher = registerForActivityResult(
|
||||||
|
@ -482,15 +480,14 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
{ isGranted ->
|
{ isGranted ->
|
||||||
if (isGranted) {
|
if (isGranted) {
|
||||||
Timber.i("permisos ok")
|
Timber.i("permisos ok")
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
Timber.i("Denegados permisos")
|
Timber.i("Denegados permisos")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
permissionLauncher.launch(Manifest.permission.RECORD_AUDIO)
|
permissionLauncher.launch(Manifest.permission.RECORD_AUDIO)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun requestCallPhonePermissionNew() {
|
private fun requestCallPhonePermissionNew() {
|
||||||
|
|
||||||
val permissionLauncher = registerForActivityResult(
|
val permissionLauncher = registerForActivityResult(
|
||||||
|
@ -499,9 +496,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
{ isGranted ->
|
{ isGranted ->
|
||||||
if (isGranted) {
|
if (isGranted) {
|
||||||
Timber.i("permisos ok")
|
Timber.i("permisos ok")
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
Timber.i("Denegados permisos")
|
Timber.i("Denegados permisos")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -512,16 +507,19 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
fun hideBackButton(tool: ToolbarFragmentBinding) {
|
fun hideBackButton(tool: ToolbarFragmentBinding) {
|
||||||
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)
|
||||||
return preferences.getString(key, null)
|
return preferences.getString(key, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getData(name: String): String {
|
fun getData(name: String): String {
|
||||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
return when (name) {
|
return when (name) {
|
||||||
|
@ -557,7 +555,9 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
preferences.getString(getString(R.string.base_urlSalix), "").toString()
|
preferences.getString(getString(R.string.base_urlSalix), "").toString()
|
||||||
}
|
}
|
||||||
else -> {""}
|
else -> {
|
||||||
|
""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -570,6 +570,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
editor.remove(WAREHOUSEFK).commit()
|
editor.remove(WAREHOUSEFK).commit()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setDefaults(key: String?, value: String?, context: Context?) {
|
fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||||
|
|
||||||
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
@ -585,6 +586,7 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
editor.remove(PRINTERNAME).commit()
|
editor.remove(PRINTERNAME).commit()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun saveData(name: String, value: String) {
|
fun saveData(name: String, value: String) {
|
||||||
|
|
||||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
@ -632,6 +634,20 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun saveWorkingForms(list: ArrayList<String>) {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val editor = prefs.edit()
|
||||||
|
editor.putString("workingForms", list.toString())
|
||||||
|
editor.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getWorkingForms(): Array<String> {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val jsonStr: String? = prefs.getString("workingForms", null)
|
||||||
|
val gson = Gson()
|
||||||
|
val lista: Array<String> = gson.fromJson(jsonStr, Array<String>::class.java)
|
||||||
|
return lista
|
||||||
|
}
|
||||||
|
|
||||||
fun saveBuyer(buyernickname: String) {
|
fun saveBuyer(buyernickname: String) {
|
||||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.speech.SpeechRecognizer
|
import android.speech.SpeechRecognizer
|
||||||
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
|
@ -150,6 +151,8 @@ class CollectionFragment(
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
|
||||||
|
if (type==CONTROLADOR && storedBackPosition!=0){
|
||||||
|
setListPosition(storedBackPosition, true)}
|
||||||
super.onResume()
|
super.onResume()
|
||||||
scanRequest()
|
scanRequest()
|
||||||
}
|
}
|
||||||
|
@ -1394,7 +1397,7 @@ class CollectionFragment(
|
||||||
private fun saleTrackingReplace(position: Int, type: String) {
|
private fun saleTrackingReplace(position: Int, type: String) {
|
||||||
|
|
||||||
//Tarea #4371 se quita para ver si funciona correctamente
|
//Tarea #4371 se quita para ver si funciona correctamente
|
||||||
binding.splashProgress.visibility=VISIBLE
|
//binding.splashProgress.visibility=VISIBLE
|
||||||
viewModel.saleTrackingReplace(
|
viewModel.saleTrackingReplace(
|
||||||
getData(USER),
|
getData(USER),
|
||||||
getData(PASSWORD),
|
getData(PASSWORD),
|
||||||
|
|
|
@ -2,10 +2,12 @@ package es.verdnatura.presentation.view.feature.login.fragment
|
||||||
|
|
||||||
//import es.verdnatura.presentation.view.feature.login.model.LoginItemVO
|
//import es.verdnatura.presentation.view.feature.login.model.LoginItemVO
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.app.AlertDialog
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.content.pm.PackageInfo
|
import android.content.pm.PackageInfo
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
|
import android.icu.text.Transliterator
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
|
@ -23,6 +25,7 @@ import kotlinx.coroutines.*
|
||||||
import java.lang.Boolean.TRUE
|
import java.lang.Boolean.TRUE
|
||||||
import kotlin.system.exitProcess
|
import kotlin.system.exitProcess
|
||||||
|
|
||||||
|
|
||||||
class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
|
class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
|
||||||
|
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
|
@ -118,6 +121,9 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.edittextServer.setOnClickListener {
|
||||||
|
// showWorkingForms()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +136,57 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showWorkingForms() {
|
||||||
|
|
||||||
|
/*Log.d("VERDNATURA::", "click")*/
|
||||||
|
val listForms: ArrayList<workForms> = ArrayList()
|
||||||
|
|
||||||
|
listForms.add(
|
||||||
|
workForms(
|
||||||
|
"Producción",
|
||||||
|
"https://app.verdnatura.es",
|
||||||
|
"https://salix.verdnatura.es"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
listForms.add(
|
||||||
|
workForms(
|
||||||
|
"Test",
|
||||||
|
"https://test-app.verdnatura.es",
|
||||||
|
"https://test-salix.verdnatura.es"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
listForms.add(workForms("Añadir otra forma", " ", " "))
|
||||||
|
|
||||||
|
val array = arrayOfNulls<String>(listForms.size)
|
||||||
|
var showList: ArrayList<String> = ArrayList()
|
||||||
|
|
||||||
|
for (l in listForms){
|
||||||
|
showList.add(l.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
val builder = AlertDialog.Builder(this.context)
|
||||||
|
builder.setTitle(getString(R.string.selectWorkingForm))
|
||||||
|
builder.setItems(showList.toArray(array)) { _, which ->
|
||||||
|
val selected = array[which]
|
||||||
|
showList.forEach {
|
||||||
|
if (it == selected) {
|
||||||
|
|
||||||
|
binding.edittextServer.setText(it)
|
||||||
|
saveData(
|
||||||
|
"base_urlSalix",
|
||||||
|
it)
|
||||||
|
|
||||||
|
return@forEach
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
val dialog = builder.create()
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkUser() {
|
private fun checkUser() {
|
||||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
if (prefs.getBoolean(REMEMBER, false)) {
|
if (prefs.getBoolean(REMEMBER, false)) {
|
||||||
|
@ -490,3 +547,5 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data class workForms(val name: String, val urlSilex: String, val urlSalix: String)
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textColorHint="@android:color/darker_gray" />
|
android:textColorHint="@android:color/darker_gray" />
|
||||||
|
<!-- android:drawableRight="@drawable/ic_chevron_right_black_24dp" -->
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
@ -176,6 +177,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@color/verdnatura_black_8_alpha_6"
|
android:background="@color/verdnatura_black_8_alpha_6"
|
||||||
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
|
@ -479,4 +479,5 @@
|
||||||
<string name="itemFilter">Filtro ítem</string>
|
<string name="itemFilter">Filtro ítem</string>
|
||||||
<string name="itemUpdated">Actualizado</string>
|
<string name="itemUpdated">Actualizado</string>
|
||||||
<string name="errorCmrNotScanned">CMR no escaneado</string>
|
<string name="errorCmrNotScanned">CMR no escaneado</string>
|
||||||
|
<string name="selectWorkingForm">Selecciona la forma de trabajo:</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -93,6 +93,7 @@
|
||||||
<string name="packingType">Packing type</string>
|
<string name="packingType">Packing type</string>
|
||||||
<string name="sinubicar">Downstairs</string>
|
<string name="sinubicar">Downstairs</string>
|
||||||
<string name="Seleccionauncarro">Select a wagon</string>
|
<string name="Seleccionauncarro">Select a wagon</string>
|
||||||
|
<string name="selectWorkingForm">Select a way of work :</string>
|
||||||
<string name="itemShelvingRadar">Inventory Radar</string>
|
<string name="itemShelvingRadar">Inventory Radar</string>
|
||||||
<string name="buscarcomprador">Search buyer</string>
|
<string name="buscarcomprador">Search buyer</string>
|
||||||
<string name="escribirparteNombre">Write here</string>
|
<string name="escribirparteNombre">Write here</string>
|
||||||
|
|
Loading…
Reference in New Issue