refs #3520 feat:silex→salix

This commit is contained in:
Sergio De la torre 2024-04-19 08:53:41 +02:00
parent 0ae481ee4a
commit 0044fcfaa9
23 changed files with 340 additions and 923 deletions

View File

@ -16,7 +16,6 @@ abstract class BaseViewModel : ViewModel, LifecycleObserver {
constructor() : super() constructor() : super()
constructor(context: Context) : super() { constructor(context: Context) : super() {
app = context as MobileApplication app = context as MobileApplication
silex = app.silex
salix = app.salix salix = app.salix
} }
} }

View File

@ -15,7 +15,6 @@ import android.text.InputType.TYPE_CLASS_TEXT
import android.util.Log.d import android.util.Log.d
import android.view.KeyEvent import android.view.KeyEvent
import android.view.KeyEvent.ACTION_DOWN import android.view.KeyEvent.ACTION_DOWN
import android.view.View
import android.view.View.GONE import android.view.View.GONE
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.view.WindowManager import android.view.WindowManager
@ -78,8 +77,7 @@ import org.json.JSONObject
@Suppress("UNUSED_ANONYMOUS_PARAMETER") @Suppress("UNUSED_ANONYMOUS_PARAMETER")
class CollectionFragment( class CollectionFragment(
var collection: CollectionVO = CollectionVO(0), var collection: CollectionVO = CollectionVO(0), var type: String = SACADOR
var type: String = SACADOR
) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) { ) : BaseFragment<FragmentCollectionBinding, CollectionViewModel>(CollectionViewModel::class) {
private lateinit var dataMessageSalix: DataMessageSalix private lateinit var dataMessageSalix: DataMessageSalix
@ -160,9 +158,13 @@ class CollectionFragment(
collection.collectionFk collection.collectionFk
) )
//tarea 6458
viewModel.ticketState(collection.collectionFk) viewModel.ticketState(collection.collectionFk)
workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk try {
workerFkFromTicket = collection.tickets[0].sales[0].workerFk
} catch (ex: Exception) {
getString(R.string.ticketWithoutWorker).toast(requireContext())
}
} }
if (collection.tickets.isEmpty()) { if (collection.tickets.isEmpty()) {
@ -188,7 +190,7 @@ class CollectionFragment(
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
ma.hideBottomNavigation(GONE) ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = VISIBLE
setEvents() setEvents()
setToolBar() setToolBar()
if (collection.tickets.isNotEmpty()) { if (collection.tickets.isNotEmpty()) {
@ -285,7 +287,7 @@ class CollectionFragment(
private fun updateScreen() { private fun updateScreen() {
canChangeState = false canChangeState = false
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -351,7 +353,6 @@ class CollectionFragment(
private fun getCollection() { private fun getCollection() {
binding.splashProgress.visibility = VISIBLE
if (!buttonPushedGetCollection) { if (!buttonPushedGetCollection) {
//Tarea 3520 //Tarea 3520
viewModel.collectionGetId( viewModel.collectionGetId(
@ -360,12 +361,6 @@ class CollectionFragment(
print = "0", print = "0",
type type
) )
/* viewModel.collection_get(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
print = "0",
type
)*/
buttonPushedGetCollection = true buttonPushedGetCollection = true
} else { } else {
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
@ -453,7 +448,7 @@ class CollectionFragment(
isMarking = false isMarking = false
binding.collectionSwipe.isRefreshing = false binding.collectionSwipe.isRefreshing = false
// if (type != PRECHECKER) { // if (type != PRECHECKER) {
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -490,7 +485,7 @@ class CollectionFragment(
@RequiresApi(Build.VERSION_CODES.O) @RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
binding.splashProgress.visibility = GONE
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
if (!it.isError) { if (!it.isError) {
@ -513,38 +508,36 @@ class CollectionFragment(
}) })
responseUsedShelves.observe(viewLifecycleOwner, Observer { responseUsedShelves.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
ma.messageWithSound( ma.messageWithSound(
if (it.isError) it.errorMessage else getString(R.string.savedShelves), if (it.isError) it.errorMessage else getString(R.string.savedShelves),
it.isError, true it.isError,
true
) )
} }
}) })
responseParking.observe(viewLifecycleOwner, Observer { responseParking.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
binding.splashProgress.visibility = GONE
ma.messageWithSound( ma.messageWithSound(
if (it.isError) it.errorMessage else getString(R.string.Aparcado), if (it.isError) it.errorMessage else getString(R.string.Aparcado),
it.isError, true it.isError,
true
) )
} }
}) })
responsePrint.observe(viewLifecycleOwner, Observer { responsePrint.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.isError) { if (it.isError) {
ma.messageWithSound( ma.messageWithSound(
it.errorMessage, it.errorMessage, it.isError, true
it.isError, true
) )
} else { } else {
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>( (getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
@ -558,19 +551,16 @@ class CollectionFragment(
}) })
responseSplit.observe(viewLifecycleOwner) { responseSplit.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.isError) { if (it.isError) {
ma.messageWithSound( ma.messageWithSound(
it.errorMessage, it.errorMessage, it.isError, true
it.isError, true
) )
} else { } else {
ma.messageWithSound( ma.messageWithSound(
getString(R.string.splitOk), getString(R.string.splitOk), it.isError, true
it.isError, true
) )
//responseSaleMoveSuccesful() //responseSaleMoveSuccesful()
} }
@ -585,7 +575,7 @@ class CollectionFragment(
ma.messageWithSound(it.errorMessage, true, true) ma.messageWithSound(it.errorMessage, true, true)
} else { } else {
ma.messageWithSound(getString(R.string.previousCollected), false, true) ma.messageWithSound(getString(R.string.previousCollected), false, true)
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -595,19 +585,19 @@ class CollectionFragment(
} }
}) })
placementSuppleyList.observe(viewLifecycleOwner, Observer { placementSuppleyList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) printShelvingResult(it) if (!goBack) printShelvingResult(it)
goBack = false goBack = false
}) })
item.observe(viewLifecycleOwner, Observer { item.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) toastDisponibility(it) if (!goBack) toastDisponibility(it)
goBack = false goBack = false
}) })
responseNew.observe(viewLifecycleOwner, Observer { responseNew.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
// if (!goBack) { // if (!goBack) {
if (it.isError) { if (it.isError) {
customDialog.setTitle(getString(R.string.disponibility)) customDialog.setTitle(getString(R.string.disponibility))
@ -618,10 +608,6 @@ class CollectionFragment(
}.show() }.show()
} else { } else {
binding.splashProgress.visibility =
VISIBLE
if (!goBack) { if (!goBack) {
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
@ -639,7 +625,7 @@ class CollectionFragment(
}) })
responseCode.observe(viewLifecycleOwner, Observer { responseCode.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
if (!goBack2) { if (!goBack2) {
if (it.isError) { if (it.isError) {
customDialog.setTitle(getString(R.string.error)) customDialog.setTitle(getString(R.string.error))
@ -674,7 +660,7 @@ class CollectionFragment(
}) })
responseTicketState.observe(viewLifecycleOwner) { responseTicketState.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if ((it.code == "ON_CHECKING" || it.code == "CHECKED") && it.user.id != mobileApplication.userId) { if ((it.code == "ON_CHECKING" || it.code == "CHECKED") && it.user.id != mobileApplication.userId) {
var customDialogWarningChecking = CustomDialog(requireContext()) var customDialogWarningChecking = CustomDialog(requireContext())
@ -685,8 +671,7 @@ class CollectionFragment(
} else { } else {
getString(R.string.checkedByUser, it.user.username) getString(R.string.checkedByUser, it.user.username)
} }
) ).setOkButton(getString(R.string.aware)) {
.setOkButton(getString(R.string.aware)) {
customDialogWarningChecking.dismiss() customDialogWarningChecking.dismiss()
}.show() }.show()
} }
@ -695,7 +680,7 @@ class CollectionFragment(
} }
responseTicketClosure.observe(viewLifecycleOwner, Observer { responseTicketClosure.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.response.toBoolean()) { if (it.response.toBoolean()) {
var customDialogWarning = CustomDialog(requireContext()) var customDialogWarning = CustomDialog(requireContext())
@ -732,9 +717,7 @@ class CollectionFragment(
} else { } else {
ma.messageWithSound( ma.messageWithSound(
getString(R.string.errorRegistered), getString(R.string.errorRegistered), isError = false, false
isError = false,
false
) )
goBack = true goBack = true
} }
@ -744,19 +727,15 @@ class CollectionFragment(
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer { responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
if (!goMistakeBack) if (!goMistakeBack) ma.messageWithSound(
ma.messageWithSound(
getString(R.string.noSIP) + it.errorMessage + getString(R.string.user) + workerFkFromTicket, getString(R.string.noSIP) + it.errorMessage + getString(R.string.user) + workerFkFromTicket,
isError = true, isError = true,
true true
) )
} else { } else {
if (!goMistakeBack) if (!goMistakeBack) callPicker(it.response)
callPicker(it.response)
} }
goMistakeBack = true goMistakeBack = true
@ -764,17 +743,13 @@ class CollectionFragment(
mistakeList.observe(viewLifecycleOwner, Observer { mistakeList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
/*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */
if (!goMistakeBack) if (!goMistakeBack) showMistakeList(it.list)
showMistakeList(it.list)
goMistakeBack = true goMistakeBack = true
}) })
//sergio: para si hay algun ticket por revisar antes de parkinear //sergio: para si hay algun ticket por revisar antes de parkinear
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer { responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, false) ma.messageWithSound(it.errorMessage, it.isError, false)
@ -787,9 +762,7 @@ class CollectionFragment(
.setOkButton(getString(R.string.accept)) { .setOkButton(getString(R.string.accept)) {
customDialog.dismiss() customDialog.dismiss()
} }.setKoButton(getString(R.string.review)) {
.setKoButton(getString(R.string.review)) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
it.response.toInt(), it.response.toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -801,8 +774,7 @@ class CollectionFragment(
customDialog.show() customDialog.show()
} else { } else {
viewModel.setParking( viewModel.setParking(
ticketFk = tickets[0].toInt(), ticketFk = tickets[0].toInt(), parking = ticketScanTxt
parking = ticketScanTxt
) )
} }
// if (!goBack)navigateToCollectionList(it) // if (!goBack)navigateToCollectionList(it)
@ -812,9 +784,8 @@ class CollectionFragment(
loadResponseDel.observe(viewLifecycleOwner) { event -> loadResponseDel.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, false) ma.messageWithSound(it.errorMessage, it.isError, false)
@ -837,7 +808,7 @@ class CollectionFragment(
/* responseDel.observe(viewLifecycleOwner, Observer { /* responseDel.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, false) ma.messageWithSound(it.errorMessage, it.isError, false)
@ -874,14 +845,13 @@ class CollectionFragment(
responseSaleReplace.observe(viewLifecycleOwner, Observer { responseSaleReplace.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true) ma.messageWithSound(it.errorMessage, it.isError, true)
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -903,12 +873,12 @@ class CollectionFragment(
loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event -> loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true) ma.messageWithSound(it.errorMessage, it.isError, true)
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -982,7 +952,6 @@ class CollectionFragment(
state = 0 state = 0
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString() binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
binding.splashProgress.visibility = View.GONE
var salesList: ArrayList<SaleVO> = ArrayList() var salesList: ArrayList<SaleVO> = ArrayList()
tickets = ArrayList() tickets = ArrayList()
var observations = "" var observations = ""
@ -991,8 +960,9 @@ class CollectionFragment(
ticket.sales.forEach { saleVO -> ticket.sales.forEach { saleVO ->
if (type == SACADOR && saleVO.quantity != 0) { if (type == SACADOR && saleVO.quantity != 0) {
salesList.add(saleVO) salesList.add(saleVO)
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty()) if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty()) tickets.add(
tickets.add(saleVO.ticketFk) saleVO.ticketFk
)
} else if (type == CONTROLADOR) { } else if (type == CONTROLADOR) {
salesList.add(saleVO) salesList.add(saleVO)
//Tarea 6607 //Tarea 6607
@ -1002,19 +972,21 @@ class CollectionFragment(
} else { } else {
saleVO.packingChecked = 1 saleVO.packingChecked = 1
}*/ }*/
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty()) if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty()) tickets.add(
tickets.add(saleVO.ticketFk) saleVO.ticketFk
)
} else if (type == PRECHECKER) { } else if (type == PRECHECKER) {
if (saleVO.saleGroupFk != "") { if (saleVO.saleGroupFk != "") {
salesList.add(saleVO) salesList.add(saleVO)
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty()) if (tickets.firstOrNull { it == saleVO.ticketFk }
tickets.add(saleVO.ticketFk) .isNullOrEmpty()) tickets.add(saleVO.ticketFk)
} }
} }
} }
observations = observations.takeIf { !it.isNullOrBlank() }?.plus(" ${ticket.observations}") ?: "" observations =
}//} observations.takeIf { !it.isNullOrBlank() }?.plus(" ${ticket.observations}") ?: ""
}
sales = salesList.sortedWith(compareBy({ it.saleOrder })) sales = salesList.sortedWith(compareBy({ it.saleOrder }))
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder })) myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder }))
@ -1031,8 +1003,7 @@ class CollectionFragment(
} else { } else {
myGroupList myGroupList
},*/ },*/
saleAdapter = saleAdapter = SaleAdapter(
SaleAdapter(
myGroupList, myGroupList,
pasillerosItemClickListener!!, pasillerosItemClickListener!!,
object : OnQuantityClickListener { object : OnQuantityClickListener {
@ -1078,7 +1049,7 @@ class CollectionFragment(
object : OnMistakeClickListener { object : OnMistakeClickListener {
override fun onMistakeClickListener(sale: SaleVO) { override fun onMistakeClickListener(sale: SaleVO) {
//Tarea #4969 //Tarea #4969
binding.splashProgress.visibility = VISIBLE
viewModel.mistakeType() viewModel.mistakeType()
mistakeSale = sale mistakeSale = sale
goMistakeBack = false goMistakeBack = false
@ -1096,8 +1067,7 @@ class CollectionFragment(
var entryPoint = Gson().toJson( var entryPoint = Gson().toJson(
mutableMapOf( mutableMapOf(
"entryPoint" to sale.ticketFk, "entryPoint" to sale.ticketFk, "web" to "${
"web" to "${
mobileApplication.dataStoreApp.getServerSalix() mobileApplication.dataStoreApp.getServerSalix()
}/#!/ticket/${sale.ticketFk}/sale" }/#!/ticket/${sale.ticketFk}/sale"
) )
@ -1109,7 +1079,8 @@ class CollectionFragment(
) )
} }
} }
}, type = type },
type = type
) )
@ -1133,10 +1104,8 @@ class CollectionFragment(
if (type == SACADOR) { if (type == SACADOR) {
setStoredPosition(true) setStoredPosition(true)
} else { } else {
if (storedPosition != 0) if (storedPosition != 0) setListPosition(storedPosition, true)
setListPosition(storedPosition, true) else if (storedBackPosition != 0) setListPosition(storedBackPosition, true)
else if (storedBackPosition != 0)
setListPosition(storedBackPosition, true)
} }
} }
@ -1223,8 +1192,7 @@ class CollectionFragment(
if (tickets.size > 0) { if (tickets.size > 0) {
viewModel.setParking( viewModel.setParking(
ticketFk = tickets[0].toInt(), ticketFk = tickets[0].toInt(), parking = txtscan
parking = txtscan
) )
} }
@ -1306,8 +1274,7 @@ class CollectionFragment(
it.itemFk == txtscan.toInt() it.itemFk == txtscan.toInt()
} }
if (!hasItemSales) { if (!hasItemSales) {
binding.splashProgress.visibility =
VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
myScan, myScan,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -1317,8 +1284,7 @@ class CollectionFragment(
if (type.equals(CONTROLADOR)) { if (type.equals(CONTROLADOR)) {
binding.splashProgress.visibility =
VISIBLE
viewModel.ticketIsOutClosureZone( viewModel.ticketIsOutClosureZone(
myScan myScan
) )
@ -1331,7 +1297,7 @@ class CollectionFragment(
} }
} catch (ex: Exception) { } catch (ex: Exception) {
binding.splashProgress.visibility = GONE
getString(R.string.errorInput).toast(requireContext()) getString(R.string.errorInput).toast(requireContext())
} }
@ -1365,8 +1331,7 @@ class CollectionFragment(
} }
shelvingIndex += 1 shelvingIndex += 1
} }
} }/*
/*
if (!isOk){ if (!isOk){
//3- Por barcode //3- Por barcode
saleVO.Barcodes.forEach { barcode -> saleVO.Barcodes.forEach { barcode ->
@ -1382,8 +1347,7 @@ class CollectionFragment(
if (txtscan.contains("-")) { if (txtscan.contains("-")) {
tickets.forEach { tickets.forEach {
viewModel.setParking( viewModel.setParking(
ticketFk = it.toInt(), ticketFk = it.toInt(), parking = txtscan
parking = txtscan
) )
} }
@ -1420,8 +1384,7 @@ class CollectionFragment(
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
saleTrackingReplace(position, newType) saleTrackingReplace(position, newType)
setListPosition(position, false) setListPosition(position, false)/* } else {
/* } else {
sales[position].packingChecked = sales[position].packingChecked - 1 sales[position].packingChecked = sales[position].packingChecked - 1
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
}*/ }*/
@ -1501,8 +1464,7 @@ class CollectionFragment(
SECTORDESCRIP SECTORDESCRIP
).uppercase() == getString( ).uppercase() == getString(
R.string.sectorALGEMESINEW R.string.sectorALGEMESINEW
) ) || type == PRECHECKER
|| type == PRECHECKER
) { ) {
var myPosition = position var myPosition = position
@ -1548,7 +1510,6 @@ 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
viewModel.saleTrackingReplace( viewModel.saleTrackingReplace(
saleFk = sales[position].saleFk, saleFk = sales[position].saleFk,
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1", isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
@ -1564,7 +1525,6 @@ class CollectionFragment(
//Tarea #4371 se quita para ver si funciona correctamente //Tarea #4371 se quita para ver si funciona correctamente
private fun saleTracking_mark(position: Int, type: String) { private fun saleTracking_mark(position: Int, type: String) {
binding.splashProgress.visibility = VISIBLE
viewModel.run { viewModel.run {
saleTracking_mark( saleTracking_mark(
saleFk = sales[position].saleFk, saleFk = sales[position].saleFk,
@ -1586,21 +1546,17 @@ class CollectionFragment(
state = 0 state = 0
if (sales[position].isPrepared == "1") { if (sales[position].isPrepared == "1") {
customDialog.setTitle(getString(R.string.unmarkLine)) customDialog.setTitle(getString(R.string.unmarkLine)).setDescription(
.setDescription(
getString(R.string.goUnmark) + sales[position].itemFk + getString( getString(R.string.goUnmark) + sales[position].itemFk + getString(
R.string.sure R.string.sure
) )
) ).setOkButton(getString(R.string.unmark)) {
.setOkButton(getString(R.string.unmark)) {
sales[position].isPrepared = "0" sales[position].isPrepared = "0"
sales[position].pickedQuantity = 0 sales[position].pickedQuantity = 0
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
setListPosition(position, false) setListPosition(position, false)
if (type != PRECHECKER) { if (type != PRECHECKER) {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingUpdateFromSale( viewModel.itemShelvingUpdateFromSale(
sales[position].saleFk sales[position].saleFk
) )
@ -1629,11 +1585,10 @@ class CollectionFragment(
private fun showShelving(position: Int, shelvingPosition: Int) { private fun showShelving(position: Int, shelvingPosition: Int) {
storedShelvingPosition = shelvingPosition storedShelvingPosition = shelvingPosition
storedPosition = position storedPosition = position
binding.splashProgress.visibility = VISIBLE
var quantityGet = 0 var quantityGet = 0
try { try {
quantityGet = quantityGet = (sales[position].quantity!! - sales[position].pickedQuantity!!.toInt())
(sales[position].quantity!! - sales[position].pickedQuantity!!.toInt())
} catch (e: Exception) { } catch (e: Exception) {
} }
//Log.i("VERDNATURA:","Aparece para enviar") //Log.i("VERDNATURA:","Aparece para enviar")
@ -1656,8 +1611,7 @@ class CollectionFragment(
if (!placementSupplyListVO.list.isEmpty()) { if (!placementSupplyListVO.list.isEmpty()) {
var placement: PlacementSupplyVO? = null var placement: PlacementSupplyVO? = null
placementSupplyListVO.list.forEach { placementVO -> placementSupplyListVO.list.forEach { placementVO ->
if (placementVO.stock != "0" && placement == null) if (placementVO.stock != "0" && placement == null) placement = placementVO
placement = placementVO
} }
if (placement != null) { if (placement != null) {
shelving = placement!!.shelving shelving = placement!!.shelving
@ -1670,8 +1624,7 @@ class CollectionFragment(
} }
listPlacementSupply = ArrayList() listPlacementSupply = ArrayList()
placementSupplyListVO.list.forEach { placementSupplyListVO.list.forEach {
if (it.stock != "0") if (it.stock != "0") listPlacementSupply.add(BarcodeVO(code = it.proposal))
listPlacementSupply.add(BarcodeVO(code = it.proposal))
//////Log.i("VERDNATURA:","Array de placementsupply") //////Log.i("VERDNATURA:","Array de placementsupply")
} }
try { try {
@ -1683,13 +1636,10 @@ class CollectionFragment(
) { ) {
if (customDialogList.getValueTwo().isNotEmpty()) { if (customDialogList.getValueTwo().isNotEmpty()) {
isScanned = false isScanned = false/*Tarea #5109*/
/*Tarea #5109*/
customDialogList.setValueTwo( customDialogList.setValueTwo(
itemScanValue( itemScanValue(
customDialogList.getValueTwo(), customDialogList.getValueTwo(), "buy", "more"
"buy",
"more"
).toString() ).toString()
) )
@ -1705,8 +1655,7 @@ class CollectionFragment(
if (checkItemScan(customDialogList.getValueTwo())) { if (checkItemScan(customDialogList.getValueTwo())) {
onQuantityOfShelvingSelected(itemShelvingFk) onQuantityOfShelvingSelected(itemShelvingFk)
//Log.i("VERDNATURA:","Cantidad seleccionada") //Log.i("VERDNATURA:","Cantidad seleccionada")
mpok?.start() mpok?.start()/* Se quita para comprobar al final de saleTracking_mark
/* Se quita para comprobar al final de saleTracking_mark
ReviewQuantityForRefreshingAndSorting( ReviewQuantityForRefreshingAndSorting(
customDialogList.getValue().toInt(), customDialogList.getValue().toInt(),
sales[storedPosition].quantity!!.toInt(), sales[storedPosition].quantity!!.toInt(),
@ -1715,8 +1664,7 @@ class CollectionFragment(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility =
VISIBLE
viewModel.getIdFromCodeSalix( viewModel.getIdFromCodeSalix(
code = customDialogList.getValueTwo(), code = customDialogList.getValueTwo(),
@ -1739,8 +1687,7 @@ class CollectionFragment(
hideKeyboards() hideKeyboards()
customDialogList.dismiss() customDialogList.dismiss()
}.setHintValue(getString(R.string.quantitySelect)).setValue(total) }.setHintValue(getString(R.string.quantitySelect)).setValue(total)
.setHintValueTwo(getString(R.string.scanItem)) .setHintValueTwo(getString(R.string.scanItem)).setValueTwo("").show()
.setValueTwo("").show()
} catch (e: Exception) { } catch (e: Exception) {
ma.messageWithSound(e.message.toString(), true, true) ma.messageWithSound(e.message.toString(), true, true)
} }
@ -1771,9 +1718,7 @@ class CollectionFragment(
customDialogList.setValueTwo( customDialogList.setValueTwo(
itemScanValue( itemScanValue(
customDialogList.getValueTwo(), customDialogList.getValueTwo(), "buy", "more"
"buy",
"more"
).toString() ).toString()
) )
@ -1789,8 +1734,7 @@ class CollectionFragment(
if (checkItemScan(customDialogList.getValueTwo())) { if (checkItemScan(customDialogList.getValueTwo())) {
onQuantityOfShelvingSelected(itemShelvingFk) onQuantityOfShelvingSelected(itemShelvingFk)
mpok?.start() mpok?.start()/* ReviewQuantityForRefreshingAndSorting(
/* ReviewQuantityForRefreshingAndSorting(
customDialogList.getValue().toInt(), customDialogList.getValue().toInt(),
sales[storedPosition].quantity!!.toInt(), sales[storedPosition].quantity!!.toInt(),
sales[storedPosition].pickedQuantity.toInt() sales[storedPosition].pickedQuantity.toInt()
@ -1800,7 +1744,6 @@ class CollectionFragment(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCodeSalix( viewModel.getIdFromCodeSalix(
@ -1831,10 +1774,8 @@ class CollectionFragment(
ma.messageWithSound(e.message.toString(), true, true) ma.messageWithSound(e.message.toString(), true, true)
} }
placementSupplyAdapter = placementSupplyAdapter = BarcodeAdapter(
BarcodeAdapter( listPlacementSupply, object : OnBarcodeRowClickListener {
listPlacementSupply,
object : OnBarcodeRowClickListener {
override fun onBarcodeRowClickListener(item: BarcodeVO) { override fun onBarcodeRowClickListener(item: BarcodeVO) {
placementSupplyListVO.list.forEach { placementSupplyListVO.list.forEach {
if (it.proposal == item.code) { if (it.proposal == item.code) {
@ -1856,8 +1797,7 @@ class CollectionFragment(
} }
private fun ReviewQuantityForRefreshingAndSorting( private fun ReviewQuantityForRefreshingAndSorting(
quantityTotal: Int, quantityTotal: Int, quantityPicked: Int
quantityPicked: Int
) { ) {
if (quantityPicked < quantityTotal) { if (quantityPicked < quantityTotal) {
@ -1876,8 +1816,7 @@ class CollectionFragment(
} }
private fun setStoredPosition(isFromBack: Boolean) { private fun setStoredPosition(isFromBack: Boolean) {/* if (type == SACADOR) {
/* if (type == SACADOR) {
for (indice in myGroupList.indices) { for (indice in myGroupList.indices) {
if (myGroupList[indice].isPrepared == "0") { if (myGroupList[indice].isPrepared == "0") {
@ -1898,12 +1837,10 @@ class CollectionFragment(
if (storedPosition >= 0 && sales.size > storedPosition) { if (storedPosition >= 0 && sales.size > storedPosition) {
val saleToCheck = sales[storedPosition] val saleToCheck = sales[storedPosition]
if (saleToCheck.itemFk.toString() == valueToCheck) if (saleToCheck.itemFk.toString() == valueToCheck) return true
return true
else { else {
saleToCheck.barcodes.forEach { barcode -> saleToCheck.barcodes.forEach { barcode ->
if (barcode == valueToCheck) if (barcode == valueToCheck) return true
return true
} }
} }
} }
@ -1917,8 +1854,7 @@ class CollectionFragment(
try { try {
val shelvingVisible = val shelvingVisible =
sales[storedPosition].placements[storedShelvingPosition].visible.substring( sales[storedPosition].placements[storedShelvingPosition].visible.substring(
1, 1, sales[storedPosition].placements[storedShelvingPosition].visible.indexOf(")")
sales[storedPosition].placements[storedShelvingPosition].visible.indexOf(")")
) )
if (quantity == 0) { if (quantity == 0) {
@ -1937,12 +1873,10 @@ class CollectionFragment(
try { try {
if (quantity == 0) { if (quantity == 0) {
sales[storedPosition].pickedQuantity = sales[storedPosition].pickedQuantity =
(sales[storedPosition].pickedQuantity!! + customDialogList.getValue() (sales[storedPosition].pickedQuantity!! + customDialogList.getValue().toInt())
.toInt())
} else { } else {
sales[storedPosition].pickedQuantity = sales[storedPosition].pickedQuantity =
(sales[storedPosition].pickedQuantity!! + quantity (sales[storedPosition].pickedQuantity!! + quantity.toInt())
.toInt())
} }
} catch (e: Exception) { } catch (e: Exception) {
} }
@ -2002,8 +1936,6 @@ class CollectionFragment(
) { ) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else { } else {
binding.splashProgress.visibility =
VISIBLE
//sergio datos para mensaje salix //sergio datos para mensaje salix
@ -2042,9 +1974,7 @@ class CollectionFragment(
try { try {
customDialogList.setValue( customDialogList.setValue(
itemScanValue( itemScanValue(
customDialogList.getValue(), customDialogList.getValue(), "buy", "more"
"buy",
"more"
).toString() ).toString()
) )
@ -2072,8 +2002,6 @@ class CollectionFragment(
) { ) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else { } else {
binding.splashProgress.visibility =
VISIBLE
dataMessageSalix = DataMessageSalix( dataMessageSalix = DataMessageSalix(
ticket = ticketSelected, ticket = ticketSelected,
@ -2142,8 +2070,7 @@ class CollectionFragment(
totalMark += 1 totalMark += 1
} }
} else if (type == CONTROLADOR) { } else if (type == CONTROLADOR) {
if ((it.isControlled == "1" || it.isControlled == "2") && !it.isParent) if ((it.isControlled == "1" || it.isControlled == "2") && !it.isParent) totalMark += 1
totalMark += 1
}//Refactor #4030 }//Refactor #4030
else if (type == PRECHECKER) { else if (type == PRECHECKER) {
@ -2187,8 +2114,7 @@ class CollectionFragment(
R.string.sectorALGEMESI R.string.sectorALGEMESI
) && sectorDesciption.uppercase() != getString( ) && sectorDesciption.uppercase() != getString(
R.string.sectorALGEMESINEW R.string.sectorALGEMESINEW
) )))
))
) { ) {
customDialogInput.setTitle(getString(R.string.shlevesNumber)) customDialogInput.setTitle(getString(R.string.shlevesNumber))
@ -2196,7 +2122,6 @@ class CollectionFragment(
.setOkButton(getString(R.string.accept)) { .setOkButton(getString(R.string.accept)) {
if (!customDialogInput.getValue().isNullOrEmpty()) { if (!customDialogInput.getValue().isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
viewModel.ticketCollection_setUsedShelves( viewModel.ticketCollection_setUsedShelves(
ticketFk = collection.collectionFk, ticketFk = collection.collectionFk,
usedShelves = customDialogInput.getValue().toInt() usedShelves = customDialogInput.getValue().toInt()
@ -2225,7 +2150,6 @@ class CollectionFragment(
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (!customDialogInput.getValue().isNullOrEmpty()) { if (!customDialogInput.getValue().isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
viewModel.ticketCollection_setUsedShelves( viewModel.ticketCollection_setUsedShelves(
ticketFk = collection.collectionFk, ticketFk = collection.collectionFk,
usedShelves = customDialogInput.getValue().toInt() usedShelves = customDialogInput.getValue().toInt()
@ -2251,8 +2175,7 @@ class CollectionFragment(
try { try {
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)) customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
.setValue("") .setValue("").setOkButtonAdd(getString(R.string.Agregar)) {
.setOkButtonAdd(getString(R.string.Agregar)) {
increaseQuantity(position, customDialogThreeButtons.getValue().toInt()) increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
scanRequest() scanRequest()
customDialogThreeButtons.dismiss() customDialogThreeButtons.dismiss()
@ -2273,8 +2196,7 @@ class CollectionFragment(
sales[positionCollectionMissing].quantity = quantityCollectionMissing sales[positionCollectionMissing].quantity = quantityCollectionMissing
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
if (quantityCollectionMissing == 0) if (quantityCollectionMissing == 0) markLine(positionCollectionMissing, type)
markLine(positionCollectionMissing, type)
var totalQuantity: Int = 0 var totalQuantity: Int = 0
try { try {
@ -2285,7 +2207,7 @@ class CollectionFragment(
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -2316,8 +2238,7 @@ class CollectionFragment(
quantityIncrease = quantity quantityIncrease = quantity
viewModel.collectionIncreaseQuantitySalix( viewModel.collectionIncreaseQuantitySalix(
saleFk = sales[position].saleFk, saleFk = sales[position].saleFk, quantity = quantity.toString()
quantity = quantity.toString()
) )
} }
@ -2327,15 +2248,13 @@ class CollectionFragment(
if (type == CONTROLADOR) { if (type == CONTROLADOR) {
tickets.forEach { tickets.forEach {
viewModel.ticketStateTodaySetState( viewModel.ticketStateTodaySetState(
ticketFk = it.toInt(), ticketFk = it.toInt(), state = "CHECKED"
state = "CHECKED"
) )
} }
} else if (type == SACADOR) { } else if (type == SACADOR) {
tickets.forEach { tickets.forEach {
viewModel.ticketStateTodaySetState( viewModel.ticketStateTodaySetState(
ticketFk = it.toInt(), ticketFk = it.toInt(), state = "PREPARED"
state = "PREPARED"
) )
} }
////Refactor #4030 ////Refactor #4030
@ -2343,8 +2262,7 @@ class CollectionFragment(
} else if (type == PRECHECKER) { } else if (type == PRECHECKER) {
tickets.forEach { tickets.forEach {
viewModel.ticketStateTodaySetState( viewModel.ticketStateTodaySetState(
ticketFk = it.toInt(), ticketFk = it.toInt(), state = "PREVIOUS_CONTROLLED"
state = "PREVIOUS_CONTROLLED"
) )
} }
} }
@ -2404,8 +2322,7 @@ class CollectionFragment(
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10") val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
builder.setItems(labelCount) { dialog, which -> builder.setItems(labelCount) { dialog, which ->
viewModel.collectionStickerPrint( viewModel.collectionStickerPrint(
collectionFk = collection.collectionFk, collectionFk = collection.collectionFk, labelCount = (which + 1)
labelCount = (which + 1)
) )
(getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>( (getString(R.string.Imprimiendo) + mobileApplication.dataStoreApp.readDataStoreKey<String>(
PRINTERNAME PRINTERNAME
@ -2416,8 +2333,7 @@ class CollectionFragment(
dialog.show() dialog.show()
} else { } else {
viewModel.collectionStickerPrint( viewModel.collectionStickerPrint(
collectionFk = collection.collectionFk, collectionFk = collection.collectionFk, null
null
) )
} }
@ -2427,15 +2343,14 @@ class CollectionFragment(
private fun showMistakeList(list: List<MistakeTypeVO>) { private fun showMistakeList(list: List<MistakeTypeVO>) {
customDialogInput.dismiss() customDialogInput.dismiss()
binding.splashProgress.visibility = GONE //
listPlacementSupply = ArrayList() listPlacementSupply = ArrayList()
list.forEach { list.forEach {
listPlacementSupply.add(BarcodeVO(code = it.description)) listPlacementSupply.add(BarcodeVO(code = it.description))
} }
customDialogList.setTitle(getString(R.string.errorCause)) customDialogList.setTitle(getString(R.string.errorCause))
customDialogList.hideTextInput() customDialogList.hideTextInput().setKoButton(getString(R.string.cancel)) {
.setKoButton(getString(R.string.cancel)) {
scanRequest() scanRequest()
hideKeyboards() hideKeyboards()
listPlacementSupply.clear() listPlacementSupply.clear()
@ -2451,8 +2366,7 @@ class CollectionFragment(
if (it.description == item.code) { if (it.description == item.code) {
viewModel.saleMistakeAdd( viewModel.saleMistakeAdd(
saleFk = mistakeSale?.saleFk!!, saleFk = mistakeSale?.saleFk!!, typeFk = it.id
typeFk = it.id
) )

View File

@ -14,7 +14,6 @@ import android.text.InputType.TYPE_CLASS_NUMBER
import android.text.InputType.TYPE_CLASS_TEXT import android.text.InputType.TYPE_CLASS_TEXT
import android.view.KeyEvent import android.view.KeyEvent
import android.view.KeyEvent.ACTION_DOWN import android.view.KeyEvent.ACTION_DOWN
import android.view.View
import android.view.View.GONE import android.view.View.GONE
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.view.WindowManager import android.view.WindowManager
@ -183,7 +182,6 @@ class CollectionFragmentPreChecker(
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
ma.hideBottomNavigation(GONE) ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = VISIBLE
setEvents() setEvents()
setToolBar() setToolBar()
if (collection.tickets.isNotEmpty()) { if (collection.tickets.isNotEmpty()) {
@ -278,7 +276,6 @@ class CollectionFragmentPreChecker(
} }
private fun updateScreen() { private fun updateScreen() {
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -342,30 +339,6 @@ class CollectionFragmentPreChecker(
hideKeyboard() hideKeyboard()
} }
/* private fun getCollection() {
binding.splashProgress.visibility = VISIBLE
if (!buttonPushedGetCollection) {
//Tarea 3520
viewModel.collection_get(
collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
print = "0",
type
)
buttonPushedGetCollection = true
} else {
viewModel.collectionTicketGet(
lastScanned,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
print = "0",
type
)
buttonPushedGetCollection = false
}
lastScanned = collection.collectionFk
}*/
private fun scanRequest() { private fun scanRequest() {
binding.scanInput.requestFocus() binding.scanInput.requestFocus()
@ -473,7 +446,7 @@ class CollectionFragmentPreChecker(
isMarking = false isMarking = false
binding.collectionSwipe.isRefreshing = false binding.collectionSwipe.isRefreshing = false
// if (type != PRECHECKER) { // if (type != PRECHECKER) {
binding.splashProgress.visibility = VISIBLE //
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -510,7 +483,7 @@ class CollectionFragmentPreChecker(
@RequiresApi(Build.VERSION_CODES.O) @RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
binding.splashProgress.visibility = GONE //
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
if (!it.isError) { if (!it.isError) {
@ -533,7 +506,7 @@ class CollectionFragmentPreChecker(
}) })
responseUsedShelves.observe(viewLifecycleOwner, Observer { responseUsedShelves.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE //
if (!goBack) { if (!goBack) {
ma.messageWithSound( ma.messageWithSound(
@ -544,10 +517,10 @@ class CollectionFragmentPreChecker(
}) })
responseParking.observe(viewLifecycleOwner, Observer { responseParking.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE //
if (!goBack) { if (!goBack) {
binding.splashProgress.visibility = GONE //
ma.messageWithSound( ma.messageWithSound(
if (it.isError) it.errorMessage else getString(R.string.Aparcado), if (it.isError) it.errorMessage else getString(R.string.Aparcado),
it.isError, true it.isError, true
@ -557,7 +530,7 @@ class CollectionFragmentPreChecker(
}) })
responsePrint.observe(viewLifecycleOwner, Observer { responsePrint.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE //
if (!goBack) { if (!goBack) {
@ -578,7 +551,7 @@ class CollectionFragmentPreChecker(
}) })
responseSplit.observe(viewLifecycleOwner) { responseSplit.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE //
if (!goBack) { if (!goBack) {
@ -605,7 +578,7 @@ class CollectionFragmentPreChecker(
ma.messageWithSound(it.errorMessage, true, true) ma.messageWithSound(it.errorMessage, true, true)
} else { } else {
ma.messageWithSound(getString(R.string.previousCollected), false, true) ma.messageWithSound(getString(R.string.previousCollected), false, true)
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -615,19 +588,17 @@ class CollectionFragmentPreChecker(
} }
}) })
placementSuppleyList.observe(viewLifecycleOwner, Observer { placementSuppleyList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) printShelvingResult(it) if (!goBack) printShelvingResult(it)
goBack = false goBack = false
}) })
item.observe(viewLifecycleOwner, Observer { item.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) toastDisponibility(it) if (!goBack) toastDisponibility(it)
goBack = false goBack = false
}) })
responseNew.observe(viewLifecycleOwner, Observer { responseNew.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
// if (!goBack) { // if (!goBack) {
if (it.isError) { if (it.isError) {
customDialog.setTitle(getString(R.string.disponibility)) customDialog.setTitle(getString(R.string.disponibility))
@ -638,10 +609,6 @@ class CollectionFragmentPreChecker(
}.show() }.show()
} else { } else {
binding.splashProgress.visibility =
VISIBLE
if (!goBack) { if (!goBack) {
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
@ -660,7 +627,7 @@ class CollectionFragmentPreChecker(
}) })
responseCode.observe(viewLifecycleOwner, Observer { responseCode.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
if (!goBack2) { if (!goBack2) {
if (it.isError) { if (it.isError) {
customDialog.setTitle(getString(R.string.error)) customDialog.setTitle(getString(R.string.error))
@ -711,7 +678,7 @@ class CollectionFragmentPreChecker(
})*/ })*/
//Tarea 4280 //Tarea 4280
responseTicketClosure.observe(viewLifecycleOwner, Observer { responseTicketClosure.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE //
if (!goBack) { if (!goBack) {
if (it.response.toBoolean()) { if (it.response.toBoolean()) {
var customDialogWarning = CustomDialog(requireContext()) var customDialogWarning = CustomDialog(requireContext())
@ -771,7 +738,6 @@ class CollectionFragmentPreChecker(
})*/ })*/
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer { responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
if (!goMistakeBack) if (!goMistakeBack)
@ -791,7 +757,7 @@ class CollectionFragmentPreChecker(
mistakeList.observe(viewLifecycleOwner, Observer { mistakeList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
/*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */ /*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */
if (!goMistakeBack) if (!goMistakeBack)
@ -801,7 +767,7 @@ class CollectionFragmentPreChecker(
//sergio: para si hay algun ticket por revisar antes de parkinear //sergio: para si hay algun ticket por revisar antes de parkinear
responseCollectionUnchecked.observe(viewLifecycleOwner, Observer { responseCollectionUnchecked.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE //
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, false) ma.messageWithSound(it.errorMessage, it.isError, false)
@ -816,7 +782,7 @@ class CollectionFragmentPreChecker(
} }
.setKoButton(getString(R.string.review)) { .setKoButton(getString(R.string.review)) {
binding.splashProgress.visibility = View.VISIBLE //
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
it.response.toInt(), it.response.toInt(),
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -839,9 +805,8 @@ class CollectionFragmentPreChecker(
loadResponseDel.observe(viewLifecycleOwner) { event -> loadResponseDel.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = View.INVISIBLE
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, false) ma.messageWithSound(it.errorMessage, it.isError, false)
@ -863,7 +828,7 @@ class CollectionFragmentPreChecker(
/* responseDel.observe(viewLifecycleOwner, Observer { /* responseDel.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (it.isError) {
binding.splashProgress.visibility = GONE //
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, false) ma.messageWithSound(it.errorMessage, it.isError, false)
@ -898,14 +863,13 @@ class CollectionFragmentPreChecker(
responseSaleReplace.observe(viewLifecycleOwner, Observer { responseSaleReplace.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true) ma.messageWithSound(it.errorMessage, it.isError, true)
binding.splashProgress.visibility = VISIBLE //
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -927,12 +891,12 @@ class CollectionFragmentPreChecker(
loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event -> loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true) ma.messageWithSound(it.errorMessage, it.isError, true)
binding.splashProgress.visibility = VISIBLE //
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -1014,7 +978,6 @@ class CollectionFragmentPreChecker(
state = 0 state = 0
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString() binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
binding.splashProgress.visibility = View.GONE
var salesList: ArrayList<SaleVO> = ArrayList() var salesList: ArrayList<SaleVO> = ArrayList()
tickets = ArrayList() tickets = ArrayList()
var observations = "" var observations = ""
@ -1100,7 +1063,7 @@ class CollectionFragmentPreChecker(
object : OnMistakeClickListener { object : OnMistakeClickListener {
override fun onMistakeClickListener(sale: SaleVO) { override fun onMistakeClickListener(sale: SaleVO) {
//Tarea #4969 //Tarea #4969
binding.splashProgress.visibility = VISIBLE
viewModel.mistakeType() viewModel.mistakeType()
mistakeSale = sale mistakeSale = sale
goMistakeBack = false goMistakeBack = false
@ -1299,8 +1262,6 @@ class CollectionFragmentPreChecker(
} }
} else { } else {
binding.splashProgress.visibility =
VISIBLE
storedPosition = 0 storedPosition = 0
storedBackPosition = 0 storedBackPosition = 0
// if (type != PRECHECKER) { // if (type != PRECHECKER) {
@ -1314,7 +1275,7 @@ class CollectionFragmentPreChecker(
) )
} catch (ex: Exception) { } catch (ex: Exception) {
binding.splashProgress.visibility = GONE
ma.messageWithSound( ma.messageWithSound(
getString(R.string.error), getString(R.string.error),
isError = false, isError = false,
@ -1520,7 +1481,6 @@ class CollectionFragmentPreChecker(
} }
private fun saleTrackingReplace(position: Int, type: String) { private fun saleTrackingReplace(position: Int, type: String) {
//binding.splashProgress.visibility=VISIBLE
viewModel.saleTrackingReplace( viewModel.saleTrackingReplace(
saleFk = sales[position].saleFk, saleFk = sales[position].saleFk,
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1", isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
@ -1536,7 +1496,7 @@ class CollectionFragmentPreChecker(
//Tarea #4371 se quita para ver si funciona correctamente //Tarea #4371 se quita para ver si funciona correctamente
private fun saleTracking_mark(position: Int, type: String) { private fun saleTracking_mark(position: Int, type: String) {
binding.splashProgress.visibility = VISIBLE
viewModel.run { viewModel.run {
saleTracking_mark( saleTracking_mark(
saleFk = sales[position].saleFk, saleFk = sales[position].saleFk,
@ -1566,7 +1526,7 @@ class CollectionFragmentPreChecker(
setListPosition(position, false) setListPosition(position, false)
if (type != PRECHECKER) { if (type != PRECHECKER) {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingUpdateFromSale( viewModel.itemShelvingUpdateFromSale(
sales[position].saleFk sales[position].saleFk
@ -1596,7 +1556,7 @@ class CollectionFragmentPreChecker(
private fun showShelving(position: Int, shelvingPosition: Int) { private fun showShelving(position: Int, shelvingPosition: Int) {
storedShelvingPosition = shelvingPosition storedShelvingPosition = shelvingPosition
storedPosition = position storedPosition = position
binding.splashProgress.visibility = VISIBLE
var quantityGet = 0 var quantityGet = 0
try { try {
quantityGet = quantityGet =
@ -1675,9 +1635,6 @@ class CollectionFragmentPreChecker(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility =
VISIBLE
viewModel.getIdFromCodeSalix( viewModel.getIdFromCodeSalix(
code = customDialogList.getValueTwo(), code = customDialogList.getValueTwo(),
) )
@ -1760,7 +1717,7 @@ class CollectionFragmentPreChecker(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCodeSalix( viewModel.getIdFromCodeSalix(
@ -1960,8 +1917,6 @@ class CollectionFragmentPreChecker(
) { ) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else { } else {
binding.splashProgress.visibility =
VISIBLE
//sergio datos para mensaje salix //sergio datos para mensaje salix
@ -2028,8 +1983,6 @@ class CollectionFragmentPreChecker(
) { ) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else { } else {
binding.splashProgress.visibility =
VISIBLE
dataMessageSalix = DataMessageSalix( dataMessageSalix = DataMessageSalix(
ticket = ticketSelected, ticket = ticketSelected,
@ -2176,7 +2129,7 @@ class CollectionFragmentPreChecker(
private fun customDialogSetUsed() { private fun customDialogSetUsed() {
if (!customDialogInput.getValue().isNullOrEmpty()) { if (!customDialogInput.getValue().isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
viewModel.ticketCollection_setUsedShelves( viewModel.ticketCollection_setUsedShelves(
ticketFk = collection.collectionFk, ticketFk = collection.collectionFk,
usedShelves = customDialogInput.getValue().toInt() usedShelves = customDialogInput.getValue().toInt()
@ -2262,7 +2215,7 @@ class CollectionFragmentPreChecker(
} }
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),
@ -2402,7 +2355,7 @@ class CollectionFragmentPreChecker(
private fun showMistakeList(list: List<MistakeTypeVO>) { private fun showMistakeList(list: List<MistakeTypeVO>) {
customDialogInput.dismiss() customDialogInput.dismiss()
binding.splashProgress.visibility = GONE
listPlacementSupply = ArrayList() listPlacementSupply = ArrayList()
list.forEach { list.forEach {
listPlacementSupply.add(BarcodeVO(code = it.description)) listPlacementSupply.add(BarcodeVO(code = it.description))

View File

@ -199,6 +199,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
val loadResponseItemShelvingUpdate: LiveData<Event<ResponseItemVO>> = val loadResponseItemShelvingUpdate: LiveData<Event<ResponseItemVO>> =
_responseItemShelvingUpdate.map { Event(it) } _responseItemShelvingUpdate.map { Event(it) }
private val _responseSaleAddPrevOK by lazy { MutableLiveData<ResponseItemVO>() }
val responseSaleAddPrevOK: LiveData<ResponseItemVO>
get() = _responseSaleAddPrevOK
fun getSales( fun getSales(
collectionFk: Int, collectionFk: Int,
print: String, print: String,
@ -233,48 +237,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
print: String, print: String,
type: String type: String
) { ) {
if (type == "PRECHECKER" || type == "PREPARED" || type == "CHECKER" || type == "SHOWTICKET") {
getSales(collectionFk, print, type) getSales(collectionFk, print, type)
} else {
silex.collection_getTickets(
collectionFk,
sectorFk,
print,
type
)
.enqueue(object :
SilexCallback<CollectionVO>(context) {
override fun onError(t: Throwable) {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
}
override fun onSuccess(response: Response<CollectionVO>) {
if (response.body() != null) {
_collectionTicketList.value =
response.body()?.let { it.map(contextApp) }
} else {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}
} }
//Tarea 6276 Salix collection_getTickets //Tarea 6276 Salix collection_getTickets
@ -314,47 +279,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
}) })
} }
/* fun collection_get(
collectionFk: Int,
sectorFk: Int,
print: String,
type: String
) {
//Falta back de Salix
// salix.collectionGet(params = arrayListOf(collectionFk, sectorFk, print, type).formatWithQuotes())
silex.collection_get(
collectionFk,
sectorFk,
print,
type
)
.enqueue(object :
SalixCallback<CollectionVO>(context) {
override fun onError(t: Throwable) {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<CollectionVO>) {
if (response.body() != null) {
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
} else {
_collectionTicketList.value = CollectionVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}*/
fun collectionGetId( fun collectionGetId(
ticketFk: Int, ticketFk: Int,
@ -1119,42 +1044,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
}) })
} }
/* fun collection_getUncheckedTicket(
collectionFk: Int
) {
silex.collection_getUncheckedTicket(
collectionFk
).enqueue(object :
SalixCallback<String>(context) {
override fun onError(t: Throwable) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<String>) {
if (response.body() != null) {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = false,
response = response.body()!!,
errorMessage = ""
)
} else {
_responseCollectionUnchecked.value = ResponseItemVO(
isError = true,
response = response.body()!!.toString(),
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
}
}
})
}*/
fun hasUncheckedTicket( fun hasUncheckedTicket(
collectionFk: Int collectionFk: Int
) { ) {
@ -1219,4 +1108,28 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
}) })
} }
fun saleTrackingAddPrevOK(
sectorCollectionFk: Int
) {
salix.saleTrackingAddPrevOK(arrayListOf(sectorCollectionFk))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseSaleAddPrevOK.value = ResponseItemVO(
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), t.message!!
)
)
}
override fun onSuccess(response: Response<Any>) {
_responseSaleAddPrevOK.value = ResponseItemVO(
isError = false, errorMessage = "" + getMessageFromAllResponse(
nameofFunction(this), response.message()
)
)
}
})
}
} }

View File

@ -1,7 +1,6 @@
package es.verdnatura.presentation.view.feature.controlador.fragment package es.verdnatura.presentation.view.feature.controlador.fragment
import android.content.Context import android.content.Context
import android.view.View
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
@ -34,7 +33,7 @@ class ControladorFragment :
override fun init() { override fun init() {
binding.splashProgress.visibility = View.GONE
binding.scanInput.visibility = VISIBLE binding.scanInput.visibility = VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket) binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
setEvents() setEvents()
@ -58,7 +57,7 @@ class ControladorFragment :
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) {
goBack = false goBack = false
if (!binding.scanInput.text.isNullOrEmpty()) { if (!binding.scanInput.text.isNullOrEmpty()) {
binding.splashProgress.visibility = VISIBLE
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString())) binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
//Tarea 6458 descomentar si ok //Tarea 6458 descomentar si ok
collectionViewModel = CollectionViewModel(mobileApplication) collectionViewModel = CollectionViewModel(mobileApplication)
@ -66,7 +65,7 @@ class ControladorFragment :
collectionViewModel!!.responseTicketState.observe( collectionViewModel!!.responseTicketState.observe(
viewLifecycleOwner, viewLifecycleOwner,
Observer { it -> Observer { it ->
binding.splashProgress.visibility = View.GONE
if ((it.code == "ON_CHECKING" || it.code == "CHECKED") && it.user.id != mobileApplication.userId) { if ((it.code == "ON_CHECKING" || it.code == "CHECKED") && it.user.id != mobileApplication.userId) {
var customDialogWarning = CustomDialog(requireContext()) var customDialogWarning = CustomDialog(requireContext())
customDialogWarning.setTitle(getString(R.string.info)) customDialogWarning.setTitle(getString(R.string.info))
@ -79,8 +78,6 @@ class ControladorFragment :
) )
.setOkButton(getString(R.string.aware)) { .setOkButton(getString(R.string.aware)) {
customDialogWarning.dismiss() customDialogWarning.dismiss()
binding.splashProgress.visibility = VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey( sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(
ConstAndValues.SECTORFK ConstAndValues.SECTORFK
@ -88,7 +85,7 @@ class ControladorFragment :
collectionFk = binding.scanInput.text.toString() collectionFk = binding.scanInput.text.toString()
.toInt(), .toInt(),
print = "0", print = "0",
type = ConstAndValues.CONTROLADOR type = ConstAndValues.ON_CHECKING
) )
}.setKoButton(getString(R.string.cancel)){ }.setKoButton(getString(R.string.cancel)){
binding.scanInput.setText("") binding.scanInput.setText("")
@ -103,7 +100,7 @@ class ControladorFragment :
), ),
collectionFk = binding.scanInput.text.toString().toInt(), collectionFk = binding.scanInput.text.toString().toInt(),
print = "0", print = "0",
type = ConstAndValues.CONTROLADOR type = ConstAndValues.ON_CHECKING
) )
} }
}) })
@ -120,7 +117,6 @@ class ControladorFragment :
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
binding.scanInput.setText("") binding.scanInput.setText("")
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage, isError = true, isPlayed = false) ma.messageWithSound(it.errorMessage, isError = true, isPlayed = false)

View File

@ -115,7 +115,6 @@ class EndSacadorFragment(
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialogInputParking = CustomDialogInput(requireContext()) customDialogInputParking = CustomDialogInput(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
binding.splashProgress.visibility = GONE
binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre) binding.mainToolbar.toolbarTitle.text = getString(R.string.getticketpre)
setToolBar() setToolBar()
setEvents() setEvents()
@ -191,7 +190,6 @@ class EndSacadorFragment(
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
salesList.observe(viewLifecycleOwner, Observer { salesList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
createSaleList(it) createSaleList(it)
}) })
@ -212,7 +210,6 @@ class EndSacadorFragment(
}) })
placementSuppleyList.observe(viewLifecycleOwner, Observer { placementSuppleyList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) printShelvingResult(it) if (!goBack) printShelvingResult(it)
goBack = false goBack = false
}) })
@ -232,7 +229,6 @@ class EndSacadorFragment(
responseParkingAdd.observe(viewLifecycleOwner, Observer { responseParkingAdd.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false) ma.messageWithSound(it.errorMessage, true, false)
@ -255,7 +251,6 @@ class EndSacadorFragment(
}) })
responseSplit.observe(viewLifecycleOwner, Observer { responseSplit.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.isError) { if (it.isError) {
ma.messageWithSound(it.errorMessage, isError = true, true) ma.messageWithSound(it.errorMessage, isError = true, true)
@ -271,7 +266,6 @@ class EndSacadorFragment(
loadResponseSaleGropAdd.observe(viewLifecycleOwner) { event -> loadResponseSaleGropAdd.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.isError) { if (it.isError) {
@ -294,7 +288,6 @@ class EndSacadorFragment(
responseSaleAddPrevOK.observe(viewLifecycleOwner, Observer { responseSaleAddPrevOK.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.isError) { if (it.isError) {
@ -312,7 +305,6 @@ class EndSacadorFragment(
goBack = false goBack = false
}) })
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.isError) { if (it.isError) {
@ -326,7 +318,6 @@ class EndSacadorFragment(
goBack = false goBack = false
}) })
responseSaleupdateIsChecked.observe(viewLifecycleOwner, Observer { responseSaleupdateIsChecked.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
@ -351,7 +342,6 @@ class EndSacadorFragment(
}) })
responseItemShelvingSaleSupplyAdd.observe(viewLifecycleOwner, Observer { responseItemShelvingSaleSupplyAdd.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.isError) { if (it.isError) {
@ -364,7 +354,7 @@ class EndSacadorFragment(
}) })
responseCode.observe(viewLifecycleOwner, Observer { responseCode.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (!goBack2) { if (!goBack2) {
if (it.isError) { if (it.isError) {
customDialog.setTitle(getString(R.string.error)) customDialog.setTitle(getString(R.string.error))
@ -427,7 +417,7 @@ class EndSacadorFragment(
//CREATE LIST //CREATE LIST
private fun searchSaleCollection() { private fun searchSaleCollection() {
binding.splashProgress.visibility = VISIBLE
viewModel.sectorCollectionGetSale( viewModel.sectorCollectionGetSale(
collection.collectionFk, collection.collectionFk,
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK) sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK)
@ -439,7 +429,6 @@ class EndSacadorFragment(
ticket = ticketFk ticket = ticketFk
if (ticketFk != 0) if (ticketFk != 0)
binding.splashProgress.visibility = VISIBLE
viewModel.sectorCollectionSaleGroupAdd( viewModel.sectorCollectionSaleGroupAdd(
ticketFk, ticketFk,
collection.collectionFk collection.collectionFk
@ -447,7 +436,7 @@ class EndSacadorFragment(
} }
private fun createSaleList(salesList: List<PreSacadorItemVO>) { private fun createSaleList(salesList: List<PreSacadorItemVO>) {
binding.splashProgress.visibility = GONE
if (salesList.isNullOrEmpty()) { if (salesList.isNullOrEmpty()) {
ma.messageWithSound( ma.messageWithSound(
@ -547,8 +536,6 @@ class EndSacadorFragment(
binding.mainToolbar.toolbarSubtitle.text = "" + totalMark + "/" + sales.size binding.mainToolbar.toolbarSubtitle.text = "" + totalMark + "/" + sales.size
if (totalMark == sales.size) { if (totalMark == sales.size) {
getString(R.string.ticketCompleted).toast(this.context, Toast.LENGTH_SHORT) getString(R.string.ticketCompleted).toast(this.context, Toast.LENGTH_SHORT)
binding.splashProgress.visibility = VISIBLE
viewModel.saleTrackingAddPrevOK( viewModel.saleTrackingAddPrevOK(
sectorCollectionFk = collection.collectionFk sectorCollectionFk = collection.collectionFk
) )
@ -684,7 +671,6 @@ class EndSacadorFragment(
private fun showShelving(position: Int, shelvingPosition: Int) { private fun showShelving(position: Int, shelvingPosition: Int) {
storedShelvingPosition = shelvingPosition storedShelvingPosition = shelvingPosition
storedPosition = position storedPosition = position
binding.splashProgress.visibility = VISIBLE
var quantityGet = 0 var quantityGet = 0
try { try {
quantityGet = (sales[position].saldo!! - sales[position].picked!!) quantityGet = (sales[position].saldo!! - sales[position].picked!!)
@ -739,7 +725,6 @@ class EndSacadorFragment(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode( viewModel.getIdFromCode(
code = customDialogList.getValueTwo() code = customDialogList.getValueTwo()
) )
@ -797,7 +782,6 @@ class EndSacadorFragment(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode( viewModel.getIdFromCode(
code = customDialogList.getValueTwo() code = customDialogList.getValueTwo()
) )

View File

@ -118,7 +118,6 @@ class AutomaticAddItemFragment(
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK) mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
) )
} else { } else {
binding.splashAnimation.visibility = View.VISIBLE
viewModel.itemShelvingMakeMulti( viewModel.itemShelvingMakeMulti(
shelvingFk, shelvingFk,
listString, listString,
@ -134,7 +133,6 @@ class AutomaticAddItemFragment(
override fun observeViewModel() { override fun observeViewModel() {
with(viewModel) { with(viewModel) {
binding.splashAnimation.visibility = View.INVISIBLE
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
ma.onMyBackPressed() ma.onMyBackPressed()
}) })

View File

@ -9,6 +9,7 @@ import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ResponseItemVO import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.workermistake.model.MakeMultiSalix
import retrofit2.Response import retrofit2.Response
class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) { class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
@ -22,11 +23,8 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
items: List<Long>, items: List<Long>,
warehouseFk: Int warehouseFk: Int
) { ) {
//Tarea 6276 A MODIFICAR SI O SI. MAÑANA // Falta cambiar el
//salix.upsertItem(MakeMultiSalix(shelvingFk,items,warehouseFk)) salix.upsertItem(MakeMultiSalix(shelvingFk, items, warehouseFk))
//falta cambiar el procedimiento si no no coge bien las cantidades, no las multiplica si el packing es 2 por ejemplo.
// Escanear dos veces un 10 pero pone un dos = 2x20 cuando debería ser 40.
silex.itemShelvingMake_multi(shelvingFk, items, warehouseFk)
.enqueue(object : .enqueue(object :
SalixCallback<Any>(context) { SalixCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
@ -44,6 +42,7 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
} }
}) })
} }
fun itemShelvingAddList( fun itemShelvingAddList(

View File

@ -51,7 +51,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="start" android:gravity="start"
android:text="@string/Entrada" android:text="@string/entry"
android:textColor="@color/verdnatura_pumpkin_orange" android:textColor="@color/verdnatura_pumpkin_orange"
android:textSize="@dimen/body1" /> android:textSize="@dimen/body1" />
@ -123,7 +123,7 @@
<LinearLayout <LinearLayout
android:id="@+id/splash_progress" android:id="@+id/splash_animation"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6" android:background="@color/verdnatura_black_8_alpha_6"

View File

@ -84,28 +84,5 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_animation"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center"
>
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -1,17 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:clickable="false"> android:clickable="false">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/verdnatura_black" android:background="@color/verdnatura_black">
>
<EditText <EditText
@ -19,27 +16,26 @@
style="@style/ScanLineTextSearch" style="@style/ScanLineTextSearch"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autofillHints="name"
android:hint="@string/Escaner" android:hint="@string/Escaner"
android:inputType="textVisiblePassword" android:inputType="textVisiblePassword"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
android:paddingStart="@dimen/default_layout_margin"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/main_toolbar" app:layout_constraintTop_toTopOf="@+id/main_toolbar" />
android:paddingStart="@dimen/default_layout_margin"
android:autofillHints="name"/>
<ImageView <ImageView
android:id="@+id/previaButton" android:id="@+id/previaButton"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp"
android:visibility="invisible" android:contentDescription="@string/error"
android:tooltipText="Permite marcar las líneas de previa escaneando ticket" android:tooltipText="Permite marcar las líneas de previa escaneando ticket"
app:srcCompat="@drawable/ic_streetview_black_24dp" android:visibility="invisible"
app:layout_constraintStart_toEndOf="@+id/scan_input" app:layout_constraintStart_toEndOf="@+id/scan_input"
app:layout_constraintTop_toTopOf="@+id/scan_input" app:layout_constraintTop_toTopOf="@+id/scan_input"
android:contentDescription="@string/error" app:srcCompat="@drawable/ic_streetview_black_24dp" />
/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/collection_swipe" android:id="@+id/collection_swipe"
@ -59,27 +55,7 @@
tools:listitem="@layout/item_article_row_fragment" /> tools:listitem="@layout/item_article_row_fragment" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<include <include
android:id="@+id/main_toolbar" android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment" layout="@layout/toolbar_fragment"

View File

@ -61,24 +61,6 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<include <include
android:id="@+id/main_toolbar" android:id="@+id/main_toolbar"

View File

@ -30,27 +30,5 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -31,27 +31,5 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -207,55 +207,5 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<LinearLayout
android:id="@+id/splash_progress_two"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -143,31 +143,5 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -85,26 +85,5 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -174,31 +174,5 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
android:textSize="@dimen/body2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -50,27 +50,5 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -47,23 +47,6 @@
tools:listitem="@layout/item_article_row_reubication_fragment" /> tools:listitem="@layout/item_article_row_reubication_fragment" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
<include <include
android:id="@+id/main_toolbar" android:id="@+id/main_toolbar"

View File

@ -33,28 +33,5 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -64,27 +64,5 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black_8_alpha_6"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>

View File

@ -32,28 +32,5 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</layout> </layout>