From a9447b7af812f474ef26ee224c6fe2089711563f Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Thu, 29 Feb 2024 09:09:14 +0100 Subject: [PATCH] refs #6284 feat:update && deprecated --- .../main/java/es/verdnatura/domain/ApiSalixUtils.kt | 2 +- app/src/main/java/es/verdnatura/domain/Extensions.kt | 4 ++-- .../view/feature/ajustes/fragment/AjustesFragment.kt | 4 ++-- .../view/feature/collection/adapter/SaleAdapter.kt | 3 --- .../collection/fragment/CollectionFragmentPicker.kt | 11 +++++------ .../feature/inventario/fragment/SearchBuyerModel.kt | 2 +- .../feature/sacador/adapter/CollectionAdapterNew.kt | 5 ----- .../feature/sacador/fragment/SacadorFragmentNew.kt | 2 +- app/src/main/res/layout/fragment_item_card.xml | 2 +- app/src/main/res/layout/fragment_login.xml | 1 - app/src/main/res/layout/fragment_show_ticket.xml | 4 +++- 11 files changed, 16 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt b/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt index 18ae0fd2..676122b3 100644 --- a/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt +++ b/app/src/main/java/es/verdnatura/domain/ApiSalixUtils.kt @@ -63,7 +63,7 @@ class ApiSalixUtils { } var url = - (context as MobileApplication).dataStoreApp.readDataStoreKey(BASEURLSALIX) + (context).dataStoreApp.readDataStoreKey(BASEURLSALIX) if (url.isNullOrEmpty()) { runBlocking { diff --git a/app/src/main/java/es/verdnatura/domain/Extensions.kt b/app/src/main/java/es/verdnatura/domain/Extensions.kt index f5edac9b..5ed38937 100644 --- a/app/src/main/java/es/verdnatura/domain/Extensions.kt +++ b/app/src/main/java/es/verdnatura/domain/Extensions.kt @@ -53,7 +53,7 @@ fun toDateString(date: Date): String { @RequiresApi(Build.VERSION_CODES.O) fun String?.isoToString(returnOnlyDate: Boolean = false): String { - return if (!this.isNullOrEmpty() && this!!.contains("T")) { + return if (!this.isNullOrEmpty() && this.contains("T")) { val utcZonedDateTime = ZonedDateTime.parse(this, DateTimeFormatter.ISO_OFFSET_DATE_TIME) val myDate = utcZonedDateTime.withZoneSameInstant(ZonedDateTime.now().zone) .format(DateTimeFormatter.ISO_LOCAL_DATE_TIME) @@ -63,7 +63,7 @@ fun String?.isoToString(returnOnlyDate: Boolean = false): String { } else { (myDate.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"))).replace("T", " ") } - } else if (!this.isNullOrEmpty() && !this!!.contains("T")) { + } else if (!this.isNullOrEmpty() && !this.contains("T")) { this } else { "" diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt index 3a4ada1f..aaec40b6 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt @@ -351,10 +351,10 @@ class AjustesFragment : private fun showMenuByDefault() { pasilleroViewModel = PasilleroViewModel(mobileApplication) - pasilleroViewModel!!.inititializeDefaultDataInit() + pasilleroViewModel.inititializeDefaultDataInit() var arrayList: ArrayList = arrayListOf() - pasilleroViewModel!!.pasillerositem.forEach { + pasilleroViewModel.pasillerositem.forEach { arrayList.add(it.title) } arrayList.add(getString(R.string.all)) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt index 6627cb7f..10e188db 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt @@ -4,7 +4,6 @@ import android.content.Context import android.content.res.ColorStateList import android.graphics.Color import android.graphics.drawable.Drawable -import android.util.Log.d import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -384,8 +383,6 @@ class SaleAdapter( rvHeadlines.layoutManager = LinearLayoutManager(context)}*/ ivArrow.setOnClickListener { - d("VERDNATURA::", "click on line1 PADRE") - //Revisar lunes if (isExpanded!!) { ivArrow.setImageResource(R.drawable.ic_arrow_up) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt index 31117459..95b278c9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt @@ -25,7 +25,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 import es.verdnatura.domain.ConstAndValues.CONTROLADOR import es.verdnatura.domain.ConstAndValues.OK import es.verdnatura.domain.ConstAndValues.PRECHECKER @@ -363,7 +362,7 @@ class CollectionFragmentPicker( private fun setEvents() { binding.mainToolbar.backButton.setOnClickListener { - ma.onBackPressed() + ma.onMyBackPressed() } //ESCANER ========= hideKeyboards() @@ -472,7 +471,7 @@ class CollectionFragmentPicker( 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() } @@ -1494,7 +1493,7 @@ class CollectionFragmentPicker( 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 ) @@ -1511,7 +1510,7 @@ class CollectionFragmentPicker( 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 @@ -1700,7 +1699,7 @@ class CollectionFragmentPicker( requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager lManager.hideSoftInputFromWindow( customDialogList.getEditTextTwo().windowToken, - InputMethodManager.SHOW_FORCED + InputMethodManager.SHOW_IMPLICIT ) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt index cc96f2ba..6ef99f49 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/SearchBuyerModel.kt @@ -11,7 +11,7 @@ class SearchBuyerModel(private var nickname: String?, private var buyerId: Int?) } fun getBuyerId(): String { - return buyerId.toString()!! + return buyerId.toString() } fun getBuyerNickname(): String { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/adapter/CollectionAdapterNew.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/adapter/CollectionAdapterNew.kt index 8c41a5e0..0af80003 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/adapter/CollectionAdapterNew.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/adapter/CollectionAdapterNew.kt @@ -4,12 +4,9 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import es.verdnatura.databinding.ItemCollectionRowBinding import es.verdnatura.databinding.ItemCollectionRowNewBinding -import es.verdnatura.presentation.common.OnCollectionSelectedListener import es.verdnatura.presentation.common.OnCollectionTicketSelectedListener import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket -import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO class CollectionAdapterNew( private val items: List, @@ -17,7 +14,6 @@ class CollectionAdapterNew( private val type: String ) : RecyclerView.Adapter() { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder { return AjustesItemHolder( ItemCollectionRowNewBinding.inflate(LayoutInflater.from(parent.context), parent, false) @@ -33,7 +29,6 @@ class CollectionAdapterNew( } } - class AjustesItemHolder( val binding: ItemCollectionRowNewBinding ) : RecyclerView.ViewHolder(binding.root) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragmentNew.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragmentNew.kt index b2943b5a..2b80999d 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragmentNew.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorFragmentNew.kt @@ -86,7 +86,7 @@ class SacadorFragmentNew( ma.hideBottomNavigation(View.VISIBLE) binding.mainToolbar.backButton.setOnClickListener { - ma.onBackPressed() + ma.onMyBackPressed() } val listIcons: ArrayList = ArrayList() diff --git a/app/src/main/res/layout/fragment_item_card.xml b/app/src/main/res/layout/fragment_item_card.xml index 62a3f11f..84a1f320 100644 --- a/app/src/main/res/layout/fragment_item_card.xml +++ b/app/src/main/res/layout/fragment_item_card.xml @@ -203,7 +203,7 @@ - ' + android:textSize="@dimen/h7"> + +