feat issues refs #7636
This commit is contained in:
parent
e47c6da01e
commit
da3bff7f17
|
@ -52,8 +52,7 @@ class ItemCardFragment(
|
||||||
private var itemsPackingType: ArrayList<ItemPackingType> = ArrayList()
|
private var itemsPackingType: ArrayList<ItemPackingType> = ArrayList()
|
||||||
private var quantityToDiscard = 0
|
private var quantityToDiscard = 0
|
||||||
private var itemInfoG: ItemCardVO? = null
|
private var itemInfoG: ItemCardVO? = null
|
||||||
private var firstVisiblePositionX: Int = 0
|
private var positionToReturnY = 0
|
||||||
private var firstVisiblePositionY: Int = 0
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
|
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
|
||||||
|
@ -154,10 +153,7 @@ class ItemCardFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
|
|
||||||
firstVisiblePositionX = binding.scrollView.scrollX
|
|
||||||
firstVisiblePositionY = binding.scrollView.scrollY
|
|
||||||
}
|
|
||||||
binding.editItemFk.requestFocus()
|
binding.editItemFk.requestFocus()
|
||||||
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
@ -193,6 +189,7 @@ class ItemCardFragment(
|
||||||
i.putExtra(getString(R.string.title), titleImage)
|
i.putExtra(getString(R.string.title), titleImage)
|
||||||
startActivity(i)
|
startActivity(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getItemCard(itemValueFk: String) {
|
private fun getItemCard(itemValueFk: String) {
|
||||||
|
@ -377,6 +374,7 @@ class ItemCardFragment(
|
||||||
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
|
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
|
||||||
override fun onItemCardRowClickListener(item: ItemCardRowVO) {
|
override fun onItemCardRowClickListener(item: ItemCardRowVO) {
|
||||||
|
|
||||||
|
positionToReturnY = binding.scrollView.scrollY
|
||||||
when (item.action) {
|
when (item.action) {
|
||||||
"itemProposal" -> {
|
"itemProposal" -> {
|
||||||
ma.onPasillerosItemClickListener(
|
ma.onPasillerosItemClickListener(
|
||||||
|
@ -424,18 +422,17 @@ class ItemCardFragment(
|
||||||
binding.itemcardRecyclerview.adapter = adapter
|
binding.itemcardRecyclerview.adapter = adapter
|
||||||
binding.itemcardRecyclerview.layoutManager =
|
binding.itemcardRecyclerview.layoutManager =
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
binding.scrollView.post {
|
|
||||||
|
if (positionToReturnY == 0) binding.scrollView.post {
|
||||||
val position = IntArray(2)
|
val position = IntArray(2)
|
||||||
binding.itemcardImage.getLocationInWindow(position)
|
binding.itemcardImage.getLocationInWindow(position)
|
||||||
binding.scrollView.scrollTo(0, position[1])
|
binding.scrollView.scrollTo(0, position[1])
|
||||||
|
} else {
|
||||||
|
binding.scrollView.post {
|
||||||
|
binding.scrollView.smoothScrollTo(0, positionToReturnY)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
|
|
||||||
firstVisiblePositionX = binding.scrollView.scrollX
|
|
||||||
firstVisiblePositionY = binding.scrollView.scrollY
|
|
||||||
}
|
|
||||||
binding.scrollView.scrollTo(firstVisiblePositionX, firstVisiblePositionY)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showCustomDialog(item: ItemCardRowVO, textDescrip: String) {
|
private fun showCustomDialog(item: ItemCardRowVO, textDescrip: String) {
|
||||||
|
@ -561,8 +558,7 @@ class ItemCardFragment(
|
||||||
try {
|
try {
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
if (customDialogList.getValue().isNotEmpty()) updateBarcode(
|
if (customDialogList.getValue().isNotEmpty()) updateBarcode(
|
||||||
customDialogList.getValue(),
|
customDialogList.getValue(), false
|
||||||
false
|
|
||||||
)
|
)
|
||||||
customDialogList.setValue("")
|
customDialogList.setValue("")
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
@ -591,6 +587,4 @@ class ItemCardFragment(
|
||||||
customDynamic.cancel()
|
customDynamic.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1001,9 +1001,14 @@ class EndSacadorFragment(
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setOkButtonAdd(getString(R.string.Agregar)) {
|
.setOkButtonAdd(getString(R.string.Agregar)) {
|
||||||
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
try {
|
||||||
scanRequest()
|
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
||||||
customDialogThreeButtons.dismiss()
|
scanRequest()
|
||||||
|
customDialogThreeButtons.dismiss()
|
||||||
|
}catch (_:Exception){
|
||||||
|
getString(R.string.errorInput).toast(requireContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
scanRequest()
|
scanRequest()
|
||||||
|
|
Loading…
Reference in New Issue