refs #5135: refactor animation

This commit is contained in:
Sergio De la torre 2024-01-03 14:23:19 +01:00
parent e29ba01e51
commit f950dd0bd7
20 changed files with 270 additions and 788 deletions

View File

@ -71,14 +71,20 @@ class MobileApplication : Application(), InteceptorListener {
if (bool) mpok!!.start() else mperror!!.start()
}
fun messageToast(isError: Boolean, message:String) {
fun messageToast(isError: Boolean, message: String) {
val playSound = when (isError) {
null -> null
false -> mpok
true -> mperror
}
playSound?.start()
message.toast(this,color = Color.RED)
message.toast(
this, color = if (isError) {
Color.RED
} else {
Color.BLUE
}
)
}
override fun onInterceptionResult(visibility: Int) {

View File

@ -238,11 +238,8 @@ class ItemCardFragment(
response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
getItemCard(itemInfoG!!.id.toString())
}
getItemCard(itemInfoG!!.id.toString())
})
addressLosesList.observe(viewLifecycleOwner, Observer {
@ -565,12 +562,11 @@ class ItemCardFragment(
//Tarea 5652 , quitar código cuando está asignada tarea
val test = true
if (test) {
binding.splashProgress.visibility = View.VISIBLE
// binding.splashProgress.visibility = View.VISIBLE
viewModel.getAddress()
quantityToDiscard = value
} else {
println("dardebaja")
try {
if (itemB.action == "itemStockUpdateRemove") {
@ -686,6 +682,7 @@ class ItemCardFragment(
i += 1
}
listBarcodes.removeAt(posDelete)
viewModel.barcodesEdit(
itemFk = itemInfoG!!.id,
value = code,

View File

@ -9,9 +9,9 @@ import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.ItemBarCodeSalix
import es.verdnatura.presentation.common.ItemDiscardSalixShortage
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.common.itemBarCodeSalix
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
import es.verdnatura.presentation.view.feature.articulo.model.AddressLosesList
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
@ -50,8 +50,10 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
itemFk: Number,
warehouseFk: Int,
) {
silex.getItemCard(itemFk, warehouseFk)
.enqueue(object : SilexCallback<ItemCardVO>(context) {
//Tarea 6276
// salix.getCard(itemFk = itemFk, warehouseFk = warehouseFk)
silex.getItemCard(itemFk, warehouseFk)
.enqueue(object : SalixCallback<ItemCardVO>(context) {
override fun onError(t: Throwable) {
_itemcard.value = ItemCardVO(
0,
@ -170,13 +172,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
ResponseItemVO(isError = false, response = response.message())
}
override fun onError(t: Throwable) {
super.onError(t)
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
})
}
@ -193,13 +188,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
ResponseItemVO(isError = false, response = response.message())
}
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
})
}
@ -226,12 +214,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
) {
salix.updateItem(itemFk, hashMapOf("stems" to value))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) {
_response.value =
@ -246,12 +228,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
) {
salix.updateItem(itemFk, hashMapOf("comment" to value))
.enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(isError = false)
@ -263,8 +239,9 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
itemFk: Int,
value: String,
delete: Boolean
) {//Tarea 5134 cambiar Silex para obtener el id y así poder hacer un DELETE y un PATCH
// salix.barcodes_edit(idBarcode:Int, )
) {
//Tarea 6276
//salix.barcodesDelete(itemFk = itemFk, barcode = value)
silex.barcodes_edit(value, itemFk, delete)
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
@ -288,7 +265,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
fun barcodesEditSalix(itemFk: Int, barCodeValue: String) {
salix.barcodes_edit(
itemBarCodeSalix(itemFk, barCodeValue)
ItemBarCodeSalix(itemFk, barCodeValue)
)
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
@ -340,29 +317,9 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
fun getAddress() {
salix.getAddressSalix("""{ "include": [ { "relation": "address", "scope": { "fields": { "nickname": true } } } ] }""")
.enqueue(object : SilexCallback<List<AddressLoses>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<AddressLoses> = ArrayList()
listError.add(AddressLoses(isError = true, errorMessage = t.message!!))
_addressLosesList.value = AddressLosesList(listError)
}
.enqueue(object : SalixCallback<List<AddressLoses>>(context) {
override fun onSuccess(response: Response<List<AddressLoses>>) {
if (response.body() != null) {
_addressLosesList.value = response.body()?.let { AddressLosesList(it) }
} else {
val listError: ArrayList<AddressLoses> = ArrayList()
listError.add(
AddressLoses(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_addressLosesList.value = AddressLosesList(listError)
}
_addressLosesList.value = response.body()?.let { AddressLosesList(it) }
}
})
}

View File

@ -1,7 +1,9 @@
package es.verdnatura.presentation.view.feature.diadeventa.adapter
import android.os.Build
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
@ -30,6 +32,7 @@ class DayOfSaleAdapter(
override fun getItemCount() = items.size
@RequiresApi(Build.VERSION_CODES.O)
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
}
@ -38,6 +41,7 @@ class DayOfSaleAdapter(
val binding: ItemShelvingdayofsaleRowBinding
) : RecyclerView.ViewHolder(binding.root) {
private val res = binding.root.context.resources
@RequiresApi(Build.VERSION_CODES.O)
fun bind(item: ItemShelvingSaleDate) {
binding.apply {
this.item = item

View File

@ -3,10 +3,8 @@ package es.verdnatura.presentation.view.feature.diadeventa.fragment
import android.content.Context
import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentItemdayofsaleCardBinding
@ -61,7 +59,6 @@ class DayOfSaleFragment(
}
listIcons.add(iconParking)
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
@ -83,8 +80,9 @@ class DayOfSaleFragment(
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
getItemsSaleDate(binding.scanInput.text.toString())
itemScan = binding.scanInput.text.toString()
viewModel.itemShelvingGetSaleDate(binding.scanInput.text.toString())
binding.mainToolbar.toolbarTitle.text =
entryPoint + ":" + binding.scanInput.text.toString().uppercase()
}
binding.scanInput.setText("")
ma.hideKeyboard(binding.scanInput)
@ -93,24 +91,24 @@ class DayOfSaleFragment(
false
}
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
}
private fun getItemsSaleDate(vShelvingFK: String) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingGetSaleDate(vShelvingFK)
}
override fun observeViewModel() {
with(viewModel) {
itemShelvingSaleDateList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
itemShelvingSaleDateList.observe(viewLifecycleOwner) {
if (it.list.isEmpty()) {
customDialog.setTitle(getString(R.string.noResults))
.setDescription(getString(R.string.wagoonNoSaleToday))
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
}
adapter = DayOfSaleAdapter(
it.list,
onPasillerosItemClickListener = pasillerosItemClickListener!!
@ -119,33 +117,13 @@ class DayOfSaleFragment(
binding.itemexpeditionstateRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
if (it.list.isEmpty()) {
customDialog.setTitle(getString(R.string.noResults))
.setDescription(getString(R.string.wagoonNoSaleToday))
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
} else {
}
if (it.list.get(0).isError) {
ma.messageWithSound(
it.list.get(0).errorMessage,
it.list.get(0).isError,
isPlayed = false
)
}
}
})
response.observe(viewLifecycleOwner, Observer {
response.observe(viewLifecycleOwner) {
if (it.isError) {
binding.splashProgress.visibility = View.GONE
ma.messageWithSound(it.errorMessage, true, false)
} else {
customDialog.setTitle(getString(R.string.info))
.setDescription(getString(R.string.parkingOk))
.setOkButton(getString(R.string.close)) {
@ -154,7 +132,7 @@ class DayOfSaleFragment(
}
})
}
}
}
@ -169,14 +147,16 @@ class DayOfSaleFragment(
customDialogList.dismiss()
}.setValue("").show()
customDialogList.getEditText().requestFocus()
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (customDialogList.getValue().isNotEmpty()) {
parking(customDialogList.getValue())
viewModel.setParking(
parking = customDialogList.getValue(),
scanItem = itemScan
)
customDialogList.dismiss()
}
customDialogList.setValue("")
ma.hideKeyboard(customDialogList.getEditText())
@ -187,14 +167,6 @@ class DayOfSaleFragment(
}
fun parking(parking: String) {
viewModel.setParking(
parking = parking,
scanItem = itemScan
)
customDialogList.dismiss()
}
}

View File

@ -13,7 +13,6 @@ import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDateList
import retrofit2.Call
import retrofit2.Response
class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
@ -77,31 +76,10 @@ class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
})
}
/* fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics> {
val gson = Gson()
var list = mutableListOf<itemsExpeditionDynamics>()
var expeditionState: Map<String, Any> = gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
expeditionState.forEach {
list.add(itemsExpeditionDynamics(key=it.key,value=it.value.toString()))
}
return list
}*/
fun setParking(scanItem: String, parking: String) {
salix.setParking(arrayListOf(scanItem, parking).formatWithQuotes())
.enqueue(object :
SalixCallback<Any>(context) {
override fun onResponse(call: Call<Any>, 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,9 +1,7 @@
package es.verdnatura.presentation.view.feature.historicoshelving.fragment
import android.content.Context
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentItemshelvinglogBinding
@ -32,8 +30,6 @@ class ItemShelvingLogFragment(
override fun init() {
customDialog = CustomDialog(requireContext())
// customDialogList = CustomDialogList(requireContext())
setEvents()
setToolBar(getString(R.string.itemShelvingLog))
super.init()
@ -54,7 +50,6 @@ class ItemShelvingLogFragment(
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (binding.scanInput.text.toString().isNotEmpty()) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingLogGet(binding.scanInput.text.toString())
itemScan = binding.scanInput.text.toString()
}
@ -64,7 +59,6 @@ class ItemShelvingLogFragment(
}
false
}
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
@ -73,16 +67,7 @@ class ItemShelvingLogFragment(
override fun observeViewModel() {
with(viewModel) {
itemShelvingLogList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
adapter = ItemShelvingLogAdapter(
it.list,
onPasillerosItemClickListener = pasillerosItemClickListener!!
)
binding.itemshelvinglogRecyclerview.adapter = adapter
binding.itemshelvinglogRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
setToolBar(getString(R.string.itemShelvingLog) + ":" + itemScan)
itemShelvingLogList.observe(viewLifecycleOwner) {
if (it.list.isEmpty()) {
customDialog.setTitle(getString(R.string.noResults))
@ -91,17 +76,16 @@ class ItemShelvingLogFragment(
customDialog.dismiss()
}.show()
} else {
if (it.list.get(0).isError) {
customDialog.setTitle(getString(R.string.error))
.setDescription(it.list.get(0).errorMessage)
.setOkButton(getString(R.string.close)) {
customDialog.dismiss()
}.show()
}
adapter = ItemShelvingLogAdapter(
it.list,
onPasillerosItemClickListener = pasillerosItemClickListener!!
)
binding.itemshelvinglogRecyclerview.adapter = adapter
binding.itemshelvinglogRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
setToolBar(getString(R.string.itemShelvingLog) + ":" + itemScan)
}
})
}
}
}

View File

@ -4,11 +4,9 @@ import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.SilexCallback
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
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.view.feature.historicoshelving.model.ItemShelvingLog
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLogList
@ -27,30 +25,13 @@ class ItemShelvingLogViewModel(val context: Context) : BaseViewModel(context) {
//silex.itemShelvingLog_get(vShelvingFK)
salix.itemShelvingLogGet(params = listOf(vShelvingFK).formatWithQuotes())
.enqueue(object :
SilexCallback<List<ItemShelvingLog>>(context) {
SalixCallback<List<ItemShelvingLog>>(context) {
override fun onSuccess(response: Response<List<ItemShelvingLog>>) {
if (response.body() != null) {
_itemShelvingLogList.value = response.body()?.let {
ItemShelvingLogList(it)
}
_itemShelvingLogList.value = response.body()?.let {
ItemShelvingLogList(it)
}
}
override fun onError(t: Throwable) {
val listError: ArrayList<ItemShelvingLog> = ArrayList()
listError.add(
ItemShelvingLog(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_itemShelvingLogList.value = ItemShelvingLogList(listError)
}
})
}

View File

@ -19,7 +19,7 @@ class ItemShelvingLog(
var created: String = ""
@RequiresApi(Build.VERSION_CODES.O)
get(){
return field.isoToString(returnOnlyDate = true)
return field.isoToString(returnOnlyDate = false)
}
}

View File

@ -1,6 +1,8 @@
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
import android.os.Build
import android.view.View
import androidx.annotation.RequiresApi
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
@ -14,7 +16,7 @@ import java.util.Date
class HistoricoVehiculoFragment(
var numberPlate: String = ""
private var numberPlate: String = ""
) : BaseFragment<FragmentHistoricovehiculoBinding, HistoricoVehiculoViewModel>(
HistoricoVehiculoViewModel::class
) {
@ -37,39 +39,30 @@ class HistoricoVehiculoFragment(
super.init()
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
}
}
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
loadHistoricoVehiculoList.observe(viewLifecycleOwner, Observer { event ->
event.getContentIfNotHandled().notNull {
binding.splashProgress.visibility = View.GONE
adapter = HistoricoVehiculoAdapter(it.list)
binding.historicovehiculoRecyclerview.adapter = adapter
binding.historicovehiculoRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
navigateToToday(it)
if (it.list.isEmpty()) {
ma.messageWithSound(
getString(R.string.lookWithpermission), true, true, getString(
getString(R.string.lookWithpermission), isError = true, isPlayed = true, getString(
R.string.info
)
)
} else {
if (it.list[0].isError) {
ma.messageWithSound(
it.list[0].errorMessage, true, true, getString(
R.string.info
)
)
}
adapter = HistoricoVehiculoAdapter(it.list)
binding.historicovehiculoRecyclerview.adapter = adapter
binding.historicovehiculoRecyclerview.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
navigateToToday(it)
}
}
@ -77,6 +70,7 @@ class HistoricoVehiculoFragment(
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun navigateToToday(it: ItemHistoricoVehiculoList) {
var positionToday = 0
val sdf = SimpleDateFormat(getString(R.string.dateFormat))

View File

@ -6,8 +6,6 @@ import androidx.lifecycle.Transformations
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.formatWithQuotes
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.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
@ -29,19 +27,6 @@ class HistoricoVehiculoViewModel(var context: Context) : BaseViewModel(context)
response.body()?.let { ItemHistoricoVehiculoList(it) }
}
override fun onError(t: Throwable) {
val listError: ArrayList<ItemHistoricoVehiculo> = ArrayList()
listError.add(
ItemHistoricoVehiculo(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_historicovehiculoList.value = ItemHistoricoVehiculoList(listError)
}
})
}
}

View File

@ -6,10 +6,10 @@ import android.graphics.drawable.Drawable
import android.os.Build
import android.view.View
import android.widget.ImageView
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentInventaryBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnInvetoryNichoClickListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener
@ -53,17 +53,13 @@ class InventaryFragment :
override fun init() {
binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingBuyerGet()
binding.filterBuyer.text = getData(BUYER)
buyerId = getData(BUYERID)
if (!buyerId.isBlank()) {
binding.splashProgress.visibility = View.VISIBLE
if (buyerId.isNotBlank()) {
viewModel.getInventory(buyerId.toInt(), getDataInt(WAREHOUSEFK))
}
binding.filterBuyer.setOnClickListener {
//SimpleSearchDialogCompat(context,getString(R.string.compradores),getString(R.string.escribirparteNombre),null,initData(),
SimpleSearchDialogCompat(context,
getString(R.string.compradores),
getString(R.string.escribirparteNombre),
@ -73,27 +69,22 @@ class InventaryFragment :
binding.filterBuyer.text = (nombre.title)
buyerId = nombre.getBuyerId()
saveBuyer(nombre.getBuyerNickname(),nombre.getBuyerId())
saveBuyer(nombre.getBuyerNickname(), nombre.getBuyerId())
viewModel.getInventory(
nombre.getBuyerId().toInt(),
getDataInt(WAREHOUSEFK)
)
binding.splashProgress.visibility = View.VISIBLE
baseSearchDialogCompat.dismiss()
}).show()
}
customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext())
binding.splashProgress.visibility = View.VISIBLE
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemShelvingRadar)
setToolBar()
setEvents()
super.init()
}
private fun setToolBar() {
ma.hideBottomNavigation(View.GONE)
val listIcons: ArrayList<ImageView> = ArrayList()
@ -115,7 +106,6 @@ class InventaryFragment :
buyerId.toInt(),
getDataInt(WAREHOUSEFK)
)
binding.splashProgress.visibility = View.VISIBLE
} else {
ma.messageWithSound(
getString(R.string.selectBuyer),
@ -125,7 +115,6 @@ class InventaryFragment :
)
}
}
}
@ -161,7 +150,7 @@ class InventaryFragment :
) || it.producer?.contains(
binding.filterItemFk.text.toString(),
true
)== true || it.longName?.contains(
) == true || it.longName?.contains(
binding.filterItemFk.text.toString(),
ignoreCase = true
) == true
@ -189,13 +178,11 @@ class InventaryFragment :
override fun observeViewModel() {
with(viewModel) {
buyersList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
buyersList.observe(viewLifecycleOwner) {
createBuyerList(it.list)
})
}
inventaryList.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
inventaryList.observe(viewLifecycleOwner) { it ->
listInvetory = ArrayList()
listInvetoryAux = ArrayList()
it.list.forEach {
@ -204,14 +191,11 @@ class InventaryFragment :
listInvetoryAux.add(it)
}
}
adapter = InventoryAdapter(listInvetory, object : OnInvetoryNichoClickListener {
override fun onInvetoryNichoClickListener(item: ItemInventaryVO) {
customDialog.setTitle(item.itemFk.toString() + "\n" + item.longName)
.setDescription(getString(R.string.quantityReal) + item.nicho + ")")
.setOkButton(getString(R.string.pull)) {
binding.splashProgress.visibility = View.VISIBLE
viewModel.itemTrash(
item.itemFk!!.toInt(),
getDataInt(WAREHOUSEFK),
@ -238,48 +222,33 @@ class InventaryFragment :
)
}
})
}
response.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = View.GONE
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, true)
} else {
changeOfflineValue(itemClicked)
}
})
response.observe(viewLifecycleOwner) {
changeOfflineValue(itemClicked)
}
}
}
@SuppressLint("NotifyDataSetChanged")
private fun changeOfflineValue(item: ItemInventaryVO) {
try {
listInvetory.removeAt(listInvetory.indexOf(item))
listInvetoryAux.removeAt(listInvetoryAux.indexOf(item))
} catch (excep: Exception) {
} catch (ex: Exception) {
ex.message!!.toast(requireContext())
}
adapter?.notifyDataSetChanged()
}
//sergio:añadido para compradores
private fun createBuyerList(list: List<BuyerVO>) {
items.clear()
list.forEach { buyer ->
if (!buyer.isError) {
try {
items.add(SearchBuyerModel(buyer.nickname, buyer.userFk))
} catch (e: Exception) {
}
if (list.isNotEmpty())
list.forEach { buyer ->
items.add(SearchBuyerModel(buyer.nickname, buyer.userFk))
}
}
}
}

View File

@ -80,36 +80,9 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
//sergio para obtener comprador
fun itemShelvingBuyerGet() {
salix.getBuyers("""{"order":"nickname"}""").enqueue(object :
SilexCallback<List<BuyerVO>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<BuyerVO> = ArrayList()
listError.add(
BuyerVO(
0, "",
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
)
_buyersList.value = BuyerListVO(listError)
}
SalixCallback<List<BuyerVO>>(context) {
override fun onSuccess(response: Response<List<BuyerVO>>) {
if (response.body() != null) {
_buyersList.value = response.body()?.let { BuyerListVO(it) }
} else {
val listError: ArrayList<BuyerVO> = ArrayList()
listError.add(
BuyerVO(
0, "",
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
)
)
)
_buyersList.value = BuyerListVO(listError)
}
_buyersList.value = response.body()?.let { BuyerListVO(it) }
}
})
@ -125,20 +98,6 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
_inventaryList.value = response.body()?.let { InventaryListVO(it) }
}
override fun onError(t: Throwable) {
val listError: ArrayList<ItemInventaryVO> = ArrayList()
listError.add(
ItemInventaryVO(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_inventaryList.value = InventaryListVO(listError)
}
})
}
@ -203,44 +162,16 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
_response.value =
ResponseItemVO(isError = false, response = response.message())
}
override fun onError(t: Throwable) {
_response.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
})
}
fun department_getHasMistake() {
fun departmentGetHasMistake() {
salix.department_getHasMistake()
.enqueue(object : SalixCallback<List<DepartmentMistake>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<DepartmentMistake> = ArrayList()
listError.add(
DepartmentMistake(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
)
)
)
_mistakeDepartmentList.value = departmentMistakeList(listError)
}
override fun onSuccess(response: Response<List<DepartmentMistake>>) {
if (response.body() != null) {
_mistakeDepartmentList.value =
response.body()?.let { departmentMistakeList(it) }
} else {
val listError: ArrayList<DepartmentMistake> = ArrayList()
listError.add(DepartmentMistake())
_mistakeDepartmentList.value = departmentMistakeList(listError)
}
_mistakeDepartmentList.value =
response.body()?.let { departmentMistakeList(it) }
}
})
}
@ -270,70 +201,26 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
})
}
fun workerMistakeType_get() {
//Tarea 5134
fun workerMistakeTypeGet() {
salix.workerMistakesTypes()
.enqueue(object : SilexCallback<List<MistakeType>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<MistakeType> = ArrayList()
listError.add(
MistakeType(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
t.message!!
),
description = ""
)
)
_mistakeWorkerList.value = workerMistakeTypeList(listError)
}
override fun onSuccess(response: Response<List<MistakeType>>) {
if (response.body() != null) {
_mistakeWorkerList.value =
response.body()?.let { workerMistakeTypeList(it) }
} else {
val listError: ArrayList<MistakeType> = ArrayList()
listError.add(
MistakeType(
isError = true,
errorMessage = getMessageFromAllResponse(
nameofFunction(this),
response.message()
),
description = ""
)
)
_mistakeWorkerList.value = workerMistakeTypeList(listError)
}
_mistakeWorkerList.value =
response.body()?.let { workerMistakeTypeList(it) }
}
})
}
fun workerMistake_Add(
fun workerMistakeAdd(
vUserFk: Int,
vTypeFk: String
) {
salix.workerMistakesAdd(WorkerMistakeSalix(vUserFk, vTypeFk))
.enqueue(object :
SilexCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseAddMistake.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) {
_responseAddMistake.value =
ResponseItemVO(
isError = false,
response = response.message()
)
}
SalixCallback<Any>(context) {
})
}

View File

@ -50,7 +50,7 @@ import es.verdnatura.presentation.view.feature.delivery.model.ClientTicket
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleFragment
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloFragment
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.ItemShelvingLogFragment
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.shelvingLogFragment
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.ShelvingLogFragment
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryFragment
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryParkingFragment
@ -83,7 +83,7 @@ import es.verdnatura.presentation.view.feature.ticket.fragment.TicketAdvanceFrag
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemFragment
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemFragmentTEST
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorFragment
import es.verdnatura.presentation.view.feature.workermistake.adapter.WorkermistakeFragment
import es.verdnatura.presentation.view.feature.workermistake.fragment.WorkermistakeFragment
import es.verdnatura.presentation.view.feature.workermistake.fragment.PackingMistakeFragment
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
@ -637,7 +637,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
}
getString(R.string.titleLogShelving) -> {
addFragmentOnTop(shelvingLogFragment.newInstance(item.title))
addFragmentOnTop(ShelvingLogFragment.newInstance(item.title))
}
getString(R.string.titleWorkerMistake) -> {

View File

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
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"
@ -13,50 +11,47 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/toolbar_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingTop="@dimen/toolbar_height">
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal"
android:paddingLeft="@dimen/layout_margin_min"
android:paddingRight="@dimen/layout_margin_min">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:text="@string/Worker"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="left"/>
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:text="@string/InTimed"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="left"/>
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/OutTimed"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center"
android:text="@string/OutTimed"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
</LinearLayout>
@ -65,47 +60,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
tools:listitem="@layout/item_historicovehiculo_row"/>
tools:listitem="@layout/item_historicovehiculo_row" />
</LinearLayout>
' <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: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>
</layout>

View File

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
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"
@ -12,11 +11,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/toolbar_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingTop="@dimen/toolbar_height">
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textinputlayout_username"
@ -24,57 +23,53 @@
android:layout_height="wrap_content"
android:textColorHint="@android:color/darker_gray">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/filter_itemFk"
style="@style/InputLineTextSearch"
android:layout_width="wrap_content"
android:layout_weight="1.5"
android:backgroundTint="@android:color/white"
android:hint="@string/itemFilter"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textAlignment="center"
android:textColor="@color/verdnatura_white"
android:textColorHint="#78909C"
tools:ignore="TextContrastCheck" />
<TextView
android:id="@+id/filter_buyer"
style="@style/InputLineTextSearch"
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:backgroundTint="@android:color/white"
android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp"
android:focusable="false"
android:hint="@string/buscarcomprador"
android:lines="1"
android:maxLines="1"
android:textAlignment="center"
android:textColor="@color/verdnatura_pumpkin_orange"
android:textColorHint="#78909C"
android:visibility="visible"
tools:ignore="TextContrastCheck" />
android:layout_height="match_parent"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/filter_itemFk"
style="@style/InputLineTextSearch"
android:layout_width="wrap_content"
android:layout_weight="1.5"
android:backgroundTint="@android:color/white"
android:hint="@string/itemFilter"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textAlignment="center"
android:textColor="@color/verdnatura_white"
android:textColorHint="#78909C"
tools:ignore="TextContrastCheck" />
<TextView
android:id="@+id/filter_buyer"
style="@style/InputLineTextSearch"
android:layout_width="match_parent"
android:layout_weight="1"
android:backgroundTint="@android:color/white"
android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp"
android:focusable="false"
android:hint="@string/buscarcomprador"
android:lines="1"
android:maxLines="1"
android:textAlignment="center"
android:textColor="@color/verdnatura_pumpkin_orange"
android:textColorHint="#78909C"
android:visibility="visible"
tools:ignore="TextContrastCheck" />
</LinearLayout>
</LinearLayout>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal"
android:paddingLeft="@dimen/layout_margin_min"
android:paddingRight="@dimen/layout_margin_min">
@ -115,13 +110,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
tools:listitem="@layout/item_inventary_row"/>
tools:listitem="@layout/item_inventary_row" />
</LinearLayout>
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
@ -129,34 +121,5 @@
app:layout_constraintStart_toStartOf="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>
</layout>

View File

@ -1,16 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
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">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="0dp"
@ -23,87 +19,86 @@
<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/scan_input"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/scan_input"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:hint="@string/Escaneaetiqueta"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/darker_gray" />
android:hint="@string/Escaneaetiqueta"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/darker_gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal"
android:paddingLeft="@dimen/layout_margin_min"
android:paddingRight="@dimen/layout_margin_min">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:text="ItemFk"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="left"/>
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:text="Nombre"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="left"/>
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Fecha"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Ubicado"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Stock"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center"
android:text="Stock"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
</LinearLayout>
<LinearLayout
android:id="@+id/itemcard_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical"
android:padding="10dp"
tools:ignore="ExtraText">
<RelativeLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
@ -115,47 +110,19 @@
android:clipToPadding="false"
android:visibility="visible"
tools:listitem="@layout/item_expeditionstate_row" />
</RelativeLayout>>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
' <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: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>
</layout>

View File

@ -1,16 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
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">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="0dp"
@ -23,87 +19,80 @@
<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/scan_input"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:hint="@string/Escaneaetiqueta"
android:inputType="text"
android:lines="1"
android:maxLines="1"
/>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/scan_input"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:hint="@string/Escaneaetiqueta"
android:inputType="text"
android:lines="1"
android:maxLines="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/layout_margin_min"
android:layout_marginBottom="@dimen/layout_margin_1"
android:orientation="horizontal"
android:paddingLeft="@dimen/layout_margin_min"
android:paddingRight="@dimen/layout_margin_min">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Item"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:gravity="center"
android:paddingLeft="@dimen/layout_margin_min"
android:gravity="center"/>
android:text="Item"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Nombre"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center"
android:text="Nombre"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Parking"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1.25"
android:gravity="right"
android:visibility="gone"/>
android:text="Parking"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:visibility="gone" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Carro"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="2"
android:gravity="center"/>
android:gravity="center"
android:text="Carro"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cantidad"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:gravity="right"
android:paddingRight="@dimen/layout_margin_min"/>
android:paddingRight="@dimen/layout_margin_min"
android:text="Cantidad"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
</LinearLayout>
<LinearLayout
android:id="@+id/itemcard_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical"
android:padding="10dp"
tools:ignore="ExtraText">
<RelativeLayout
@ -111,7 +100,7 @@
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<!--android:id="@+id/itemexpeditionstate_recyclerview"-->
<!--android:id="@+id/itemexpeditionstate_recyclerview"-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/itemshelvinglog_recyclerview"
android:layout_width="match_parent"
@ -119,46 +108,20 @@
android:clipToPadding="false"
android:visibility="visible"
tools:listitem="@layout/item_shelvinglog_row" />
</RelativeLayout>>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
' <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: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>
</layout>

View File

@ -1,16 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
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">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="0dp"
@ -23,22 +19,18 @@
<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/scan_input"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:hint="@string/Escaneaetiqueta"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@color/verdnatura_white"
/>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/scan_input"
style="@style/ScanLineTextSearch"
android:layout_width="match_parent"
android:hint="@string/Escaneaetiqueta"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@color/verdnatura_white" />
<LinearLayout
android:id="@+id/linearHeader"
@ -55,9 +47,8 @@
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/layout_margin_min"
android:text="Usuario"
android:text="@string/user"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
@ -65,40 +56,18 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Fecha"
android:text="@string/Fecha"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.25"
android:gravity="right"
android:text="Parking"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:visibility="gone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingRight="@dimen/layout_margin_min"
android:text="Acción"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="@+id/itemcard_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical"
android:padding="10dp"
tools:ignore="ExtraText">
<RelativeLayout
@ -106,7 +75,6 @@
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<!--android:id="@+id/itemexpeditionstate_recyclerview"-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/itemshelvinglog_recyclerview"
android:layout_width="match_parent"
@ -114,46 +82,20 @@
android:clipToPadding="false"
android:visibility="visible"
tools:listitem="@layout/shelvinglog_row" />
</RelativeLayout>>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<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: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>
</layout>

View File

@ -3,7 +3,6 @@
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">
@ -50,7 +49,6 @@
android:layout_width="match_parent"
android:layout_weight="1"
android:backgroundTint="@android:color/white"
android:drawableEnd="@drawable/ic_arrow_drop_down_black_24dp"
android:focusable="false"
android:hint="@string/buscarDepartamento"
android:inputType="text"
@ -59,12 +57,11 @@
android:textAlignment="center"
android:textColor="@color/verdnatura_pumpkin_orange"
android:textColorHint="@android:color/darker_gray"
android:visibility="visible" />
android:visibility="visible"
app:drawableEndCompat="@drawable/ic_arrow_drop_down_black_24dp" />
</LinearLayout>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
@ -81,7 +78,7 @@
android:layout_height="wrap_content"
android:layout_weight="1.25"
android:gravity="center"
android:text="Nombre"
android:text="@string/name"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
@ -90,7 +87,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Apellidos"
android:text="@string/surname"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body2" />
@ -114,9 +111,6 @@
</LinearLayout>
'
<include
android:id="@+id/main_toolbar"
layout="@layout/toolbar_fragment"
@ -124,30 +118,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="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>