refs #6964 refactor:settings
This commit is contained in:
parent
220c8e8062
commit
e67b6fbf12
|
@ -6,7 +6,6 @@ import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.MenuItem
|
|
||||||
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
|
||||||
|
@ -45,6 +44,7 @@ class UbicadorFragmentNew(
|
||||||
private var listItems: MutableList<ItemUbicador> = mutableListOf()
|
private var listItems: MutableList<ItemUbicador> = mutableListOf()
|
||||||
private var listLocalItems: ArrayList<ItemUbicador> = ArrayList()
|
private var listLocalItems: ArrayList<ItemUbicador> = ArrayList()
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
|
private lateinit var customDialogOlder: CustomDialog
|
||||||
private var parking: String = ""
|
private var parking: String = ""
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
private var isShelvinLogfromMainScreen = false
|
private var isShelvinLogfromMainScreen = false
|
||||||
|
@ -108,6 +108,7 @@ class UbicadorFragmentNew(
|
||||||
private fun setDialogs() {
|
private fun setDialogs() {
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
|
customDialogOlder = CustomDialog(requireContext())
|
||||||
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
|
customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,10 +391,13 @@ class UbicadorFragmentNew(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun customDialogActionParking() {
|
private fun customDialogActionParking() {
|
||||||
viewModel.setParking(
|
|
||||||
shelvingFk, customDialogInput.getValue()
|
|
||||||
)
|
|
||||||
parking = customDialogInput.getValue()
|
parking = customDialogInput.getValue()
|
||||||
|
//Tarea 6964
|
||||||
|
/* viewModel.hasItemOlder(shelvingFk,customDialogInput.getValue())*/
|
||||||
|
viewModel.setParking(
|
||||||
|
shelvingFk, customDialogInput.getValue()
|
||||||
|
)
|
||||||
|
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,6 +519,25 @@ class UbicadorFragmentNew(
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
responseHasOlder.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
|
ma.messageWithSound("",true,true,"",false)
|
||||||
|
customDialogOlder.setTitle(getString(R.string.info))
|
||||||
|
.setDescription(getString(R.string.itemOlderInfo, shelvingFk))
|
||||||
|
.setOkButton(
|
||||||
|
getString(R.string.ok)
|
||||||
|
) {
|
||||||
|
customDialogOlder.dismiss()
|
||||||
|
//customDialogActionParking()
|
||||||
|
viewModel.setParking(
|
||||||
|
shelvingFk, parking)
|
||||||
|
|
||||||
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
|
customDialogOlder.dismiss()
|
||||||
|
}.show()
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,10 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val response: LiveData<ResponseItemVO>
|
val response: LiveData<ResponseItemVO>
|
||||||
get() = _response
|
get() = _response
|
||||||
|
|
||||||
|
private val _responseHasOlder by lazy { MutableLiveData<Boolean>() }
|
||||||
|
val responseHasOlder: LiveData<Boolean>
|
||||||
|
get() = _responseHasOlder
|
||||||
|
|
||||||
private val _responsepriority by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responsepriority by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responsepriority: LiveData<ResponseItemVO>
|
val responsepriority: LiveData<ResponseItemVO>
|
||||||
get() = _responsepriority
|
get() = _responsepriority
|
||||||
|
@ -206,6 +210,24 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun hasItemOlder(
|
||||||
|
shelving: String,
|
||||||
|
parking: String
|
||||||
|
) {
|
||||||
|
salix.hasItemOlder(shelving,parking)
|
||||||
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
if (response.body() == false) {
|
||||||
|
setParking(shelving, parking)
|
||||||
|
} else {
|
||||||
|
_responseHasOlder.value = true
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun itemShelving_merge(
|
fun itemShelving_merge(
|
||||||
vShelf: Int, vShelvingFk: String
|
vShelf: Int, vShelvingFk: String
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue