refs #6284 feat:update && deprecated

This commit is contained in:
Sergio De la torre 2024-02-29 08:46:54 +01:00
parent 6c2855a7a4
commit ff00e0a5ef
74 changed files with 327 additions and 284 deletions

View File

@ -29,7 +29,7 @@ import es.verdnatura.presentation.view.feature.paletizador.fragment.PalletScanVi
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingViewModel
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel
import es.verdnatura.presentation.view.feature.photos.fragment.PhotosViewModel
import es.verdnatura.presentation.view.feature.precontrol.ShowTicketViewModel
import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketViewModel
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorViewModel
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorViewModel

View File

@ -1,8 +1,8 @@
package es.verdnatura.presentation.common
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView
class ItemDescorationCustomized(private val verticalSpaceHeight: Int) : RecyclerView.ItemDecoration() {

View File

@ -71,7 +71,7 @@ class testPrint(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.buttonPrintTemplate.setOnClickListener {

View File

@ -7,16 +7,13 @@ import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.textfield.TextInputEditText
import es.verdnatura.R
import es.verdnatura.databinding.ComponentCustomEditDialogBinding
import es.verdnatura.databinding.ComponentCustomEditDialogNotesBinding
class CustomDialogInputNotes(context: Context) : Dialog(context, R.style.DialogTheme) {
private var binding: ComponentCustomEditDialogNotesBinding =
ComponentCustomEditDialogNotesBinding.inflate(layoutInflater)
init {
setContentView(binding.root)
@ -82,7 +79,8 @@ class CustomDialogInputNotes(context: Context) : Dialog(context, R.style.DialogT
fun setFocusText() {
binding.customDialogValue.requestFocus()
}
fun getRecyclerView() : RecyclerView {
fun getRecyclerView(): RecyclerView {
return binding.recyclerItems
}
}

View File

@ -2,32 +2,26 @@ package es.verdnatura.presentation.view.component
import android.app.Dialog
import android.content.Context
import android.text.InputType
import android.view.View
import com.google.android.material.textfield.TextInputEditText
import es.verdnatura.R
import es.verdnatura.databinding.ComponentCustomEditDialogThreeValuesBinding
import es.verdnatura.databinding.ComponentCustomEditDialogTwoValuesBinding
class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.DialogTheme) {
private var binding: ComponentCustomEditDialogThreeValuesBinding =
ComponentCustomEditDialogThreeValuesBinding.inflate(layoutInflater)
init {
setContentView(binding.root)
}
fun getEditText(): TextInputEditText {
return binding.customDialogValueOne
}
fun getEditTextTwo(): TextInputEditText {
@ -40,7 +34,6 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
return binding.customDialogValueOne.text.toString()
}
fun getValueTwo(): String {
@ -48,6 +41,7 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
return binding.customDialogValueTwo.text.toString()
}
fun getValueThree(): String {
return binding.customDialogValueThree.text.toString()
@ -62,6 +56,7 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
return this
}
fun setValueTwo(value: String): CustomDialogInputThreeValues {
binding.customDialogValueTwo.setText(value)
@ -70,13 +65,15 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
return this
}
fun setEnableValue(isEnabled: Boolean): CustomDialogInputThreeValues {
binding.customDialogValueOne.isEnabled=isEnabled
binding.customDialogValueOne.isEnabled = isEnabled
return this
}
fun setTitle(title: String): CustomDialogInputThreeValues {
binding.customDialogTitle.visibility = View.VISIBLE
@ -113,19 +110,17 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
return this
}
fun setInfoTex(text:String,text2:String,text3:String){
fun setInfoTex(text: String, text2: String, text3: String) {
binding.customDialogValueOne.hint = text
binding.customDialogValueTwo.hint = text2
binding.customDialogValueThree.hint = text3
}
fun setInputTextTwoVisibility() {
binding.textinputlayoutTwo.visibility = View.VISIBLE
}
fun setInputTextVisibility(visibility:Int) {
fun setInputTextVisibility(visibility: Int) {
binding.textinputlayoutTwo.visibility = visibility
}
@ -136,6 +131,7 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
fun setFocusTextTwo() {
binding.customDialogValueTwo.requestFocus()
}
fun setFocusTextThree() {
binding.customDialogValueThree.requestFocus()
}

View File

@ -2,19 +2,16 @@ package es.verdnatura.presentation.view.component
import android.app.Dialog
import android.content.Context
import android.text.InputType
import android.view.View
import com.google.android.material.textfield.TextInputEditText
import es.verdnatura.R
import es.verdnatura.databinding.ComponentCustomEditDialogTwoValuesBinding
class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.DialogTheme) {
private var binding: ComponentCustomEditDialogTwoValuesBinding =
ComponentCustomEditDialogTwoValuesBinding.inflate(layoutInflater)
init {
setContentView(binding.root)
@ -27,7 +24,6 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
return binding.customDialogValue
}
fun getEditTextTwo(): TextInputEditText {
@ -40,7 +36,6 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
return binding.customDialogValue.text.toString()
}
fun getValueTwo(): String {
@ -66,13 +61,15 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
return this
}
fun setEnableValue(isEnabled: Boolean): CustomDialogInputTwoValues {
binding.customDialogValue.isEnabled=isEnabled
binding.customDialogValue.isEnabled = isEnabled
return this
}
fun setTitle(title: String): CustomDialogInputTwoValues {
binding.customDialogTitle.visibility = View.VISIBLE
@ -81,7 +78,6 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
return this
}
fun setDescription(description: String): CustomDialogInputTwoValues {
binding.customDialogDescription.visibility = View.VISIBLE
@ -111,29 +107,31 @@ class CustomDialogInputTwoValues(context: Context) : Dialog(context, R.style.Dia
}
fun setInputText() {
// binding.customDialogValue.inputType = InputType.TYPE_CLASS_NUMBER
// binding.customDialogValue.inputType = InputType.TYPE_CLASS_NUMBER
}
fun setInputTextTwo() {
// binding.customDialogValueTwo.inputType = InputType.TYPE_CLASS_NUMBER
// binding.customDialogValueTwo.inputType = InputType.TYPE_CLASS_NUMBER
}
fun setInfoTex(text:String){
fun setInfoTex(text: String) {
binding.textinputlayoutUsername.hint = text
}
fun setHint(visible:Boolean){
fun setHint(visible: Boolean) {
binding.textinputlayoutUsername.isHintEnabled = visible
binding.textinputlayoutTwo.isHintEnabled = visible
}
fun setInfoTextTwo(text:String){
fun setInfoTextTwo(text: String) {
binding.textinputlayoutTwo.hint = text
}
fun setInputTextTwoVisibility() {
binding.textinputlayoutTwo.visibility = View.VISIBLE
}
fun setInputTextVisibility(visibility:Int) {
fun setInputTextVisibility(visibility: Int) {
binding.textinputlayoutTwo.visibility = visibility
}

View File

@ -134,7 +134,7 @@ class AjustesFragment :
if (item.id == 0) {
viewModel.getSectorsSalix()
} else if (item.id == 5) {
ma.onBackPressed()
ma.onMyBackPressed()
} else if (item.id == 1) {
ma.messageWithSound(

View File

@ -178,7 +178,7 @@ class ItemCardFragment(
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
customDynamic.removeViewsDialog()
customDynamic.cancel()

View File

@ -110,7 +110,7 @@ class ItemProposalFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -30,7 +30,7 @@ class BufferFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()

View File

@ -80,7 +80,7 @@ class BufferLoadFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
@ -129,7 +129,7 @@ class BufferLoadFragment(
ma.hideKeyboard(customDialogList.getEditText())
listTags.clear()
customDialogList.dismiss()
ma.onBackPressed()
ma.onMyBackPressed()
}.setValue("").show()

View File

@ -64,7 +64,7 @@ class BuscarItemFragment(
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -64,7 +64,7 @@ class ClaimFragment(
binding.mainToolbar.backButton.setOnClickListener {
customDialogList.dismiss()
ma.onBackPressed()
ma.onMyBackPressed()
}
@ -118,7 +118,7 @@ class ClaimFragment(
ma.hideKeyboard(customDialogList.getEditText())
customDialogList.dismiss()
ma.onBackPressed()
ma.onMyBackPressed()
}.setValue("").show()

View File

@ -1,38 +1,39 @@
package es.verdnatura.presentation.view.feature.collection
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
class ItemVO(
var id : String = "",
var longName : String = "",
var visible : String = "",
var available : String = "",
var id: String = "",
var longName: String = "",
var visible: String = "",
var available: String = "",
var isError: Boolean = false,
var errorMessage: String = ""
)
class SalixSaleQuantity(
var saleId : Int =0,
var saleId: Int = 0,
var quantity: Int = 0
)
class listSaleSalix(
var sales: ArrayList<saleSalix>
)
class saleSalix(
var id : Int =0,
var id: Int = 0,
var quantity: Int = 0
)
class SalesModified(
var ticketFk:Int=0,
var itemFk:String="",
var concept:String="",
var originalQuantity:Int=0,
var newQuantity:Int=0,
var isError: Boolean=false,
var errorMessage: String=""
class SalesModified(
var ticketFk: Int = 0,
var itemFk: String = "",
var concept: String = "",
var originalQuantity: Int = 0,
var newQuantity: Int = 0,
var isError: Boolean = false,
var errorMessage: String = ""
)
class SalesModifiedList(
var list: List<SalesModified> = listOf()
)

View File

@ -369,7 +369,7 @@ class CollectionFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
//ESCANER =========
hideKeyboards()
@ -478,7 +478,7 @@ class CollectionFragment(
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
if (activity != null) ma.onBackPressed()
if (activity != null) ma.onMyBackPressed()
}.show()
}
@ -1467,7 +1467,7 @@ class CollectionFragment(
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
originalQuantity = sales[position].pickedQuantity!!,
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
buyFk = originalItemScan!!,
buyFk = originalItemScan,
isScanned = isScanned
)
@ -1484,7 +1484,7 @@ class CollectionFragment(
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
originalQuantity = sales[position].pickedQuantity!!,
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
buyFk = originalItemScan!!,
buyFk = originalItemScan,
itemShelvingFk = itemShelvingTracking_mark,
quantity = customDialogList.getValue().toInt(),
isScanned = isScanned
@ -1661,7 +1661,7 @@ class CollectionFragment(
requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
lManager.hideSoftInputFromWindow(
customDialogList.getEditTextTwo().windowToken,
InputMethodManager.SHOW_FORCED
InputMethodManager.SHOW_IMPLICIT
)
}

View File

@ -12,7 +12,6 @@ import android.os.Parcelable
import android.text.InputType
import android.text.InputType.TYPE_CLASS_NUMBER
import android.text.InputType.TYPE_CLASS_TEXT
import android.util.Log.d
import android.view.KeyEvent
import android.view.KeyEvent.ACTION_DOWN
import android.view.View
@ -30,7 +29,6 @@ import androidx.recyclerview.widget.RecyclerView
import com.google.gson.Gson
import es.verdnatura.R
import es.verdnatura.databinding.FragmentCollectionBinding
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
import es.verdnatura.domain.ConstAndValues.OK
import es.verdnatura.domain.ConstAndValues.PRECHECKER
@ -129,7 +127,6 @@ class CollectionFragmentPreChecker(
override fun getLayoutId(): Int = R.layout.fragment_collection
override fun onCreate(savedInstanceState: Bundle?) {
d("VERDNATURA::", "Precontrol test. No operativo todavia")
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
if (type.equals(CONTROLADOR)) {
@ -366,7 +363,7 @@ class CollectionFragmentPreChecker(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
//ESCANER =========
hideKeyboards()
@ -493,7 +490,7 @@ class CollectionFragmentPreChecker(
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
.setOkButton(getString(R.string.accept)) {
customDialog.dismiss()
if (activity != null) ma.onBackPressed()
if (activity != null) ma.onMyBackPressed()
}.show()
}
@ -1014,7 +1011,8 @@ class CollectionFragmentPreChecker(
if (type == CONTROLADOR || type == PRECHECKER) {
if (salesList.filter { it.sectorFk != null && it.sectorFk!! > 0 }.isNotEmpty()) {
sales = salesList.filter { it.sectorFk == mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
sales = salesList.filter {
it.sectorFk == mobileApplication.dataStoreApp.readDataStoreKey<Int>(SECTORFK)
}.sortedWith(compareBy({ it.picked }))
} else {
sales = salesList.sortedWith(compareBy({ it.picked }))
@ -1139,7 +1137,6 @@ class CollectionFragmentPreChecker(
binding.fragmentSacadorCollections.addOnScrollListener(object :
RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
d("VERDNA:TURA:", "onScrollListener ${lm!!.findFirstVisibleItemPosition()}")
storedBackPosition = lm.findFirstVisibleItemPosition()
super.onScrolled(recyclerView, dx, dy)
}
@ -1682,7 +1679,7 @@ class CollectionFragmentPreChecker(
requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
lManager.hideSoftInputFromWindow(
customDialogList.getEditTextTwo().windowToken,
InputMethodManager.SHOW_FORCED
InputMethodManager.SHOW_IMPLICIT
)
}
@ -1824,7 +1821,6 @@ class CollectionFragmentPreChecker(
}
private fun checkItemScan(valueToCheck: String): Boolean {
d("VERDNATURA::", "Entramos a ver el checkItem")
if (storedPosition >= 0 && sales.size > storedPosition) {
val saleToCheck = sales[storedPosition]
@ -1837,7 +1833,7 @@ class CollectionFragmentPreChecker(
}
}
}
d("VERDNATURA::", "SAlimos de ver el checkItem")
return false
}

View File

@ -179,7 +179,7 @@ class CollectionShowTicketFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
@ -248,7 +248,7 @@ class CollectionShowTicketFragment(
}
} else {
ma.messageWithSound(it.errorMessage, it.isError, false)
if (activity != null) ma.onBackPressed()
if (activity != null) ma.onMyBackPressed()
}

View File

@ -50,7 +50,7 @@ class ControladorFragment :
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()

View File

@ -138,7 +138,7 @@ class ControlVehiculoFragment(
.setKoButton(getString(R.string.cancel)) {
customDialogInput.dismiss()
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
ma.onBackPressed()
ma.onMyBackPressed()
}
}.setValue("").show()

View File

@ -120,7 +120,7 @@ class ControlVehiculoUsuarioFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -6,15 +6,12 @@ import androidx.core.content.ContextCompat.getColor
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemExpeditionLoadunloadRowBinding
import es.verdnatura.presentation.common.OnItemCardRowClickListener
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
class ExpeditionLoadUnloadAdapter(
private val items: List<ExpeditionInfoLoadUnload>,
) : RecyclerView.Adapter<ExpeditionLoadUnloadAdapter.ItemHolder>() {
) : RecyclerView.Adapter<ExpeditionLoadUnloadAdapter.ItemHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
@ -45,6 +42,7 @@ class ExpeditionLoadUnloadAdapter(
getColor(expeditionView.context, R.color.verdnatura_pumpkin_orange)
)
}
"DELIVERED" -> expeditionView.setBackgroundColor(
getColor(expeditionView.context, R.color.verdnatura_dark_mint)
)
@ -52,6 +50,7 @@ class ExpeditionLoadUnloadAdapter(
"PALLETIZED" -> expeditionView.setBackgroundColor(
getColor(expeditionView.context, R.color.verdnatura_black_5)
)
else -> {
expeditionView.setBackgroundColor(
getColor(expeditionView.context, R.color.verdnatura_black_5)

View File

@ -4,26 +4,18 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemExpeditionSummaryRowBinding
import es.verdnatura.databinding.ItemRouteRowBinding
import es.verdnatura.domain.toDateString
import es.verdnatura.presentation.common.OnAddressRowClickListener
import es.verdnatura.presentation.common.OnItemCardRowClickListener
import es.verdnatura.presentation.common.OnItemImageLoadRowClickListener
import es.verdnatura.presentation.common.OnItemImageRouteRowClickListener
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
import es.verdnatura.presentation.view.feature.delivery.model.RouteLoaded
class RouteAdapter(
private var items: MutableList<RouteInfo>,
private val OnItemImageRouteRowClickListener: OnItemImageRouteRowClickListener,
private val routeLoaded: List<RouteLoaded> = listOf()
) : RecyclerView.Adapter<RouteAdapter.ItemHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
items = setHeaders(items)
return ItemHolder(
@ -35,7 +27,7 @@ class RouteAdapter(
)
}
fun setHeaders(list: MutableList<RouteInfo>):MutableList<RouteInfo>{
fun setHeaders(list: MutableList<RouteInfo>): MutableList<RouteInfo> {
var prevCreated = ""
for (route in list) {
@ -46,6 +38,7 @@ class RouteAdapter(
}
return list
}
fun updateList(newList: MutableList<RouteInfo>) {
items = setHeaders(newList)
notifyDataSetChanged()
@ -70,32 +63,42 @@ class RouteAdapter(
fun bind(item: RouteInfo) {
binding.apply {
showTickets.setOnClickListener {
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(item,"showTickets")
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(
item,
"showTickets"
)
}
imageLoadVan.setOnClickListener {
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(item,"loadVan")
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(
item,
"loadVan"
)
}
linearLayoutShowTickets.setOnClickListener {
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(item,"showTickets")
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(
item,
"showTickets"
)
}
linearLayoutLoadVan.setOnClickListener {
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(item,"loadVan")
OnItemImageRouteRowClickListener.onItemImageRouteRowClickListener(
item,
"loadVan"
)
}
if (item.header){
if (item.header) {
headerRouteLayout.visibility = View.VISIBLE
headerRoute.text = toDateString(item.created)
}else{
} else {
headerRouteLayout.visibility = View.GONE
}
if (routeLoaded.filter { it.id == item.id }.isNotEmpty()){
if (routeLoaded.filter { it.id == item.id }.isNotEmpty()) {
imageLoadVan.visibility = View.INVISIBLE
}else{
} else {
imageLoadVan.visibility = View.VISIBLE
}
this.item = item

View File

@ -25,7 +25,7 @@ class InfoFragment(var title: String) :
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -212,13 +212,13 @@ class LoadUnloadFragment(
intent.putExtra("objectSigned", "ticket") //cmr
startActivity(intent)
ma.onBackPressed()
ma.onMyBackPressed()
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
@ -319,7 +319,7 @@ class LoadUnloadFragment(
if (state == "DELIVERED") {
openSignActivity()
} else {
ma.onBackPressed()
ma.onMyBackPressed()
}
} else {
binding.mainToolbar.switchButton.isChecked = false

View File

@ -84,7 +84,7 @@ class LogExpeditionFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->

View File

@ -187,7 +187,7 @@ class RoutesFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}

View File

@ -205,7 +205,7 @@ class SummaryFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}

View File

@ -212,7 +212,7 @@ class TicketsFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
if (!binding.itemcardLayout.isVisible) {
ma.onBackPressed()
ma.onMyBackPressed()
} else {
setSettingsRoute()

View File

@ -92,7 +92,7 @@ class DayOfSaleFragment(
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -118,7 +118,7 @@ class HistoricoArticuloFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.filterNameordateitem.setOnKeyListener { v, keyCode, event ->

View File

@ -61,7 +61,7 @@ class ItemShelvingLogFragment(
false
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -7,7 +7,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.google.gson.Gson
import es.verdnatura.R
import es.verdnatura.databinding.FragmentShelvinglogBinding
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.view.component.CustomDialog
@ -63,7 +62,7 @@ class ShelvingLogFragment(
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}
@ -92,7 +91,7 @@ class ShelvingLogFragment(
entryPoint = Gson().toJson(
mutableMapOf(
"entryPoint" to itemId,
"web" to "${ mobileApplication.dataStoreApp.getServerSalix()}/#!/shelving/$itemId/log"
"web" to "${mobileApplication.dataStoreApp.getServerSalix()}/#!/shelving/$itemId/log"
)
)
)

View File

@ -41,7 +41,7 @@ class HistoricoVehiculoFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -148,7 +148,7 @@ class InventaryFragment :
@SuppressLint("NotifyDataSetChanged")
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.filterItemFk.setOnKeyListener { v, keyCode, event ->
if (binding.filterItemFk.text.toString().isEmpty()) {

View File

@ -336,7 +336,7 @@ class InventaryParkingFragment(
binding.mainToolbar.backButton.setOnClickListener {
isBack = true
if (shelvingSaved.isNullOrBlank()) {
ma.onBackPressed()
ma.onMyBackPressed()
} else {
resetChecking()

View File

@ -1,12 +1,10 @@
package es.verdnatura.presentation.view.feature.login.model
import java.util.*
class errorMessage (
class errorMessage(
val message: String = ""
){
override fun toString(): String {
return "${this.message}"
) {
override fun toString(): String {
return "${this.message}"
}
}

View File

@ -1,12 +1,16 @@
package es.verdnatura.presentation.view.feature.main.activity
import PhotosFragment
import android.content.Context
import android.content.Intent
import android.media.MediaPlayer
import android.net.Uri
import android.os.Build
import android.util.AttributeSet
import android.view.Menu
import android.view.View
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
@ -121,6 +125,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
private lateinit var networkUtils: NetworkUtilsApp
private var myTimeUserInteraction = (System.currentTimeMillis() / 1000 / 3600)
private var comeFromDelivery: Boolean? = null
private lateinit var mainActivityViewmodel: MainActivityViewModel
val backDispatcher = onBackPressedDispatcher
override fun getLayoutId(): Int = R.layout.activity_main
override fun onPause() {
@ -143,6 +149,16 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
}
override fun onCreateView(name: String, context: Context, attrs: AttributeSet): View? {
backDispatcher.addCallback(object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
onMyBackPressed()
}
})
return super.onCreateView(name, context, attrs)
}
@RequiresApi(Build.VERSION_CODES.O)
override fun init() {
@ -152,13 +168,19 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
customDialog = CustomDialogMainActivity(this)
setFragments()
setBottomMenuFragment()
setViewModel()
setRegisterNetwork()
(application as MobileApplication).setMainListener(this)
//Tarea
//printBluetooth()
}
private fun setViewModel() {
mainActivityViewmodel = MainActivityViewModel(application as MobileApplication)
}
private fun printBluetooth() {
/*var str =
@ -428,6 +450,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
}
}
@RequiresApi(Build.VERSION_CODES.O)
override fun onPasillerosItemClickListener(
item: PasillerosItemVO, entryPoint: String, param: Any?
) {
@ -467,7 +490,14 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
)
}
getString(R.string.titleChecker) -> {
getString(R.string.titleChecker) -> {/* mainActivityViewmodel.workerActivityAdd(
WorkerActionSalix(
workerFk = mobileApplication!!.userId!!,
workerActivityTypeFk = "ON_CHECKING",
inTimed = (LocalDate.now()).toString()
)
)*/
addFragmentOnTop(ControladorFragment.newInstance())
}
@ -824,9 +854,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
}
override fun onBackPressed() {
fun onMyBackPressed() {
var index = supportFragmentManager.backStackEntryCount - 1
val index = supportFragmentManager.backStackEntryCount - 1
var backEntry = ""
if (index >= 0) {
backEntry = supportFragmentManager.getBackStackEntryAt(index).name.toString()
@ -854,6 +884,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
} else {
backStackFragments(backEntry)
}
}
private fun backStackFragments(backEntry: String) {
@ -869,10 +900,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
if (!backEntry.isNullOrBlank())
if (backEntry!!.contains("fragment.ExpeditionPalletDetailFragment.Companion")) {
if (backEntry.contains("fragment.ExpeditionPalletDetailFragment.Companion")) {
addFragmentOnTop(ExpeditionTruckListFragment.newInstance())
}
if (backEntry!!.contains(getString(R.string.titleLog)) || backEntry!!.contains(
if (backEntry.contains(getString(R.string.titleLog)) || backEntry.contains(
getString(
R.string.titleInfo
)
@ -1040,7 +1071,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
isToasted: Boolean? = true
) {
if (isError != null) {
if (!isError!!) {
if (!isError) {
if (isPlayed == true) (mpok?.start())
if (isToasted!!) message.toast(this, Toast.LENGTH_LONG)

View File

@ -125,7 +125,7 @@ class ObservFragment(
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.openPickerImages.setOnClickListener {
val config = ImagePickerConfig {

View File

@ -102,7 +102,7 @@ class PackagingCountFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -113,7 +113,7 @@ class PackagingSummaryFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -129,7 +129,7 @@ class SupplierFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.radiobuttonTypePackaging.setOnCheckedChangeListener { buttonView, isChecked ->

View File

@ -34,7 +34,7 @@ class PackingHollandFragment(var entrypoint: String) :
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->

View File

@ -1,6 +1,5 @@
package es.verdnatura.presentation.view.feature.paletizador.adapter
import android.util.Log
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
@ -8,31 +7,34 @@ import es.verdnatura.databinding.ItemExpeditiontruckRowBinding
import es.verdnatura.presentation.common.OnTruckClickListener
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
class ExpeditionListAdapter (
class ExpeditionListAdapter(
private val items: List<ItemExpeditionTruckVO>,
private val onTruckClickListener: OnTruckClickListener
): RecyclerView.Adapter<ExpeditionListAdapter.ItemHolder> () {
) : RecyclerView.Adapter<ExpeditionListAdapter.ItemHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
ItemExpeditiontruckRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
ItemExpeditiontruckRowBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
)
}
override fun getItemCount() =items.size
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
holder.binding.root.setOnClickListener {
onTruckClickListener.onTruckClickListener(items[position],"")
onTruckClickListener.onTruckClickListener(items[position], "")
}
}
inner class ItemHolder(
val binding: ItemExpeditiontruckRowBinding
) : RecyclerView.ViewHolder(binding.root){
) : RecyclerView.ViewHolder(binding.root) {
private val res = binding.root.context.resources
fun bind(item: ItemExpeditionTruckVO) {
binding.apply {

View File

@ -51,7 +51,7 @@ class CmrExpeditionPalletFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}

View File

@ -68,11 +68,11 @@ class ExpeditionPalletDetailFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.buttonOk.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}
@ -160,7 +160,7 @@ class ExpeditionPalletDetailFragment(
if (it.isError) {
ma.messageWithSound(it.errorMessage, true, false)
} else {
ma.onBackPressed()
ma.onMyBackPressed()
}
})

View File

@ -87,7 +87,7 @@ class ExpeditionPalletFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -89,7 +89,7 @@ class ExpeditionScanFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -44,7 +44,7 @@ class ExpeditionScanSorterFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -66,7 +66,7 @@ class ExpeditionStateFragment(
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -51,7 +51,7 @@ class ExpeditionTruckListFragment :
customDialogHor = CustomDialogHour(requireContext())
binding.mainToolbar.toolbarTitle.text = getString(R.string.psScan) + getCURDATE()
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
setToolBar()

View File

@ -42,7 +42,7 @@ class PalletScanFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
@ -94,7 +94,7 @@ class PalletScanFragment(
customDialogList.setOkButton(getString(R.string.end)) {
customDialogList.dismiss()
ma.onBackPressed()
ma.onMyBackPressed()
}.setValue("").show()

View File

@ -59,7 +59,7 @@ class ParkingFragment(var menuOrigin: String) :
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}

View File

@ -78,7 +78,7 @@ class PasilleroFragment(
}
binding.mainToolbarDesign.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}

View File

@ -11,6 +11,7 @@ import android.provider.MediaStore
import android.view.View.*
import android.view.inputmethod.EditorInfo
import android.widget.ImageView
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.core.net.toUri
import androidx.recyclerview.widget.LinearLayoutManager
@ -40,6 +41,23 @@ class PhotosFragment(
private val REQUEST_IMAGE_CAPTURE = 2
private val imageUri: Uri? = null
private var originalItem: String = ""
private val pickImageLauncher = registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result ->
if (result.resultCode == RESULT_OK) {
// Handle image selection or capture result
val imageUri = result.data?.data
if (imageUri != null) {
// Image selected from gallery
binding.itemcardImage.setImageURI(imageUri)
} else {
// Image captured from camera
val bitmap = result.data?.extras?.get("data") as Bitmap
val uri = saveBitmapAsTempFile(requireContext(), bitmap).toUri()
binding.itemcardImage.setImageURI(uri)
}
}
}
override fun getLayoutId(): Int = R.layout.fragment_photos
@ -102,7 +120,7 @@ class PhotosFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
@ -232,23 +250,7 @@ class PhotosFragment(
val captureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
val chooserIntent = Intent.createChooser(pickIntent, getString(R.string.selectImage))
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, arrayOf(captureIntent))
startActivityForResult(chooserIntent, PICK_IMAGE_REQUEST)
pickImageLauncher.launch(chooserIntent)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK) {
if (data != null && data.data != null) {
// Imagen seleccionada desde la galería
binding.itemcardImage.setImageURI(data.data)
} else {
// Imagen cámara
val uri = saveBitmapAsTempFile(
requireContext(),
data?.extras?.get("data") as Bitmap
).toUri()
binding.itemcardImage.setImageURI(uri)
}
}
}
}

View File

@ -12,6 +12,7 @@ import es.verdnatura.domain.ConstAndValues
import es.verdnatura.domain.ConstAndValues.SECTORFK
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketViewModel
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
@ -55,7 +56,7 @@ class PreControladorFragment :
private fun setEvents() {
binding.scanInput.visibility = VISIBLE
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()

View File

@ -7,7 +7,6 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemArticleRowBinding
import es.verdnatura.databinding.ItemArticleRowPresacadorBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.OnQuantityClickListener
@ -18,25 +17,28 @@ import es.verdnatura.presentation.view.feature.presacador.mapper.toSale
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
class PreSacadorAdapter (
class PreSacadorAdapter(
private val items: List<PreSacadorItemVO>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
private val onQuantityClick: OnQuantityClickListener,
private val onSaleClickListener: OnSaleClickListener
): RecyclerView.Adapter<PreSacadorAdapter.AjustesItemHolder> () {
) : RecyclerView.Adapter<PreSacadorAdapter.AjustesItemHolder>() {
var context: Context? = null
var position:Int = 0
var position: Int = 0
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
this.context = parent.context
return AjustesItemHolder(
ItemArticleRowPresacadorBinding.inflate(LayoutInflater.from(parent.context),parent,false)
ItemArticleRowPresacadorBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
)
}
override fun getItemCount() =items.size
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
this.position = position
@ -45,20 +47,21 @@ class PreSacadorAdapter (
inner class AjustesItemHolder(
val binding: ItemArticleRowPresacadorBinding
) : RecyclerView.ViewHolder(binding.root){
) : RecyclerView.ViewHolder(binding.root) {
fun bind(preSale: PreSacadorItemVO) {
binding.apply {
val sale : SaleVO = preSale.toSale()
val sale: SaleVO = preSale.toSale()
if (sale.pickedQuantity==null)
if (sale.pickedQuantity == null)
sale.pickedQuantity = 0
val childLayoutManager = LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
val childLayoutManager =
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
itemArticlePlacements.apply {
layoutManager = childLayoutManager
adapter = PlacementAdapter(sale.placements,onPasillerosItemClickListener)
adapter = PlacementAdapter(sale.placements, onPasillerosItemClickListener)
}
//CLICK EVENTS
@ -67,7 +70,11 @@ class PreSacadorAdapter (
}
itemArticleItemFk.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = binding.root.context.resources.getString(R.string.titleItemConsult)),sale.itemFk.toString())
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
title = binding.root.context.resources.getString(R.string.titleItemConsult)
), sale.itemFk.toString()
)
}
itemArticleQuantity.setOnClickListener {
@ -78,28 +85,47 @@ class PreSacadorAdapter (
onQuantityClick.onQuantityClick(sale)
}
if (sale.quantity == sale.pickedQuantity!!){
if (sale.quantity == sale.pickedQuantity!!) {
sale.isPreviousPrepared = "1"
}else{
} else {
sale.isPreviousPrepared = "0"
}
//SEMAFORO
if (sale.isPreviousPrepared == "1"){
itemArticleRowSemaforoPre.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_dark_sky_blue))
}else{
itemArticleRowSemaforoPre.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_warm_grey))
if (sale.isPreviousPrepared == "1") {
itemArticleRowSemaforoPre.setBackgroundColor(
ContextCompat.getColor(
context!!,
R.color.verdnatura_dark_sky_blue
)
)
} else {
itemArticleRowSemaforoPre.setBackgroundColor(
ContextCompat.getColor(
context!!,
R.color.verdnatura_warm_grey
)
)
}
if (sale.isPreviousPrepared == "1"){
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_dark_sky_blue))
}else{
contentLayout.setBackgroundColor(ContextCompat.getColor(context!!, R.color.verdnatura_black))
if (sale.isPreviousPrepared == "1") {
contentLayout.setBackgroundColor(
ContextCompat.getColor(
context!!,
R.color.verdnatura_dark_sky_blue
)
)
} else {
contentLayout.setBackgroundColor(
ContextCompat.getColor(
context!!,
R.color.verdnatura_black
)
)
}
//ASIGNAMOS VALOR A LA VSITA
this.sale = sale

View File

@ -118,7 +118,7 @@ class EndSacadorFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
//ESCANER =========f
@ -779,7 +779,7 @@ private fun printShelvingResult(placementSupplyListVO: PlacementSupplyListVO) {
requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
lManager.hideSoftInputFromWindow(
customDialogList.getEditTextTwo().windowToken,
InputMethodManager.SHOW_FORCED
InputMethodManager.SHOW_IMPLICIT
)
})

View File

@ -69,7 +69,7 @@ class InitPreSacadorFragment(
ma.hideBottomNavigation(View.VISIBLE)
binding.mainToolbar.toolbarTitle.text = entrypoint
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
val listIcons: ArrayList<ImageView> = ArrayList()

View File

@ -46,7 +46,7 @@ class QrFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()

View File

@ -1,53 +1,58 @@
package es.verdnatura.presentation.view.feature.reubication.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemPlacementReubicationRowBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.reubication.model.PlacementReubication
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.R
import es.verdnatura.databinding.ItemPlacementReubicationRowBinding
import es.verdnatura.databinding.ItemPlacementRowBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.reubication.model.PlacementReubication
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
class ReubicatorPlacementAdapter (
private val items: List<PlacementReubication>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
): RecyclerView.Adapter<ReubicatorPlacementAdapter.AjustesItemHolder> () {
var context: Context? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
this.context = parent.context
return AjustesItemHolder(
ItemPlacementReubicationRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
class ReubicatorPlacementAdapter(
private val items: List<PlacementReubication>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
) : RecyclerView.Adapter<ReubicatorPlacementAdapter.AjustesItemHolder>() {
var context: Context? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
this.context = parent.context
return AjustesItemHolder(
ItemPlacementReubicationRowBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
}
)
}
override fun getItemCount() =items.size
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
holder.bind(items[position])
}
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
holder.bind(items[position])
}
inner class AjustesItemHolder(
val binding: ItemPlacementReubicationRowBinding
) : RecyclerView.ViewHolder(binding.root){
fun bind(placement: PlacementReubication) {
binding.apply {
if (placement.plate.isNullOrEmpty())
placement.plate = ""//placement.parking
if (placement.visible.isNullOrEmpty())
placement.visible = "("+placement.visible+")"
this.item = placement
inner class AjustesItemHolder(
val binding: ItemPlacementReubicationRowBinding
) : RecyclerView.ViewHolder(binding.root) {
fun bind(placement: PlacementReubication) {
binding.apply {
if (placement.plate.isNullOrEmpty())
placement.plate = ""//placement.parking
if (placement.visible.isNullOrEmpty())
placement.visible = "(" + placement.visible + ")"
this.item = placement
itemRootLayout.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(title = binding.root.context.getString(
R.string.titleUbicator)),placement.plate)
}
itemRootLayout.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(
title = binding.root.context.getString(
R.string.titleUbicator
)
), placement.plate
)
}
}
}
}
}
}

View File

@ -85,7 +85,7 @@ class ReubicationCollectionFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.collectionSwipe.setOnRefreshListener {
@ -210,7 +210,7 @@ class ReubicationCollectionFragment(
R.string.info
)
)
ma.onBackPressed()
ma.onMyBackPressed()
} else {
if (it.list[0].isError) {
ma.messageWithSound(

View File

@ -49,7 +49,7 @@ class ReubicationFragment(var entrypoint: String) :
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()

View File

@ -85,7 +85,7 @@ class SacadorFragment(
ma.hideBottomNavigation(View.VISIBLE)
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
val listIcons: ArrayList<ImageView> = ArrayList()

View File

@ -12,7 +12,6 @@ import es.verdnatura.domain.ConstAndValues
import es.verdnatura.domain.ConstAndValues.SECTORFK
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnCollectionSelectedListener
import es.verdnatura.presentation.view.feature.precontrol.ShowTicketViewModel
import es.verdnatura.presentation.view.feature.sacador.adapter.TicketLastStateAdapter
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.TicketStateSalix
@ -66,7 +65,7 @@ class ShowTicketFragment(var menuOrigin: String) :
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.sacadorSwipe.setOnRefreshListener {
binding.sacadorSwipe.isRefreshing = true

View File

@ -1,4 +1,4 @@
package es.verdnatura.presentation.view.feature.precontrol
package es.verdnatura.presentation.view.feature.sacador.fragment.showticket
import android.content.Context
import android.os.Build

View File

@ -30,7 +30,7 @@ class TicketAdvanceFragment(var title: String) :
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()

View File

@ -5,21 +5,19 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.databinding.ItemEscanerRowBinding
import es.verdnatura.presentation.common.OnAutomaticItemClickListener
import es.verdnatura.presentation.view.feature.ubicador.model.ItemEscanerVO
class AutomaticAdapterTEST (
class AutomaticAdapterTEST(
private val items: List<Long>,
private val onAutomaticItemClickListener: OnAutomaticItemClickListener
): RecyclerView.Adapter<AutomaticAdapterTEST.ItemHolder> () {
) : RecyclerView.Adapter<AutomaticAdapterTEST.ItemHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder(
ItemEscanerRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
ItemEscanerRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
)
}
override fun getItemCount() =items.size
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
holder.bind(items[position])
@ -30,14 +28,14 @@ class AutomaticAdapterTEST (
inner class ItemHolder(
val binding: ItemEscanerRowBinding
) : RecyclerView.ViewHolder(binding.root){
) : RecyclerView.ViewHolder(binding.root) {
private val res = binding.root.context.resources
fun bind(item: Long) {
binding.itemfkText.text = item.toString()
/* binding.apply {
this.item = item
}*/
/* binding.apply {
this.item = item
}*/
}
}
}

View File

@ -128,7 +128,7 @@ class AutomaticAddItemFragment(
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}
@ -136,7 +136,7 @@ class AutomaticAddItemFragment(
with(viewModel) {
binding.splashAnimation.visibility = View.INVISIBLE
response.observe(viewLifecycleOwner, Observer {
ma.onBackPressed()
ma.onMyBackPressed()
})
}
}

View File

@ -126,14 +126,14 @@ class AutomaticAddItemFragmentOld(
}
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
}
override fun observeViewModel() {
with(viewModel) {
response.observe(viewLifecycleOwner, Observer {
ma.onBackPressed()
ma.onMyBackPressed()
})
}

View File

@ -221,7 +221,7 @@ class UbicadorFragment(
@SuppressLint("SetTextI18n")
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
setTooltips()

View File

@ -105,13 +105,6 @@ class UbicadorFragmentNew(
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
}
return super.onOptionsItemSelected(item)
}
private fun setDialogs() {
customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext())
@ -227,7 +220,7 @@ class UbicadorFragmentNew(
@SuppressLint("SetTextI18n")
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
setTooltips()

View File

@ -65,7 +65,7 @@ class PackingMistakeFragment(var menuOrigin: String) :
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
binding.scanInput.requestFocus()

View File

@ -75,7 +75,7 @@ class WorkermistakeFragment(
var departmentId = mobileApplication.dataStoreApp.readDataStoreKey<Int>("DEPARTMENTMISTAKEID")
if (departmentId != 0) {
viewModel.workerGetFromHasMistake(
departmentId!!
departmentId
)
}
}
@ -123,7 +123,7 @@ class WorkermistakeFragment(
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
ma.onBackPressed()
ma.onMyBackPressed()
}
if (binding.filterDepartment.text.isNullOrEmpty()) {
binding.filterItemFk.isEnabled = false

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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"
android:id="@+id/nav_graph">
<fragment
android:id="@+id/ajustesFragment"