feat: refs #8182 zoneClickable

This commit is contained in:
Sergio De la torre 2024-11-20 07:58:36 +01:00
parent 61e6aa2a5a
commit 2c32244617
8 changed files with 61 additions and 35 deletions

View File

@ -421,6 +421,12 @@ class SaleAdapter(
if (type == SACADOR || type == CONTROLADOR) { if (type == SACADOR || type == CONTROLADOR) {
itemTicketColor.tooltipText = context!!.getString(R.string.filterLevelColor) itemTicketColor.tooltipText = context!!.getString(R.string.filterLevelColor)
} }
/* ticketFk.paintFlags = ticketFk.paintFlags or Paint.UNDERLINE_TEXT_FLAG
itemArticleItemFk.paintFlags =
itemArticleItemFk.paintFlags or Paint.UNDERLINE_TEXT_FLAG*/
this.sale = sale this.sale = sale
} }

View File

@ -31,6 +31,7 @@ import es.verdnatura.presentation.common.GeneralAdapter
import es.verdnatura.presentation.common.GeneralItem import es.verdnatura.presentation.common.GeneralItem
import es.verdnatura.presentation.common.ItemDescorationCustomized import es.verdnatura.presentation.common.ItemDescorationCustomized
import es.verdnatura.presentation.common.OnGeneralItemRowClickListener import es.verdnatura.presentation.common.OnGeneralItemRowClickListener
import es.verdnatura.presentation.common.OnGeneralRowClickListener
import es.verdnatura.presentation.common.OnItemButtonCMRRowClickListener import es.verdnatura.presentation.common.OnItemButtonCMRRowClickListener
import es.verdnatura.presentation.common.OnItemButtonTicketRowClickListener import es.verdnatura.presentation.common.OnItemButtonTicketRowClickListener
import es.verdnatura.presentation.common.OnOptionsSelectedListener import es.verdnatura.presentation.common.OnOptionsSelectedListener
@ -607,32 +608,33 @@ class TicketsFragment : BaseFragment<FragmentTicketsBinding, DeliveryViewModel>(
customDialogList.dismiss() customDialogList.dismiss()
}.hideDialog().show() }.hideDialog().show()
val listPhonesAdapter = GeneralAdapter(phones, object : OnGeneralItemRowClickListener { val listPhonesAdapter =
override fun onGeneralItemRowClickListener(item: GeneralItem) { GeneralAdapter(phones, onRowClickListener = object : OnGeneralRowClickListener {
phones.forEach { override fun onRowClickListener(item: GeneralItem) {
if (it.code == item.code) { phones.forEach {
if (ContextCompat.checkSelfPermission( if (it.code == item.code) {
requireContext(), Manifest.permission.CALL_PHONE if (ContextCompat.checkSelfPermission(
) == PackageManager.PERMISSION_GRANTED requireContext(), Manifest.permission.CALL_PHONE
) { ) == PackageManager.PERMISSION_GRANTED
val callIntent = Intent(Intent.ACTION_CALL) ) {
callIntent.data = Uri.parse("tel:${it.code}") val callIntent = Intent(Intent.ACTION_CALL)
startActivity(callIntent) callIntent.data = Uri.parse("tel:${it.code}")
return@forEach startActivity(callIntent)
return@forEach
}
} else {
ActivityCompat.requestPermissions(
context as Activity,
arrayOf(Manifest.permission.CALL_PHONE),
REQUEST_CALL_PERMISSION
)
} }
} else { customDialogList.dismiss()
ActivityCompat.requestPermissions(
context as Activity,
arrayOf(Manifest.permission.CALL_PHONE),
REQUEST_CALL_PERMISSION
)
} }
customDialogList.dismiss()
} }
}
}) })
customDialogList.getRecyclerView().adapter = listPhonesAdapter customDialogList.getRecyclerView().adapter = listPhonesAdapter
customDialogList.getRecyclerView().layoutManager = customDialogList.getRecyclerView().layoutManager =

View File

@ -156,7 +156,7 @@ class SaleVO(
var cel1: String = "", var cel1: String = "",
var cel2: String = "", var cel2: String = "",
var cel3: String = "", var cel3: String = "",
var saleGroupFk: String = "", var saleGroupFk: String? = "",
var picked: String? = "", var picked: String? = "",
var isParent: Boolean = false, var isParent: Boolean = false,
var totalSales: Int = 0, var totalSales: Int = 0,

View File

@ -217,18 +217,20 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
binding.mainToolbar.toolbarIcons.adapter = binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener { ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
listItems.clear()
when (item) { when (item) {
iconAdd.drawable -> showAddItemNew( iconAdd.drawable -> showAddItemNew(
isEditItem = false, null isEditItem = false, null
) )
iconAddMultiple.drawable -> iconAddMultiple.drawable -> {
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(
title = R.string.addItemMultipleShelving, title = R.string.addItemMultipleShelving,
), entryPoint = getString(R.string.addItemMultipleShelving) ), entryPoint = getString(R.string.addItemMultipleShelving)
) )
}
iconReload.drawable -> { iconReload.drawable -> {
@ -342,6 +344,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
binding.automaticImg.setOnClickListener { binding.automaticImg.setOnClickListener {
if (shelvingFk.isNotBlank()) ma.onPasillerosItemClickListener( if (shelvingFk.isNotBlank()) ma.onPasillerosItemClickListener(
PasillerosItemVO(title = R.string.titleAuto), entryPoint = shelvingFk PasillerosItemVO(title = R.string.titleAuto), entryPoint = shelvingFk
) )
@ -522,18 +525,13 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
with(viewModel) { with(viewModel) {
loadShelvingListNew.observe(viewLifecycleOwner) { event -> loadShelvingListNew.observe(viewLifecycleOwner) { event ->
listItems.clear()
event.getContentIfNotHandled().notNull { it -> event.getContentIfNotHandled().notNull { it ->
if (isShelvinLogfromMainScreen) { if (isShelvinLogfromMainScreen) {
viewModel.shelvingLogAdd(shelvingFk) viewModel.shelvingLogAdd(shelvingFk)
} }
listItems.addAll(it.list) listItems.addAll(it.list)
listItems.forEach { item -> listItems.forEach { item ->
println("description **************************${item.description}")
println("description ${item.description}")
println("description longName${item.longName}")
println("description name ${item.name}")
println("description size ${item.size ?: ""}")
if (item.description.isNullOrEmpty()) { if (item.description.isNullOrEmpty()) {
item.description = item.description =
item.longName ?: "${item.name ?: ""} ${item.size ?: ""}" item.longName ?: "${item.name ?: ""} ${item.size ?: ""}"
@ -548,7 +546,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString( shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
R.string.label R.string.label
) + totalStickers ) + totalStickers
if (listItems.isNotEmpty()) binding.editPrioridad.setText(it.list[0].priority.toString()) if (listItems.isNotEmpty()) binding.editPrioridad.setText(listItems[0].priority?.toString())
if (!binding.mainToolbar.switchButton.isChecked && listItems.isNotEmpty()) { if (!binding.mainToolbar.switchButton.isChecked && listItems.isNotEmpty()) {
listItems = listItems.asReversed() listItems = listItems.asReversed()
@ -865,6 +863,7 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
customDialogUbicador.getPackingValue().toIntOrNull() customDialogUbicador.getPackingValue().toIntOrNull()
) else { ) else {
viewModel.itemShelvingAdd( viewModel.itemShelvingAdd(
shelving = shelvingFk, shelving = shelvingFk,
item = customDialogUbicador.getItemValue().toLong(), item = customDialogUbicador.getItemValue().toLong(),
@ -1054,7 +1053,6 @@ class UbicadorFragmentNew : BaseFragment<FragmentUbicadorBinding, UbicadorViewMo
if (!isAutoSelf) { if (!isAutoSelf) {
listItems.remove(item) listItems.remove(item)
adapter!!.notifyItemRemoved(listItems.indexOf(item)) adapter!!.notifyItemRemoved(listItems.indexOf(item))
//adapter!!.notifyDataSetChanged()
viewModel.itemShelvingDelete( viewModel.itemShelvingDelete(
item.id item.id
) )

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M320,550L399,440L569,440L320,244L320,550ZM551,880L406,568L240,800L240,80L800,520L516,520L660,829L551,880ZM399,440L399,440L399,440L399,440Z" />
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/black"
android:pathData="M320,550L399,440L569,440L320,244L320,550ZM551,880L406,568L240,800L240,80L800,520L516,520L660,829L551,880ZM399,440L399,440L399,440L399,440Z" />
</vector>

View File

@ -82,6 +82,7 @@
android:textColor="@color/verdnatura_black" android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8" android:textSize="@dimen/h8"
android:textStyle="bold" /> android:textStyle="bold" />
<!-- app:drawableEndCompat="@drawable/ic_click_black"-->
<TextView <TextView
android:id="@+id/parkingCode" android:id="@+id/parkingCode"
@ -92,8 +93,6 @@
android:textColor="@color/verdnatura_black" android:textColor="@color/verdnatura_black"
android:textSize="@dimen/caption" android:textSize="@dimen/caption"
android:textStyle="bold" /> android:textStyle="bold" />
<!-- app:drawableEndCompat="@drawable/ic_click_black"-->
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -191,7 +190,7 @@
<TextView <TextView
android:id="@+id/item_article_itemFk" android:id="@+id/item_article_itemFk"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_margin_min_to_modify" android:layout_marginStart="@dimen/layout_margin_min_to_modify"
android:maxLines="1" android:maxLines="1"
android:text="@{Long.toString(sale.itemFk)}" android:text="@{Long.toString(sale.itemFk)}"

View File

@ -35,6 +35,7 @@
tool:text="053-05" /> tool:text="053-05" />
<TextView <TextView
android:id="@+id/placementcode"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{item.shelving}" android:text="@{item.shelving}"