refs #5135 feat: refactor animation

This commit is contained in:
Sergio De la torre 2024-01-09 08:50:35 +01:00
parent c264406f0e
commit 5910b8dabd
17 changed files with 221 additions and 917 deletions

View File

@ -2,9 +2,7 @@
package es.verdnatura.presentation.view.feature.claim.fragment
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
@ -32,20 +30,14 @@ class ClaimFragment(
private var listClaims: ArrayList<GeneralItem> = ArrayList()
private var claimAdapter: GeneralAdapter? = null
companion object {
fun newInstance(entryPoint: String) = ClaimFragment(entryPoint)
}
override fun init() {
customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext())
goBack = false
ma.hideBottomNavigation(GONE)
binding.splashProgress.visibility = GONE
setEvents()
setToolBar()
setAdapter()
@ -53,22 +45,15 @@ class ClaimFragment(
super.init()
}
override fun onPause() {
goBack = true
super.onPause()
}
private fun setToolBar() {
ma.hideBottomNavigation(GONE)
binding.mainToolbar.toolbarTitle.text = entryPoint
}
private fun setAdapter() {
claimAdapter = GeneralAdapter(listClaims, object : OnGeneralItemRowClickListener {
override fun OnGeneralItemRowClickListener(item: GeneralItem) {
}
})
customDialogList.getRecyclerView().adapter = claimAdapter
@ -76,20 +61,9 @@ class ClaimFragment(
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
}
private fun itemShelving_addByClaim(shelving: String) {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingAddByClaim(
listClaims.first().code!!.toInt(),
shelving
)
customDialogList.dismiss()
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
customDialogList.dismiss()
requireActivity().onBackPressed()
@ -97,104 +71,71 @@ class ClaimFragment(
}
override fun observeViewModel() {
with(viewModel) {
binding.splashProgress.visibility = GONE
responseadd.observe(viewLifecycleOwner, Observer {
customDialogList.dismiss()
listClaims.clear()
claimAdapter!!.notifyDataSetChanged()
showInputClaim()
if (it.isError) {
customDialogList.dismiss()
listClaims.clear()
claimAdapter!!.notifyDataSetChanged()
showInputClaim()
ma.messageWithSound(it.errorMessage, true, false)
} else {
customDialogList.dismiss()
ma.messageWithSound(
getString(R.string.claimLabel) + listClaims.first().code + getString(R.string.keepPlate) +
listClaims.get(
1
).code, false, true
)
listClaims.clear()
claimAdapter!!.notifyDataSetChanged()
showInputClaim()
}
binding.splashProgress.visibility = GONE
})
}
}
private fun getTextToPosition(TagsScaned: Int): String {
private fun getTextToPosition(tagsScaned: Int): String {
var message = getString(R.string.dataCompllete)
when (TagsScaned) {
when (tagsScaned) {
1 -> message = getString(R.string.scanShelving)
}
return message
}
private fun getTextScaned(TagScaned: Int): String {
private fun getTextScaned(tagScaned: Int): String {
var message = ""
when (TagScaned) {
when (tagScaned) {
1 -> message = getString(R.string.claimLabel)
2 -> message = getString(R.string.shelving)
}
return message
}
private fun add_item(itemScaned: String) {
private fun addItem(itemScaned: String) {
val nameClaim: String = getTextScaned(listClaims.size + 1) + itemScaned
customDialogList.setTitle(getTextToPosition(listClaims.size + 1))
listClaims.add(GeneralItem(itemScaned, nameClaim))
claimAdapter!!.notifyDataSetChanged()
}
private fun showInputClaim() {
customDialogList.setTitle(getString(R.string.insertClaimCode))
.setOkButton(getString(R.string.end)) {
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.dismiss()
requireActivity().onBackPressed()
}.setValue("").show()
customDialogList.getEditText().requestFocus()
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
if (!customDialogList.getValue().isEmpty()) {
add_item(customDialogList.getValue())
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (customDialogList.getValue().isNotEmpty()) {
addItem(customDialogList.getValue())
if (listClaims.size > 1) {
itemShelving_addByClaim(customDialogList.getValue().uppercase())
viewModel.itemShelvingAddByClaim(
listClaims.first().code!!.toInt(),
customDialogList.getValue().uppercase()
)
customDialogList.dismiss()
}
}
@ -204,13 +145,6 @@ class ClaimFragment(
}
false
}
hideKeyboard()
}
}
}

View File

@ -23,6 +23,7 @@ class ClaimViewModel(val context: Context) : BaseViewModel(context) {
salix.itemShelvingAddByClaim(arrayListOf(claimFK, shelvingFK).formatWithQuotes())
.enqueue(object : SalixCallback<Unit>(context) {
override fun onSuccess(response: Response<Unit>) {
_responseadd.value = ResponseItemVO(
isError = false,
errorMessage = getMessageFromAllResponse(
@ -30,15 +31,7 @@ class ClaimViewModel(val context: Context) : BaseViewModel(context) {
response.message()
)
)
}
override fun onError(t: Throwable) {
_responseadd.value = ResponseItemVO(
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), t.message!!
)
)
super.onSuccess(response)
}
})

View File

@ -32,19 +32,16 @@ import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisi
import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisibleZero
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class InventaryParkingFragment(
var title: String = "",
) : BaseFragment<FragmentInventoryParkingBinding, InventaryViewModel>(
InventaryViewModel::class
) {
private var adapter: InventoryParkingAdapter? = null
private lateinit var customDialogInput: CustomDialogInput
private lateinit var customDialogList: CustomDialogList
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
private var isBack = false
private lateinit var myListInventory: MutableList<ItemInventoryParking>
private var listParkings: ArrayList<BarcodeVO> = ArrayList()
@ -59,8 +56,7 @@ class InventaryParkingFragment(
val listIcons: ArrayList<ImageView> = ArrayList()
companion object {
fun newInstance(title: String) =
InventaryParkingFragment(title)
fun newInstance(title: String) = InventaryParkingFragment(title)
}
override fun getLayoutId(): Int = R.layout.fragment_inventory_parking
@ -79,7 +75,6 @@ class InventaryParkingFragment(
}
override fun onAttach(context: Context) {
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
super.onAttach(context)
@ -113,11 +108,9 @@ class InventaryParkingFragment(
})
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
val iconAdd = ImageView(context)
iconAdd.setImageResource(R.drawable.ic_add_black_24dp)
@ -162,13 +155,11 @@ class InventaryParkingFragment(
iconFilter.drawable -> {
try {
filterActivated = !filterActivated
adapter!!.setItems(
if (filterActivated) {
myListInventory.filter { it.isChecked == null || it.isChecked == 0 }
} else {
myListInventory
}
)
adapter!!.setItems(if (filterActivated) {
myListInventory.filter { it.isChecked == null || it.isChecked == 0 }
} else {
myListInventory
})
iconFilter.drawable.setTint(
ContextCompat.getColor(
context!!,
@ -205,7 +196,6 @@ class InventaryParkingFragment(
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
private fun chageListAdapter(filterList: List<ImageView>, removeReset: Boolean = false) {
if (!removeReset) {
(binding.mainToolbar.toolbarIcons.adapter as ToolBarAdapterTooltip).setItemsList(
@ -230,17 +220,14 @@ class InventaryParkingFragment(
.setDescription(getString(R.string.checkItemShelvingSelect))
.setOkButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}
.setKoButton(getString(R.string.ok)) {
}.setKoButton(getString(R.string.ok)) {
checkSelvingsForUpdate(customDialogInput.getValue())
}
.show()
}.show()
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (customDialogInput.getValue().isNotEmpty()
) {
if (customDialogInput.getValue().isNotEmpty()) {
checkSelvingsForUpdate(customDialogInput.getValue())
}
return@setOnEditorActionListener true
@ -262,12 +249,9 @@ class InventaryParkingFragment(
if (inqValues.size() == 0) {
ma.messageWithSound("", true, true, "", null)
} else {
filter.add("id", JsonObject().apply { add("inq", inqValues) })
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingsReset(
filter,
ItemShelvingChecked(null, mobileApplication.userId!!)
filter, ItemShelvingChecked(null, mobileApplication.userId!!)
)
}
ma.hideKeyboard(customDialogInput.getEditText())
@ -292,7 +276,7 @@ class InventaryParkingFragment(
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!customDialogList.getValue().isEmpty()) {
if (customDialogList.getValue().isNotEmpty()) {
try {
if (listParkings.size == 1) {
@ -301,7 +285,6 @@ class InventaryParkingFragment(
customDialogList.getValue().uppercase()
)
ma.hideKeyboard(customDialogList.getEditText())
listParkings.clear()
customDialogList.dismiss()
@ -311,7 +294,6 @@ class InventaryParkingFragment(
listParkings.add(0, BarcodeVO(code = customDialogList.getValue()))
}
} catch (e: Exception) {
ma.messageWithSound(e.message.toString(), true, true, "", true)
}
@ -326,8 +308,7 @@ class InventaryParkingFragment(
}
listWagonsAdapter = BarcodeAdapter(
listParkings,
object : OnBarcodeRowClickListener {
listParkings, object : OnBarcodeRowClickListener {
override fun onBarcodeRowClickListener(item: BarcodeVO) {
}
@ -341,12 +322,10 @@ class InventaryParkingFragment(
}
private fun callGetInventory(parkingFromScan: String, parkingToScan: String) {
binding.splashProgress.visibility = VISIBLE
parkingFrom = parkingFromScan
parkingTo = parkingToScan
viewModel.getInventoryParking(
parkingFromScan,
parkingToScan
parkingFromScan, parkingToScan
)
binding.mainToolbar.toolbarTitle.text = "$parkingFrom$parkingTo"
}
@ -364,11 +343,8 @@ class InventaryParkingFragment(
positionShelvingChecking = -1
positionItemChecking = -1
shelvingSaved = ""
binding.splashProgress.visibility = VISIBLE
viewModel.getInventoryParking(
parkingFrom,
parkingTo
parkingFrom, parkingTo
)
binding.editMatricula.hint = getString(R.string.scanShelving)
@ -394,9 +370,7 @@ class InventaryParkingFragment(
try {
binding.editMatricula.setText(
itemScanValue(
binding.editMatricula.text.toString(),
"buy",
"more"
binding.editMatricula.text.toString(), "buy", "more"
).toString()
)
} catch (ex: Exception) {
@ -422,11 +396,7 @@ class InventaryParkingFragment(
if (allChecked) {
ma.messageWithSound(
getString(R.string.plateChecked),
false,
true,
"",
isToasted = true
getString(R.string.plateChecked), false, true, "", isToasted = true
)
chageListAdapter(listIcons)
adapter!!.setItems(myListInventory.filter { it.shelvingFk == myListInventory[positionShelvingChecking].shelvingFk })
@ -436,16 +406,11 @@ class InventaryParkingFragment(
binding.editMatricula.hint = getString(R.string.scanShelving)
binding.textinputlayoutMatricula.hint = getString(R.string.scanShelving)
} else {
if (positionShelvingChecking == -1) {
ma.messageWithSound(
getString(R.string.shelvingNotFound),
true,
true,
"",
true
getString(R.string.shelvingNotFound), true, true, "", true
)
} else {
@ -456,7 +421,6 @@ class InventaryParkingFragment(
binding.textinputlayoutMatricula.hint =
getString(R.string.scanItemForChecking)
}
}
} else {
@ -465,9 +429,7 @@ class InventaryParkingFragment(
viewModel.getIdFromCodeSalix(
code = itemScanValue(
binding.editMatricula.text.toString(),
"buy",
"more"
binding.editMatricula.text.toString(), "buy", "more"
).toString()
)
@ -475,7 +437,6 @@ class InventaryParkingFragment(
ma.messageWithSound(ex.message!!, true, true, "", null)
}
}
binding.editMatricula.setText("")
ma.hideKeyboard(binding.editMatricula)
@ -485,24 +446,17 @@ class InventaryParkingFragment(
return@setOnEditorActionListener false
}
}
private fun checkItem(itemCode: String) {
println("itemCode es $itemCode")
positionItemChecking = myListInventory.indexOfFirst { item ->
item.itemFk == itemCode
.toInt() && item.shelvingFk == myListInventory[positionShelvingChecking].shelvingFk && item.isChecked == null
item.itemFk == itemCode.toInt() && item.shelvingFk == myListInventory[positionShelvingChecking].shelvingFk && item.isChecked == null
}
if (positionItemChecking == -1) {
ma.messageWithSound(
getString(R.string.itemNotFoundScanAgain),
true,
true,
"",
true
getString(R.string.itemNotFoundScanAgain), true, true, "", true
)
positionShelvingChecking = -1
@ -510,7 +464,6 @@ class InventaryParkingFragment(
} else {
try {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingUpdate(
myListInventory[positionItemChecking].id,
ItemShelvingChecked(true, mobileApplication.userId!!)
@ -542,14 +495,11 @@ class InventaryParkingFragment(
with(viewModel) {
inventoryListParking.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.list.isNotEmpty()) {
if (it.list[0].isError) {
ma.messageWithSound(
it.list[0].errorMessage,
it.list[0].isError,
false
it.list[0].errorMessage, it.list[0].isError, false
)
} else {
@ -565,46 +515,22 @@ class InventaryParkingFragment(
loadReponseCode.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, true)
} else {
checkItem(it.response)
}
checkItem(it.response)
}
}
response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, true)
chageListAdapter(listIcons, true)
callGetInventory(
parkingFrom, parkingTo
)
} else {
ma.messageWithSound("", it.isError, true, isToasted = false)
chageListAdapter(listIcons, true)
callGetInventory(
parkingFrom,
parkingTo
)
}
})
responseReset.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, true)
} else {
ma.messageWithSound("", it.isError, true, isToasted = false)
callGetInventory(
parkingFrom,
parkingTo
)
chageListAdapter(listIcons, true)
}
callGetInventory(
parkingFrom, parkingTo
)
chageListAdapter(listIcons, true)
})
}
@ -613,21 +539,20 @@ class InventaryParkingFragment(
private fun createListInventoryParking(
) {
adapter = InventoryParkingAdapter(
(if (filterActivated) {
if (!shelvingSaved.isNullOrEmpty()) {
myListInventory.filter { (it.isChecked == null || it.isChecked == 0) && it.shelvingFk == shelvingSaved }
} else {
myListInventory.filter { it.isChecked == null || it.isChecked == 0 }
}
adapter = InventoryParkingAdapter((if (filterActivated) {
if (!shelvingSaved.isNullOrEmpty()) {
myListInventory.filter { (it.isChecked == null || it.isChecked == 0) && it.shelvingFk == shelvingSaved }
} else {
if (!shelvingSaved.isNullOrEmpty()) {
myListInventory.filter { it.shelvingFk == shelvingSaved }
} else {
myListInventory
}
}),
myListInventory.filter { it.isChecked == null || it.isChecked == 0 }
}
} else {
if (!shelvingSaved.isNullOrEmpty()) {
myListInventory.filter { it.shelvingFk == shelvingSaved }
} else {
myListInventory
}
}),
onPasillerosItemClickListener = pasillerosItemClickListener!!,
onVisibleInventoryClickListener = object : OnVisibleInventoryClickListener {
override fun onVisibleInventoryClickListener(item: ItemInventoryParking) {
@ -637,19 +562,15 @@ class InventaryParkingFragment(
},
onMoreClickListener = object : OnMoreClickListener {
override fun onMoreClickListener(item: ItemUbicadorVO) {
// showMoreOptions(item)
}
})
binding.inventoryParkingRecyclerview.adapter = adapter
binding.inventoryParkingRecyclerview.layoutManager =
LinearLayoutManager(
requireContext(),
LinearLayoutManager.VERTICAL,
false
)
binding.inventoryParkingRecyclerview.layoutManager = LinearLayoutManager(
requireContext(), LinearLayoutManager.VERTICAL, false
)
}
@ -657,22 +578,18 @@ class InventaryParkingFragment(
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
customDialogInput.setTitle(getString(R.string.quantity))
customDialogInput.setDescription(getString(R.string.quantityVisible))
.setValue("")
customDialogInput.setDescription(getString(R.string.quantityVisible)).setValue("")
.setOkButton(getString(R.string.modify)) {
try {
if (customDialogInput.getValue().toInt() >= 0) {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelvingUpdate(
item.id,
if (customDialogInput.getValue().toInt() == 0) {
item.id, if (customDialogInput.getValue().toInt() == 0) {
ItemShelvingVisibleZero(customDialogInput.getValue().toInt(), true)
} else {
ItemShelvingVisible(customDialogInput.getValue().toInt())
}
)
} else {
throw Exception("")
}
@ -688,60 +605,4 @@ class InventaryParkingFragment(
customDialogInput.setFocusText()
}
/* private fun showMoreOptions(item: ItemUbicadorVO) {
customDialogTwoButtons.setTitle(item.item.toString())
.setDescription(getString(R.string.selectAction))
.setOkButton(getString(R.string.transfer)) {
customDialogInput.setTitle(getString(R.string.shelvingNew))
.setDescription(getString(R.string.selectDestiny) + item.item)
.setValue("")
.setOkButton(getString(R.string.transfer)) {
if (customDialogInput.getValue().isNotEmpty()) {
binding.splashProgress.visibility = VISIBLE
listItems.remove(item)
adapter!!.notifyDataSetChanged()
customDialogInput.dismiss()
} else {
getString(R.string.wagonIncorrect).toast(requireContext())
}
}.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
}.show()
customDialogInput.getEditText().requestFocus()
ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.getEditText()
.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
listItems.remove(item)
adapter!!.notifyDataSetChanged()
customDialogInput.dismiss()
return@setOnEditorActionListener true
}
false
}
customDialogTwoButtons.dismiss()
}.setOkButtonTwo(getString(R.string.delete)) {
customDialog.setTitle(getString(R.string.confirm))
.setDescription(
getString(R.string.deleteQuantity) + item.item
)
.setOkButton(getString(R.string.delete)) {
}.setKoButton(getString(R.string.cancel)) {
customDialog.dismiss()
customDialogTwoButtons.dismiss()
}.show()
}.setKoButton(getString(R.string.cancel)) {
customDialogTwoButtons.dismiss()
}.show()
}*/
}
}

View File

@ -6,7 +6,6 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.google.gson.JsonObject
import es.verdnatura.MobileApplication
import es.verdnatura.R
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback
import es.verdnatura.domain.formatWithQuotes
@ -79,21 +78,20 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
//sergio para obtener comprador
fun itemShelvingBuyerGet() {
salix.getBuyers("""{"order":"nickname"}""").enqueue(object :
SalixCallback<List<BuyerVO>>(context) {
override fun onSuccess(response: Response<List<BuyerVO>>) {
_buyersList.value = response.body()?.let { BuyerListVO(it) }
}
salix.getBuyers("""{"order":"nickname"}""")
.enqueue(object : SalixCallback<List<BuyerVO>>(context) {
override fun onSuccess(response: Response<List<BuyerVO>>) {
_buyersList.value = response.body()?.let { BuyerListVO(it) }
}
})
})
}
val loadInventaryList = Transformations.map(_inventaryList) { Event(it) }
fun getInventory(buyerFk: Int, warehouseFk: Int) {
salix.itemShelvingFilterBuyer(params = arrayListOf(buyerFk, warehouseFk))
.enqueue(object :
SalixCallback<List<ItemInventaryVO>>(context) {
.enqueue(object : SalixCallback<List<ItemInventaryVO>>(context) {
override fun onSuccess(response: Response<List<ItemInventaryVO>>) {
_inventaryList.value = response.body()?.let { InventaryListVO(it) }
}
@ -108,18 +106,10 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
) {
salix.itemShelvingUpdate(itemShelvingFk, params)
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_response.value = ResponseItemVO(isError = false, response = response.message())
super.onSuccess(response)
}
})
@ -131,36 +121,25 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
) {
salix.itemShelvingsUpdate(where, params)
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseReset.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
salix.itemShelvingsUpdate(where, params).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_responseReset.value =
ResponseItemVO(isError = false, response = response.message())
super.onSuccess(response)
}
})
}
fun itemTrash(
itemFk: Int,
warehouseFk: Int,
newValue: Int,
isTrash: Boolean
itemFk: Int, warehouseFk: Int, newValue: Int, isTrash: Boolean
) {
salix.itemTrash(arrayListOf(itemFk, warehouseFk, newValue, isTrash).formatWithQuotes())
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_response.value = ResponseItemVO(isError = false, response = response.message())
}
})
}
@ -177,8 +156,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
fun workerGetFromHasMistake(departmentFk: Int) {
salix.workerGetFromHasMistake(arrayListOf(departmentFk))
.enqueue(object :
SalixCallback<List<WorkerFromMistake>>(context) {
.enqueue(object : SalixCallback<List<WorkerFromMistake>>(context) {
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
_workerFromMistakeList.value =
response.body()?.let { workerFromMistakeList(it) }
@ -188,10 +166,8 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
val listError: ArrayList<WorkerFromMistake> = ArrayList()
listError.add(
WorkerFromMistake(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), t.message!!
)
)
)
@ -202,12 +178,10 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
}
fun workerMistakeTypeGet() {
salix.workerMistakesTypes()
.enqueue(object : SilexCallback<List<MistakeType>>(context) {
salix.workerMistakesTypes().enqueue(object : SilexCallback<List<MistakeType>>(context) {
override fun onSuccess(response: Response<List<MistakeType>>) {
_mistakeWorkerList.value =
response.body()?.let { workerMistakeTypeList(it) }
_mistakeWorkerList.value = response.body()?.let { workerMistakeTypeList(it) }
}
@ -215,13 +189,10 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
}
fun workerMistakeAdd(
vUserFk: Int,
vTypeFk: String
vUserFk: Int, vTypeFk: String
) {
salix.workerMistakesAdd(WorkerMistakeSalix(vUserFk, vTypeFk))
.enqueue(object :
SalixCallback<Any>(context) {
})
.enqueue(object : SalixCallback<Any>(context) {})
}
fun expeditionMistake_add(
@ -235,9 +206,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
typeFk = vTypeFk,
workerFk = (context as MobileApplication).userId!!
)
)
.enqueue(object :
SalixCallback<Any>(context) {
).enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseAddMistake.value = ResponseItemVO(
isError = true,
@ -248,31 +217,26 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
override fun onSuccess(response: Response<Any>) {
// sergio:refactor:solo debería haber un mensaje no un response o errorMessage
_responseAddMistake.value =
ResponseItemVO(
isError = false,
response = response.message()
)
_responseAddMistake.value = ResponseItemVO(
isError = false, response = response.message()
)
}
})
}
fun getInventoryParking(
vParkingFrom: String,
vParkingTo: String
vParkingFrom: String, vParkingTo: String
) {
salix.getInventoryParking(vParkingFrom, vParkingTo)
.enqueue(object :
SilexCallback<List<ItemInventoryParking>>(context) {
.enqueue(object : SalixCallback<List<ItemInventoryParking>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<ItemInventoryParking> = ArrayList()
listError.add(
ItemInventoryParking(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
nameofFunction(this), t.message!!
),
)
)
@ -292,8 +256,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
ItemInventoryParking(
isError = false,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
nameofFunction(this), response.message()
),
)
)
@ -305,8 +268,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
}
fun ItemListInventoryParking_(
vParkingFrom: String,
vParkingTo: String
vParkingFrom: String, vParkingTo: String
) {
var myList = InventoryParkingList(
@ -324,8 +286,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/dgalaxy",
0,
2
),
ItemInventoryParking(
), ItemInventoryParking(
2,
31,
"F-01-1",
@ -338,8 +299,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/92400",
1,
2
),
ItemInventoryParking(
), ItemInventoryParking(
3,
31,
"F-01-1",
@ -352,8 +312,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/92400",
null,
2
),
ItemInventoryParking(
), ItemInventoryParking(
4,
32,
"F-01-2",
@ -366,8 +325,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/dgalaxy",
0,
2
),
ItemInventoryParking(
), ItemInventoryParking(
5,
33,
"F-01-3",
@ -380,8 +338,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/002912",
0,
0
),
ItemInventoryParking(
), ItemInventoryParking(
6,
34,
"F-01-4",
@ -394,8 +351,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/bqamor",
2,
0
),
ItemInventoryParking(
), ItemInventoryParking(
7,
34,
"F-01-4",
@ -408,8 +364,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/bqamor",
0,
0
),
ItemInventoryParking(
), ItemInventoryParking(
8,
34,
"F-01-4",
@ -422,8 +377,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
"http://verdnatura.es/vn-image-data/catalog/1600x900/50001",
0,
2
),
ItemInventoryParking(
), ItemInventoryParking(
9,
34,
"F-01-4",
@ -471,12 +425,9 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
val listError: ArrayList<MistakeType> = ArrayList()
listError.add(
MistakeType(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
),
description = ""
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), t.message!!
), description = ""
)
)
_mistakeWorkerList.value = workerMistakeTypeList(listError)
@ -491,12 +442,9 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
val listError: ArrayList<MistakeType> = ArrayList()
listError.add(
MistakeType(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
),
description = ""
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), response.message()
), description = ""
)
)
_mistakeWorkerList.value = workerMistakeTypeList(listError)
@ -507,30 +455,10 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
}
fun getIdFromCodeSalix(code: String) {
salix.barcodes_toitem(code)
.enqueue(object : SilexCallback<String?>(context) {
override fun onError(t: Throwable) {
_responseCode.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
salix.barcodes_toitem(code).enqueue(object : SalixCallback<String?>(context) {
override fun onSuccess(response: Response<String?>) {
if (response.body() == null) {
_responseCode.value = ResponseItemVO(
isError = true,
errorMessage = context.getString(R.string.itemNotValid)
)
} else {
println("itemCode response" + response.body())
println("itemCode response string" + response.body().toString())
println("itemCode response toInt" + response.body().toString().toInt())
_responseCode.value =
ResponseItemVO(isError = false, response = response.body()!!.toString())
}
_responseCode.value =
ResponseItemVO(isError = false, response = response.body()!!.toString())
}
})
}

View File

@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.packingHolland.fragment
import android.text.InputType
import android.view.View.GONE
import android.view.View.INVISIBLE
import android.view.View.VISIBLE
import android.view.inputmethod.EditorInfo
import es.verdnatura.R
@ -12,7 +11,6 @@ import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.itemScanValue
import es.verdnatura.presentation.view.component.CustomDialogInput
//Tarea #4940
class PackingHollandFragment(var entrypoint: String) :
BaseFragment<FragmentGeneralBlackBinding, PackingHollandViewModel>(
PackingHollandViewModel::class
@ -27,13 +25,11 @@ class PackingHollandFragment(var entrypoint: String) :
}
override fun init() {
customDialogInput = CustomDialogInput(requireContext())
binding.mainToolbar.toolbarTitle.text = entrypoint
binding.splashProgress.visibility = GONE
binding.scanInput.visibility = VISIBLE
setEvents()
super.init()
}
@ -42,7 +38,6 @@ class PackingHollandFragment(var entrypoint: String) :
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
@ -69,22 +64,6 @@ class PackingHollandFragment(var entrypoint: String) :
}
}
override fun observeViewModel() {
with(viewModel) {
response.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, true)
} else {
ma.messageWithSound(it.errorMessage, false, true, isToasted = false)
}
}
}
}
private fun showQuantityPacking() {
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
@ -100,10 +79,8 @@ class PackingHollandFragment(var entrypoint: String) :
ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
callPacking(customDialogInput.getValue())
return@setOnEditorActionListener true
}
false
@ -112,23 +89,18 @@ class PackingHollandFragment(var entrypoint: String) :
ma.hideKeyboard(customDialogInput.getEditText())
}
private fun callPacking(value: String) {
if (customDialogInput.getValue().isNotEmpty()) {
try {
ma.hideKeyboard(customDialogInput.getEditText())
customDialogInput.dismiss()
binding.splashProgress.visibility = VISIBLE
viewModel.travelUpdatePacking(
itemFk = shelvingScaned,
packingFk = value.toInt()
)
binding.scanInput.requestFocus()
} catch (ex: Exception) {
binding.splashProgress.visibility = INVISIBLE
getString(R.string.errorInput).toast(requireActivity())
customDialogInput.setValue("")
}

View File

@ -1,15 +1,11 @@
package es.verdnatura.presentation.view.feature.packingHolland.fragment
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ResponseItemVO
import retrofit2.Response
class PackingHollandViewModel(val context: Context) : BaseViewModel(context) {
@ -17,26 +13,14 @@ class PackingHollandViewModel(val context: Context) : BaseViewModel(context) {
val response: LiveData<ResponseItemVO>
get() = _response
fun travelUpdatePacking(
itemFk: Int,
packingFk: Int
) {
salix.travelUpdatePacking(arrayListOf(itemFk, packingFk))
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message()!!)
}
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
})
}
}

View File

@ -1,6 +1,5 @@
package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.media.MediaPlayer
@ -38,7 +37,6 @@ class ExpeditionPalletFragment(
ExpeditionPalletViewModel::class
) {
private var adapter: ExpeditionPalletAdapter? = null
private var onPalletClickListener: OnPalletClickListener? = null
private var onComprobarPalletViewClickListener: OnComprobarPalletViewClickListener? = null
@ -49,10 +47,8 @@ class ExpeditionPalletFragment(
var mperror: MediaPlayer? = null
var mpok: MediaPlayer? = null
companion object {
fun newInstance(item: ItemExpeditionTruckVO) =
ExpeditionPalletFragment(item)
fun newInstance(item: ItemExpeditionTruckVO) = ExpeditionPalletFragment(item)
}
override fun onAttach(context: Context) {
@ -73,12 +69,10 @@ class ExpeditionPalletFragment(
override fun init() {
customDialog = CustomDialog(requireContext())
customDialogList = CustomDialogList(requireContext())
binding.splashProgress.visibility = View.VISIBLE
ma.hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text =
itemExpeditionTruckVO!!.eta.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
itemExpeditionTruckVO!!.eta + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
itemExpeditionTruckVO!!.description
} else {
itemExpeditionTruckVO!!.Destino
}
@ -110,7 +104,6 @@ class ExpeditionPalletFragment(
ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPalletList(
itemExpeditionTruckVO!!.id
)
@ -141,34 +134,19 @@ class ExpeditionPalletFragment(
event.getContentIfNotHandled().notNull { showScanExpeditions(it) }
})
response.observe(viewLifecycleOwner, Observer {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
}
})
responseCheckexpeditionScanPut.observe(viewLifecycleOwner, Observer {
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
if (it.response == "1") {
mperror?.start()
if (it.response == "1") {
mperror?.start()
}
}
})
}
}
private fun printExpeditionList(it: ItemPalletListVO) {
binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = ExpeditionPalletAdapter(
it.list,
@ -182,22 +160,16 @@ class ExpeditionPalletFragment(
}
private fun expeditionScanAdd() {
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionScanAdd(
vPalletFk = 0,
vTruckFk = itemExpeditionTruckVO!!.id
vPalletFk = 0, vTruckFk = itemExpeditionTruckVO!!.id
)
}
private fun showScanExpeditions(it: ItemScanList) {
binding.splashProgress.visibility = View.GONE
listExpeditions = ArrayList()
it.list.forEach {
if (it.expeditionFk != "0")
listExpeditions.add(BarcodeVO(code = it.expeditionFk))
if (it.expeditionFk != "0") listExpeditions.add(BarcodeVO(code = it.expeditionFk))
}
customDialogList.setTitle(getString(R.string.expeditionP) + binding.mainToolbar.toolbarTitle.text + ")")
@ -211,8 +183,7 @@ class ExpeditionPalletFragment(
if (listExpeditions.size > 0) {
onComprobarPalletViewClickListener!!.onComprobarPalletViewClickListener(
itemExpeditionTruckVO!!,
ItemPalletVO(Pallet = it.list.get(0).palletFk)
itemExpeditionTruckVO!!, ItemPalletVO(Pallet = it.list.get(0).palletFk)
)
} else {
customDialog.setTitle(getString(R.string.info))
@ -221,13 +192,10 @@ class ExpeditionPalletFragment(
customDialog.dismiss()
}.show()
}
customDialogList.dismiss()
}.setKoButton(getString(R.string.close)) {
ma.hideKeyboard(customDialogList.getEditText())
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionPalletList(
itemExpeditionTruckVO!!.id
)
@ -247,12 +215,10 @@ class ExpeditionPalletFragment(
listExpeditions.add(0, BarcodeVO(code = customDialogList.getValue()))
customDialogList.setDescription(getString(R.string.total) + listExpeditions.size)
viewModel.expeditionScanPut(
it.list.get(0).palletFk,
customDialogList.getValue().toInt()
it.list.get(0).palletFk, customDialogList.getValue().toInt()
)
viewModel.expeditionCheckRoute(
it.list[0].palletFk,
customDialogList.getValue().toInt()
it.list[0].palletFk, customDialogList.getValue().toInt()
)
} else {
if (mperror != null) mperror!!.start()
@ -281,8 +247,6 @@ class ExpeditionPalletFragment(
customDialogList.getRecyclerView().layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
}
}

View File

@ -41,38 +41,10 @@ class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
.enqueue(object :
SalixCallback<List<ItemPalletVO>>(context) {
override fun onSuccess(response: Response<List<ItemPalletVO>>) {
if (response.body() != null) {
_expeditionPalletList.value =
response.body()?.let { ItemPalletListVO(it) }
} else {
val listError: ArrayList<ItemPalletVO> = ArrayList()
listError.add(
ItemPalletVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_expeditionPalletList.value = ItemPalletListVO(listError)
}
}
override fun onError(t: Throwable) {
val listError: ArrayList<ItemPalletVO> = ArrayList()
listError.add(
ItemPalletVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_expeditionPalletList.value = ItemPalletListVO(listError)
_expeditionPalletList.value =
response.body()?.let { ItemPalletListVO(it) }
}
})
@ -85,39 +57,7 @@ class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
.enqueue(object :
SalixCallback<List<ItemScanVO>>(context) {
override fun onSuccess(response: Response<List<ItemScanVO>>) {
if (response.body() != null) {
_scanList.value = response.body()?.let { ItemScanList(it) }
} else {
val listError: ArrayList<ItemScanVO> = ArrayList()
listError.add(
ItemScanVO(
"",
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_scanList.value = ItemScanList(listError)
}
}
override fun onError(t: Throwable) {
val listError: ArrayList<ItemScanVO> = ArrayList()
listError.add(
ItemScanVO(
"",
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_scanList.value = ItemScanList(listError)
}
})
@ -143,27 +83,13 @@ class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
salix.expeditionCheckRoute(arrayListOf(vPalletFk, vExpeditionFk))
.enqueue(object : SalixCallback<String>(context) {
override fun onSuccess(response: Response<String>) {
if (response.body() == null) {
_responseCheckexpeditionScanPut.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_responseCheckexpeditionScanPut.value =
ResponseItemVO(isError = false, response = response.body()!!)
}
}
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
})
}

View File

@ -4,9 +4,9 @@ import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.annotation.RequiresApi
import androidx.core.content.res.ResourcesCompat
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
@ -49,14 +49,12 @@ class ExpeditionTruckListFragment :
@SuppressLint("SetTextI18n")
override fun init() {
customDialogHor = CustomDialogHour(requireContext())
binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.psScan) + getCURDATE()
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
setToolBar()
viewModel.expeditionTruckList()
super.init()
}
@ -64,11 +62,11 @@ class ExpeditionTruckListFragment :
private fun setToolBar() {
val listIcons: ArrayList<Drawable> = ArrayList()
val iconReload: Drawable =
resources.getDrawable(R.drawable.ic_autorenew_black_24dp, resources.newTheme())
ResourcesCompat.getDrawable(resources, R.drawable.ic_autorenew_black_24dp, null)!!
val iconPlus: Drawable =
resources.getDrawable(R.drawable.ic_add_black_24dp, resources.newTheme())
ResourcesCompat.getDrawable(resources, R.drawable.ic_add_black_24dp, null)!!
val iconState: Drawable =
resources.getDrawable(R.drawable.ic_visibility_white_24dp, resources.newTheme())
ResourcesCompat.getDrawable(resources, R.drawable.ic_visibility_white_24dp, null)!!
listIcons.add(iconState)
listIcons.add(iconReload)
@ -80,7 +78,6 @@ class ExpeditionTruckListFragment :
@RequiresApi(Build.VERSION_CODES.O)
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.expeditionTruckList()
} else if (item == iconPlus) {
addTruck()
@ -114,10 +111,8 @@ class ExpeditionTruckListFragment :
@RequiresApi(Build.VERSION_CODES.O)
private fun printExpeditionList(it: ItemExpeditionTruckList) {
binding.splashProgress.visibility = View.GONE
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
it.list.filter { it.eta != null }
.map { it.eta = it.eta.isoToString()}
it.list.filter { it.eta != null }.map { it.eta = it.eta.isoToString() }
adapter = ExpeditionListAdapter(it.list, onTruckClickListener!!)
binding.expeditionTruckRecyclerview.adapter = adapter
binding.expeditionTruckRecyclerview.layoutManager = lm
@ -158,22 +153,9 @@ class ExpeditionTruckListFragment :
@RequiresApi(Build.VERSION_CODES.O)
private fun customDialogActionTruck() {
viewModel.expeditionTruckAdd(
customDialogHor.getHoraValue(),
customDialogHor.getDestinoValue()
customDialogHor.getHoraValue(), customDialogHor.getDestinoValue()
)
binding.splashProgress.visibility = View.VISIBLE
customDialogHor.dismiss()
}
}
}

View File

@ -7,8 +7,6 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.SalixCallback
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.paletizador.model.ExpeditionTruckSalix
@ -41,19 +39,6 @@ class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context
_expeditionTruckList.value =
response.body()?.let { ItemExpeditionTruckList(it) }
}
override fun onError(t: Throwable) {
val listError: ArrayList<ItemExpeditionTruckVO> = ArrayList()
listError.add(
ItemExpeditionTruckVO(
0,
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
)
_expeditionTruckList.value = ItemExpeditionTruckList(listError)
}
})
}
@ -65,26 +50,8 @@ class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context
description = vDescription
)
).enqueue(object : SalixCallback<Any>(context) {
override fun onFailure(call: Call<Any>, t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (!response.isSuccessful) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
} else {
_response.value = ResponseItemVO(isError = false, response = response.message())
}
_response.value = ResponseItemVO(isError = false, response = response.message())
}
})

View File

@ -29,7 +29,6 @@ import java.io.IOException
import java.text.SimpleDateFormat
import java.util.*
class PhotosFragment(
var title: String,
var uriImage: Uri?
@ -50,7 +49,6 @@ class PhotosFragment(
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
binding.mainToolbar.toolbarTitle.text = title
binding.splashProgress.visibility = GONE
setEvents()
setToolBar()
setImage()
@ -91,7 +89,6 @@ class PhotosFragment(
iconSend.drawable -> upLoadPhoto()
}
}
})
binding.mainToolbar.toolbarIcons.layoutManager =
@ -118,12 +115,10 @@ class PhotosFragment(
).toString().toLong()
try {
binding.splashProgress.visibility = VISIBLE
viewModel.getItemCard(
originalItem, getDataInt(WAREHOUSEFK)
)
} catch (Ex: Exception) {
ma.messageWithSound(Ex.message.toString(), true, true)
}
@ -143,7 +138,6 @@ class PhotosFragment(
with(viewModel) {
responseinsert.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(
it.errorMessage + getString(R.string.user) + title,
@ -161,7 +155,6 @@ class PhotosFragment(
}
itemcard.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
@ -196,7 +189,6 @@ class PhotosFragment(
val drawable = binding.itemcardImage.drawable
if (drawable is BitmapDrawable) {
val bitmap = drawable.bitmap
binding.splashProgress.visibility = VISIBLE
viewModel.uploadPhoto(
itemFK = originalItem,
urlImage = saveBitmapAsTempFile(requireContext(), bitmap)
@ -239,12 +231,11 @@ class PhotosFragment(
binding.itemcardImage.setImageURI(data.data)
} else {
// Imagen cámara
var uri = saveBitmapAsTempFile(
val uri = saveBitmapAsTempFile(
requireContext(),
data?.extras?.get("data") as Bitmap
).toUri()
binding.itemcardImage.setImageURI(uri)
//binding.itemcardImage.setImageBitmap(data?.extras?.get("data") as? Bitmap?)
}
}

View File

@ -20,8 +20,7 @@ import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewMod
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
class ReubicationCollectionFragment(
var list: MutableList<Reubication>,
var shelving: String
var list: MutableList<Reubication>, var shelving: String
) : BaseFragment<FragmentReubicationCollectionBinding, UbicadorViewModel>(
UbicadorViewModel::class
) {
@ -33,8 +32,7 @@ class ReubicationCollectionFragment(
companion object {
fun newInstance(
entryPoint: MutableList<Reubication>,
shelving: String
entryPoint: MutableList<Reubication>, shelving: String
): ReubicationCollectionFragment {
return ReubicationCollectionFragment(entryPoint, shelving)
@ -73,15 +71,12 @@ class ReubicationCollectionFragment(
adapter = ReubicatorAdapter(list.sortedWith(compareBy { item ->
item.carros.getOrNull(0)?.pickingOrder ?: 0
}),
pasillerosItemClickListener!!,
object :
OnReubicationClickListener {
override fun onReubicationClick(reubication: Reubication) {
showLeaveItemDialog(reubication)
}
}), pasillerosItemClickListener!!, object : OnReubicationClickListener {
override fun onReubicationClick(reubication: Reubication) {
showLeaveItemDialog(reubication)
}
})
})
binding.reubicatorCollectionsRecycler.adapter = adapter
binding.reubicatorCollectionsRecycler.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
@ -94,7 +89,6 @@ class ReubicationCollectionFragment(
}
binding.collectionSwipe.setOnRefreshListener {
callItemShelvingReturn()
binding.collectionSwipe.isRefreshing = false
@ -120,33 +114,23 @@ class ReubicationCollectionFragment(
false
}
}
private fun scanPlate(plate: String) {
//showLeaveItemDialog(plate)
var found = false
all_list@ for (items in list) {
for (placements in items.carros) {
if (placements.shelvingFk == plate) {
found = true
showLeaveItemDialog(items)
break@all_list
}
}
}
if (!found) {
ma.messageWithSound(
getString(R.string.itemScanetNotFound),
true,
true,
isToasted = true
getString(R.string.itemScanetNotFound), true, true, isToasted = true
)
}
}
@ -189,18 +173,14 @@ class ReubicationCollectionFragment(
}
private fun customDialogMerge(itemReubication: Reubication) {
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelving_merge(
itemReubication.id,
customDialogInputTwoValues.getValueTwo().uppercase()
itemReubication.id, customDialogInputTwoValues.getValueTwo().uppercase()
)
} else {
ma.messageWithSound(
getString(R.string.returnScan),
true,
true,
isToasted = true
getString(R.string.returnScan), true, true, isToasted = true
)
}
customDialogInputTwoValues.setValue("")
@ -210,7 +190,6 @@ class ReubicationCollectionFragment(
}
private fun scanRequest() {
binding.scanInput.requestFocus()
@ -219,7 +198,6 @@ class ReubicationCollectionFragment(
override fun observeViewModel() {
with(viewModel) {
loadReubicationList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = GONE
@ -249,19 +227,7 @@ class ReubicationCollectionFragment(
}
response.observe(viewLifecycleOwner) {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, true)
} else {
ma.messageWithSound(it.response, false, false, "", false)
callItemShelvingReturn()
}
callItemShelvingReturn()
}
}
@ -269,7 +235,6 @@ class ReubicationCollectionFragment(
private fun callItemShelvingReturn() {
binding.splashProgress.visibility = VISIBLE
viewModel.itemShelving_return(
shelvingFk = shelving,
)

View File

@ -62,10 +62,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
fun itemShelvingList(
vShelvingFk: String
) {
salix.itemShelvingList(params = listOf(vShelvingFk.uppercase()).formatWithQuotes())
.enqueue(
object :
SalixCallback<List<ItemUbicadorVO>>(context) {
salix.itemShelvingList(params = listOf(vShelvingFk.uppercase()).formatWithQuotes()).enqueue(
object : SalixCallback<List<ItemUbicadorVO>>(context) {
override fun onSuccess(response: Response<List<ItemUbicadorVO>>) {
_shelvingList.value = response.body()?.let { ItemUbicadorListVO(it) }
}
@ -90,8 +88,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun shelvingPriorityUpdate(
priority: Int,
shelving: String
priority: Int, shelving: String
) {
salix.updateShelvingPriority(
@ -113,15 +110,11 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun itemShelvingAddList(
shelving: String,
items: Any,
isChecking: Boolean,
warehouse: Int
shelving: String, items: Any, isChecking: Boolean, warehouse: Int
) {
salix.itemShelvingAddList(
arrayListOf(shelving, items, isChecking, warehouse).formatWithQuotes()
).enqueue(object :
SilexCallback<Any>(context) {
).enqueue(object : SilexCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_responseAddList.value =
ResponseItemVO(isError = false, response = response.message()!!)
@ -140,12 +133,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun itemShelvingAdd(
shelving: String,
item: Number,
quantity: Int,
packing: Int?,
warehouse: Int,
grouping: Int?
shelving: String, item: Number, quantity: Int, packing: Int?, warehouse: Int, grouping: Int?
) {
salix.itemShelvingAdd(
arrayListOf(
@ -174,10 +162,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun itemShelvingMakeEdit(
quantity: Int,
packing: Int,
itemShelvingFk: Int,
grouping: Int?
quantity: Int, packing: Int, itemShelvingFk: Int, grouping: Int?
) {
salix.itemShelvingUpdate(
@ -201,18 +186,15 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun setParking(
shelving: String,
parking: String
shelving: String, parking: String
) {
salix.setParking(arrayListOf(shelving, parking).formatWithQuotes())
.enqueue(object : Callback<Any> {
override fun onResponse(call: Call<Any>, response: Response<Any>) {
if (!response.isSuccessful) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), response.message()
)
)
} else {
@ -231,25 +213,17 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun itemShelving_merge(
vShelf: Int,
vShelvingFk: String
vShelf: Int, vShelvingFk: String
) {
salix.itemShelvingsUpdate(
where = JsonObject().apply { addProperty("id", vShelf) },
params = hashMapOf("shelvingFk" to vShelvingFk)
)
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message()!!)
super.onSuccess(response)
}
})
}
@ -261,8 +235,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
salix.itemShelvingsUpdate(
where = JsonObject().apply { addProperty("shelvingFk", vShelvingFk) },
params = hashMapOf("isChecked" to null)
)
.enqueue(object : SilexCallback<Any>(context) {
).enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
@ -281,9 +254,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
code: String
) {
//Tarea 6276
// salix.shelvingLogAdd(hashMapOf("code" to code))
silex.shelvingLog_add(code)
.enqueue(object : SalixCallback<Any>(context) {
// salix.shelvingLogAdd(hashMapOf("code" to code))
silex.shelvingLog_add(code).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_responseLog.value =
@ -305,9 +277,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
val listError: ArrayList<Reubication> = ArrayList()
listError.add(
Reubication(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
0, isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!,
@ -322,11 +292,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
val listError: ArrayList<Reubication> = ArrayList()
listError.add(
Reubication(
0,
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
0, isError = true, errorMessage = getMessageFromAllResponse(
nameofFunction(this), response.message()
)
)
)
@ -348,8 +315,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
salix.itemShelvingsUpdate(
where = JsonObject().apply { addProperty("shelvingFk", shelvingFk) },
hashMapOf("visible" to 0)
)
.enqueue(object : SalixCallback<Any>(context) {
).enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
@ -358,23 +324,20 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_response.value = ResponseItemVO(isError = false, response = response.message())
}
})
}
fun shelvingChangeSalix(
shelvingFkIn: String,
shelvingFkOut: String
shelvingFkIn: String, shelvingFkOut: String
) {
salix.itemShelvingsUpdate(
where = JsonObject().apply { addProperty("shelvingFk", shelvingFkIn) },
hashMapOf("shelvingFk" to shelvingFkOut)
)
.enqueue(object : SalixCallback<Any>(context) {
).enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
@ -383,15 +346,13 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_response.value = ResponseItemVO(isError = false, response = response.message())
}
})
}
fun itemShelvingTransfer(
itemFk: Int,
shelvingFk: String
itemFk: Int, shelvingFk: String
) {
salix.itemShelvingTransfer(arrayListOf(itemFk, shelvingFk).formatWithQuotes())
@ -411,8 +372,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun itemShelvingDelete(itemFk: Int) {
salix.itemShelvingsDelete(itemFk)
.enqueue(object : SalixCallback<Any>(context) {
salix.itemShelvingsDelete(itemFk).enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
@ -422,8 +382,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_response.value = ResponseItemVO(isError = false, response = response.message())
}
})
@ -432,15 +391,11 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
fun itemShelvingSelfConsumption(shelvingFk: String, itemFk: Int, quantity: Int) {
salix.itemShelvingSelfConsumption(
arrayListOf(
shelvingFk,
itemFk,
quantity
shelvingFk, itemFk, quantity
).formatWithQuotes()
)
.enqueue(object : SalixCallback<Any>(context) {
).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
_response.value = ResponseItemVO(isError = false, response = response.message())
}
override fun onError(t: Throwable) {
@ -454,8 +409,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
}
fun getIdFromCode(code: String) {
salix.barcodes_toitem(code)
.enqueue(object : SilexCallback<String?>(context) {
salix.barcodes_toitem(code).enqueue(object : SilexCallback<String?>(context) {
override fun onError(t: Throwable) {
_responseCode.value = ResponseItemVO(
isError = true,
@ -467,8 +421,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
if (response.body() == null) {
_responseCode.value = ResponseItemVO(
isError = true,
errorMessage = context.getString(R.string.itemNotValid)
isError = true, errorMessage = context.getString(R.string.itemNotValid)
)
} else {
_responseCode.value =

View File

@ -3,12 +3,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black"
>
android:background="@color/verdnatura_black">
<LinearLayout
android:id="@+id/linearLayout2"
@ -50,7 +48,6 @@
android:textSize="@dimen/body2" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
@ -65,36 +62,12 @@
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
tools:listitem="@layout/item_expeditionpallet_row" />
' <include
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="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>
</layout>

View File

@ -6,8 +6,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black"
>
android:background="@color/verdnatura_black">
<LinearLayout
android:id="@+id/linearLayout2"
@ -39,7 +38,6 @@
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
@ -54,36 +52,12 @@
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
tools:listitem="@layout/item_expeditiontruck_row" />
' <include
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="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>
</layout>

View File

@ -31,22 +31,20 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColorHint="@android:color/darker_gray"
android:visibility="gone">
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_matricula"
style="@style/InputLineTextSearch"
android:layout_width="match_parent"
android:backgroundTint="@android:color/white"
android:gravity="center"
android:hint="@string/Escaneamatricula"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/holo_orange_light" />
android:visibility="gone"></com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_matricula"
style="@style/InputLineTextSearch"
android:layout_width="match_parent"
android:backgroundTint="@android:color/white"
android:gravity="center"
android:hint="@string/Escaneamatricula"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/holo_orange_light" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textinputlayout_prioridad"
@ -128,31 +126,5 @@
app:layout_constraintStart_toStartOf="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="gone"
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>
</layout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
@ -19,19 +18,17 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
android:orientation="vertical">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_itemFk"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:layout_marginBottom="@dimen/layout_margin_1"
android:hint="@string/scanItemUpload"
android:inputType="text"
android:textColor="@color/verdnatura_white"
android:textColorHint="@color/verdnatura_white"
android:layout_marginBottom="@dimen/layout_margin_1"
/>
android:textColorHint="@color/verdnatura_white" />
<LinearLayout
android:id="@+id/itemcard_layout"
@ -44,74 +41,42 @@
android:id="@+id/itemcard_image"
android:layout_width="@dimen/itemcard_image"
android:layout_height="@dimen/itemcard_image"
android:scaleType="centerCrop"
android:src="@drawable/loadphoto"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/layout_margin_1"/>
android:layout_marginBottom="@dimen/layout_margin_1"
android:scaleType="centerCrop"
android:src="@drawable/loadphoto" />
<TextView
android:id="@+id/item_data"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/ef_margin_small"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:ellipsize="end"
android:textSize="@dimen/body1"
android:textColor="@color/verdnatura_pumpkin_orange"
android:textColorHint="@color/verdnatura_white"
android:layout_margin="@dimen/ef_margin_small"
/>
android:textSize="@dimen/body1" />
<ImageView
android:id="@+id/itemcard_original"
android:layout_width="@dimen/itemcard_image"
android:layout_height="@dimen/itemcard_image"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:src="@drawable/loadphoto"
android:visibility="invisible"
android:layout_gravity="center"/>
android:visibility="invisible" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="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"
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
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>
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>