v5.3.9
This commit is contained in:
parent
84b1d58fff
commit
bb521e3f7d
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="1.8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -14,6 +14,7 @@
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
<option name="useQualifiedModuleNames" value="true" />
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -14,8 +14,8 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 45
|
versionCode 49
|
||||||
versionName "5.3.5"
|
versionName "5.3.9"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ package es.verdnatura.di
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
|
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
|
||||||
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
|
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityViewModel
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
|
||||||
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
|
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
|
||||||
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasViewModel
|
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasViewModel
|
||||||
|
@ -120,4 +122,12 @@ val viewModelModule = module{
|
||||||
viewModel {
|
viewModel {
|
||||||
ReposicionViewModel()
|
ReposicionViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel {
|
||||||
|
BuyersViewModel()
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel {
|
||||||
|
QaualityViewModel()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class ApiUtils {
|
class ApiUtils {
|
||||||
companion object {
|
companion object {
|
||||||
// const val BASE_URL:String = "http://192.168.1.54:8009/"
|
//const val BASE_URL:String = "http://192.168.1.54:8009/"
|
||||||
const val BASE_URL:String = "https://app.verdnatura.es/"
|
const val BASE_URL:String = "https://app.verdnatura.es/"
|
||||||
fun getApiService():VerdnaturaService{
|
fun getApiService():VerdnaturaService{
|
||||||
val retrofit = Retrofit.Builder()
|
val retrofit = Retrofit.Builder()
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetQualityUserCase() : RestClient() {
|
||||||
|
|
||||||
|
fun itemShelvingBuyerGet(usuario:String,password:String) : Call<List<BuyerVO>> {
|
||||||
|
return restClient!!.itemShelvingBuyerGet("json","1",usuario,password,"application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingBuyerTask(usuario:String,password:String, userFk: String) : Call<List<ItemBuyerVO>> {
|
||||||
|
val params:ArrayList<String> = ArrayList();
|
||||||
|
params.add(userFk)
|
||||||
|
return restClient!!.itemShelvingBuyerTask("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingStarsUpdate(usuario:String,password:String, vId: String,vStars: String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList();
|
||||||
|
params.add(vId)
|
||||||
|
params.add(vStars)
|
||||||
|
return restClient!!.itemShelvingStarsUpdate("json","1",usuario,password,"application/json",params)
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,8 @@ package es.verdnatura.domain
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||||
import es.verdnatura.presentation.view.feature.historico.model.ItemHistoricoVO
|
import es.verdnatura.presentation.view.feature.historico.model.ItemHistoricoVO
|
||||||
|
@ -14,7 +16,6 @@ import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementVO
|
|
||||||
import es.verdnatura.presentation.view.feature.shelvingparking.model.ItemShelvingParkingVO
|
import es.verdnatura.presentation.view.feature.shelvingparking.model.ItemShelvingParkingVO
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
|
@ -567,4 +568,31 @@ interface VerdnaturaService {
|
||||||
@Body params: List<String>):
|
@Body params: List<String>):
|
||||||
Call<String>
|
Call<String>
|
||||||
|
|
||||||
|
|
||||||
|
//CALIDAD
|
||||||
|
@POST("almacennew/itemShelvingBuyerGet")
|
||||||
|
fun itemShelvingBuyerGet(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String):
|
||||||
|
Call<List<BuyerVO>>
|
||||||
|
|
||||||
|
@POST("almacennew/itemShelvingBuyerTask")
|
||||||
|
fun itemShelvingBuyerTask(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>):
|
||||||
|
Call<List<ItemBuyerVO>>
|
||||||
|
|
||||||
|
@POST("almacennew/itemShelvingStarsUpdate")
|
||||||
|
fun itemShelvingStarsUpdate(@Header("aplicacion") aplicacion: String,
|
||||||
|
@Header("version") version: String,
|
||||||
|
@Header("user") user: String,
|
||||||
|
@Header("pass") pass: String,
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: List<String>):
|
||||||
|
Call<String>
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package es.verdnatura.presentation.base
|
package es.verdnatura.presentation.base
|
||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.Manifest.permission
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
|
@ -18,7 +17,6 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
import androidx.core.content.PermissionChecker.checkCallingOrSelfPermission
|
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
import androidx.databinding.ViewDataBinding
|
import androidx.databinding.ViewDataBinding
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
@ -47,6 +45,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
protected val VOZ = "voz"
|
protected val VOZ = "voz"
|
||||||
protected val viewModel: V by viewModel(viewModelClass)
|
protected val viewModel: V by viewModel(viewModelClass)
|
||||||
protected lateinit var binding: T
|
protected lateinit var binding: T
|
||||||
|
private var isOnReadyForSpeech = false
|
||||||
|
|
||||||
|
|
||||||
private var textToSpeech: TextToSpeech? = null
|
private var textToSpeech: TextToSpeech? = null
|
||||||
|
@ -117,6 +116,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
)
|
)
|
||||||
mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, true)
|
mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, true)
|
||||||
mSpeechRecognizer?.setRecognitionListener(this)
|
mSpeechRecognizer?.setRecognitionListener(this)
|
||||||
|
isOnReadyForSpeech = false;
|
||||||
startListening()
|
startListening()
|
||||||
}catch (e:Exception){
|
}catch (e:Exception){
|
||||||
cancelSpeech()
|
cancelSpeech()
|
||||||
|
@ -191,7 +191,9 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
|
|
||||||
|
|
||||||
override fun onReadyForSpeech(params: Bundle?) {
|
override fun onReadyForSpeech(params: Bundle?) {
|
||||||
|
isOnReadyForSpeech = true;
|
||||||
Log.i("Speech", "onReadyForSpeech")
|
Log.i("Speech", "onReadyForSpeech")
|
||||||
|
"onReadyForSpeech".toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBeginningOfSpeech() {
|
override fun onBeginningOfSpeech() {
|
||||||
|
@ -209,10 +211,16 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(error: Int) {
|
override fun onError(error: Int) {
|
||||||
Log.i("Speech", "onError "+error)
|
if (!isOnReadyForSpeech && error == SpeechRecognizer.ERROR_NO_MATCH) {
|
||||||
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
|
startListening()
|
||||||
mSpeechRecognizer = null
|
}else{
|
||||||
initialize()
|
Log.i("Speech", "onError "+error)
|
||||||
|
("onError "+error).toast(requireContext())
|
||||||
|
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
|
||||||
|
mSpeechRecognizer = null
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResults(results: Bundle) {}
|
override fun onResults(results: Bundle) {}
|
||||||
|
@ -285,7 +293,10 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val numChar = a.length
|
val numChar = a.length
|
||||||
return count * 100 / numChar
|
if (numChar != 0)
|
||||||
|
return count * 100 / numChar
|
||||||
|
else
|
||||||
|
return 100
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun requestRecordAudioPermission() {
|
private fun requestRecordAudioPermission() {
|
||||||
|
|
|
@ -94,4 +94,12 @@ interface OnSaleClickListener {
|
||||||
|
|
||||||
interface OnMistakeClickListener {
|
interface OnMistakeClickListener {
|
||||||
fun onMistakeClickListener(sale:SaleVO)
|
fun onMistakeClickListener(sale:SaleVO)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnBuyerSelectedListener {
|
||||||
|
fun onBuyerSelected(userFk:String)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnStarSelectedListener {
|
||||||
|
fun onStarSelected(vId:String, vStars:String)
|
||||||
}
|
}
|
|
@ -0,0 +1,124 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.calidad.adapter
|
||||||
|
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.databinding.ItemBuyerRowBinding
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnStarSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.convertToDateString
|
||||||
|
import es.verdnatura.presentation.common.loadUrl
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class ItemBuyersAdapter (
|
||||||
|
private val items: List<ItemBuyerVO>,
|
||||||
|
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
|
||||||
|
private val onStarSelectedListener: OnStarSelectedListener
|
||||||
|
): RecyclerView.Adapter<ItemBuyersAdapter.BuyersItemHolder> () {
|
||||||
|
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BuyersItemHolder {
|
||||||
|
return BuyersItemHolder(
|
||||||
|
ItemBuyerRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() =items.size
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: BuyersItemHolder, position: Int) {
|
||||||
|
holder.bind(items[position])
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inner class BuyersItemHolder(
|
||||||
|
val binding: ItemBuyerRowBinding
|
||||||
|
) : RecyclerView.ViewHolder(binding.root){
|
||||||
|
fun bind(item: ItemBuyerVO) {
|
||||||
|
binding.apply {
|
||||||
|
this.itemBuyer = item
|
||||||
|
if (item != null && item.image != "")
|
||||||
|
imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/"+item.image);
|
||||||
|
else
|
||||||
|
imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/"+item.itemFk);
|
||||||
|
|
||||||
|
imgItem.setOnClickListener {
|
||||||
|
onPasillerosItemClickListener.onPasillerosItemClickListener(PasillerosItemVO(title = "Consultar artículo"),item.itemFk)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.showStars) layoutStars.visibility = View.VISIBLE
|
||||||
|
else layoutStars.visibility = View.GONE
|
||||||
|
|
||||||
|
|
||||||
|
s1.setOnClickListener {
|
||||||
|
onStarSelectedListener.onStarSelected(item.id,"1")
|
||||||
|
}
|
||||||
|
|
||||||
|
s2.setOnClickListener {
|
||||||
|
onStarSelectedListener.onStarSelected(item.id,"2")
|
||||||
|
}
|
||||||
|
|
||||||
|
s3.setOnClickListener {
|
||||||
|
onStarSelectedListener.onStarSelected(item.id,"3")
|
||||||
|
}
|
||||||
|
|
||||||
|
s4.setOnClickListener {
|
||||||
|
onStarSelectedListener.onStarSelected(item.id,"4")
|
||||||
|
}
|
||||||
|
|
||||||
|
s5.setOnClickListener {
|
||||||
|
onStarSelectedListener.onStarSelected(item.id,"5")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.stars != null && item.stars != ""){
|
||||||
|
try {
|
||||||
|
val punt = item.stars.toInt()
|
||||||
|
if (punt == 1){
|
||||||
|
s1.setImageResource(item.iconResourceOk)
|
||||||
|
s2.setImageResource(item.iconResourceKo)
|
||||||
|
s3.setImageResource(item.iconResourceKo)
|
||||||
|
s4.setImageResource(item.iconResourceKo)
|
||||||
|
s5.setImageResource(item.iconResourceKo)
|
||||||
|
}else if (punt == 2){
|
||||||
|
s1.setImageResource(item.iconResourceOk)
|
||||||
|
s2.setImageResource(item.iconResourceOk)
|
||||||
|
s3.setImageResource(item.iconResourceKo)
|
||||||
|
s4.setImageResource(item.iconResourceKo)
|
||||||
|
s5.setImageResource(item.iconResourceKo)
|
||||||
|
}else if (punt == 3){
|
||||||
|
s1.setImageResource(item.iconResourceOk)
|
||||||
|
s2.setImageResource(item.iconResourceOk)
|
||||||
|
s3.setImageResource(item.iconResourceOk)
|
||||||
|
s4.setImageResource(item.iconResourceKo)
|
||||||
|
s5.setImageResource(item.iconResourceKo)
|
||||||
|
}else if (punt == 4){
|
||||||
|
s1.setImageResource(item.iconResourceOk)
|
||||||
|
s2.setImageResource(item.iconResourceOk)
|
||||||
|
s3.setImageResource(item.iconResourceOk)
|
||||||
|
s4.setImageResource(item.iconResourceOk)
|
||||||
|
s5.setImageResource(item.iconResourceKo)
|
||||||
|
}else if (punt == 5){
|
||||||
|
s1.setImageResource(item.iconResourceOk)
|
||||||
|
s2.setImageResource(item.iconResourceOk)
|
||||||
|
s3.setImageResource(item.iconResourceOk)
|
||||||
|
s4.setImageResource(item.iconResourceOk)
|
||||||
|
s5.setImageResource(item.iconResourceOk)
|
||||||
|
}else{
|
||||||
|
s1.setImageResource(item.iconResourceOk)
|
||||||
|
s2.setImageResource(item.iconResourceOk)
|
||||||
|
s3.setImageResource(item.iconResourceOk)
|
||||||
|
s4.setImageResource(item.iconResourceOk)
|
||||||
|
s5.setImageResource(item.iconResourceOk)
|
||||||
|
}
|
||||||
|
}catch (e:Exception){}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,127 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import androidx.lifecycle.Observer
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.databinding.BuyersFragmentBinding
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
import es.verdnatura.presentation.common.OnAjustesItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.OnBuyerSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
|
import es.verdnatura.presentation.view.feature.ajustes.adapter.AjustesAdapter
|
||||||
|
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||||
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
|
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||||
|
import kotlinx.android.synthetic.main.buyers_fragment.splash_progress
|
||||||
|
import kotlinx.android.synthetic.main.fragment_ajustes.*
|
||||||
|
import kotlinx.android.synthetic.main.toolbar.*
|
||||||
|
|
||||||
|
class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(BuyersViewModel::class) {
|
||||||
|
|
||||||
|
|
||||||
|
private var user = ""
|
||||||
|
private var password = ""
|
||||||
|
private var sectorFk = ""
|
||||||
|
private var warehouseFk = ""
|
||||||
|
private lateinit var customDialog: CustomDialog
|
||||||
|
private var onBuyerSelectedListener : OnBuyerSelectedListener? = null
|
||||||
|
private var buyersAdapter: AjustesAdapter? = null
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance() = BuyersFragment()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getLayoutId(): Int = R.layout.buyers_fragment
|
||||||
|
|
||||||
|
override fun onAttach(context: Context) {
|
||||||
|
if (context is OnBuyerSelectedListener) onBuyerSelectedListener = context
|
||||||
|
super.onAttach(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
val prefs: SharedPreferences = activity!!.getSharedPreferences(PREFS_USER,0)
|
||||||
|
user = prefs.getString(USER,"").toString()
|
||||||
|
password = prefs.getString(PASSWORD,"").toString()
|
||||||
|
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||||
|
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||||
|
viewModel.itemShelvingBuyerGet(user = user,password = password)
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
customDialog = CustomDialog(requireContext())
|
||||||
|
activity!!.main_bottom_navigation.visibility = View.GONE
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
toolbar_title.text = "itemShelving_BuyerGet"
|
||||||
|
setToolBar()
|
||||||
|
setEvents()
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setToolBar(){
|
||||||
|
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||||
|
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||||
|
listIcons.add(iconReload)
|
||||||
|
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||||
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
if (item == iconReload){
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.itemShelvingBuyerGet(user = user,password = password)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setEvents(){
|
||||||
|
backButton.setOnClickListener {
|
||||||
|
activity!!.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun observeViewModel() {
|
||||||
|
with(viewModel) {
|
||||||
|
buyersList.observe(viewLifecycleOwner, Observer {
|
||||||
|
splash_progress.visibility = View.GONE
|
||||||
|
createBuyerList(it.list)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createBuyerList(list:List<BuyerVO>){
|
||||||
|
var buyers = ArrayList<AjustesItemVO>()
|
||||||
|
list.forEach { buyer ->
|
||||||
|
if (!buyer.isError){
|
||||||
|
try {
|
||||||
|
buyers.add(
|
||||||
|
AjustesItemVO(
|
||||||
|
id = buyer.userFk.toInt(),
|
||||||
|
title = buyer.nickname,
|
||||||
|
sectorFk = 0,
|
||||||
|
warehouse = 0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}catch (e:Exception){}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buyersAdapter = AjustesAdapter(buyers,object: OnAjustesItemClickListener {
|
||||||
|
override fun onAjustesItemClickListener(item: AjustesItemVO) {
|
||||||
|
onBuyerSelectedListener?.onBuyerSelected(item.id.toString())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
buyers_items.adapter = buyersAdapter
|
||||||
|
buyers_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import es.verdnatura.domain.GetQualityUserCase
|
||||||
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||||
|
import retrofit2.Call
|
||||||
|
import retrofit2.Callback
|
||||||
|
import retrofit2.Response
|
||||||
|
|
||||||
|
class BuyersViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
private val getQualityUserCase: GetQualityUserCase = GetQualityUserCase()
|
||||||
|
|
||||||
|
private val _buyersList by lazy { MutableLiveData<BuyerListVO>() }
|
||||||
|
val buyersList: LiveData<BuyerListVO>
|
||||||
|
get() = _buyersList
|
||||||
|
|
||||||
|
fun itemShelvingBuyerGet(user:String,password:String){
|
||||||
|
getQualityUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
|
||||||
|
Callback<List<BuyerVO>> {
|
||||||
|
override fun onFailure(call: Call<List<BuyerVO>>, t: Throwable) {
|
||||||
|
val listError:ArrayList<BuyerVO> = ArrayList()
|
||||||
|
listError.add(BuyerVO(isError = true,errorMessage = t.message!!))
|
||||||
|
_buyersList.value = BuyerListVO(listError)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(
|
||||||
|
call: Call<List<BuyerVO>>,
|
||||||
|
response: Response<List<BuyerVO>>
|
||||||
|
) {
|
||||||
|
if (response.body() != null){
|
||||||
|
_buyersList.value = response.body()?.let { BuyerListVO(it) }
|
||||||
|
}else{
|
||||||
|
val listError:ArrayList<BuyerVO> = ArrayList()
|
||||||
|
listError.add(BuyerVO(isError = true,errorMessage = "Error en la llamada de itemShelving_buyerGet"))
|
||||||
|
_buyersList.value = BuyerListVO(listError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,211 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.os.Bundle
|
||||||
|
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.QaualityFragmentBinding
|
||||||
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
import es.verdnatura.presentation.common.*
|
||||||
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.adapter.ItemBuyersAdapter
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||||
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
|
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||||
|
import kotlinx.android.synthetic.main.qauality_fragment.*
|
||||||
|
import kotlinx.android.synthetic.main.qauality_fragment.scan_input
|
||||||
|
import kotlinx.android.synthetic.main.qauality_fragment.splash_progress
|
||||||
|
import kotlinx.android.synthetic.main.toolbar.*
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
|
class QaualityFragment(
|
||||||
|
var userFk : String = "0"
|
||||||
|
) : BaseFragment<QaualityFragmentBinding,QaualityViewModel>(QaualityViewModel::class) {
|
||||||
|
|
||||||
|
private var user = ""
|
||||||
|
private var password = ""
|
||||||
|
private var sectorFk = ""
|
||||||
|
private var warehouseFk = ""
|
||||||
|
private lateinit var customDialog: CustomDialog
|
||||||
|
private var buyersAdapter: ItemBuyersAdapter? = null
|
||||||
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
|
private var onStarSelectedListener : OnStarSelectedListener? = null
|
||||||
|
private var listItems:List<ItemBuyerVO> = listOf()
|
||||||
|
private var lm : LinearLayoutManager? = null
|
||||||
|
private var storedPosition: Int = 0
|
||||||
|
private var goBack:Boolean = false
|
||||||
|
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance(userFk:String) = QaualityFragment(userFk)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAttach(context: Context) {
|
||||||
|
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||||
|
super.onAttach(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getLayoutId(): Int = R.layout.qauality_fragment
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
val prefs: SharedPreferences = activity!!.getSharedPreferences(PREFS_USER,0)
|
||||||
|
user = prefs.getString(USER,"").toString()
|
||||||
|
password = prefs.getString(PASSWORD,"").toString()
|
||||||
|
sectorFk = prefs.getInt(SECTORFK,1).toString()
|
||||||
|
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||||
|
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk)
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
customDialog = CustomDialog(requireContext())
|
||||||
|
activity!!.main_bottom_navigation.visibility = View.GONE
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
toolbar_title.text = "itemShelving_BuyerTask"
|
||||||
|
setToolBar()
|
||||||
|
setEvents()
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
super.onPause()
|
||||||
|
goBack = true
|
||||||
|
storedPosition = lm?.findFirstVisibleItemPosition() ?: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setToolBar(){
|
||||||
|
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||||
|
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||||
|
listIcons.add(iconReload)
|
||||||
|
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||||
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
if (item == iconReload){
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setEvents(){
|
||||||
|
backButton.setOnClickListener {
|
||||||
|
activity!!.onBackPressed()
|
||||||
|
}
|
||||||
|
|
||||||
|
//ESCANER =========
|
||||||
|
hideKeyboards()
|
||||||
|
scan_input.requestFocus()
|
||||||
|
scan_input.setOnEditorActionListener { v, actionId, event ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
if (!scan_input.text.toString().isNullOrEmpty()){
|
||||||
|
findSale(scan_input.text.toString())
|
||||||
|
}
|
||||||
|
scan_input.setText("")
|
||||||
|
hideKeyboards()
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun hideKeyboards(){
|
||||||
|
try{
|
||||||
|
requireActivity().hideKeyboard()
|
||||||
|
}catch (e:Exception){}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun observeViewModel() {
|
||||||
|
with(viewModel) {
|
||||||
|
buyersList.observe(viewLifecycleOwner, Observer {
|
||||||
|
splash_progress.visibility = View.GONE
|
||||||
|
createBuyerList(it.list)
|
||||||
|
})
|
||||||
|
|
||||||
|
response.observe(viewLifecycleOwner, Observer {
|
||||||
|
viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createBuyerList(list:List<ItemBuyerVO>){
|
||||||
|
list.forEach { item ->
|
||||||
|
if (!goBack){
|
||||||
|
if (item.created != null && item.created != ""){
|
||||||
|
item.created = getCalendarFromDate(item.created).convertToDateString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.visible.contains("Visible:",ignoreCase = true)){
|
||||||
|
item.visible = item.visible
|
||||||
|
}else{
|
||||||
|
item.visible = "Visible: "+item.visible
|
||||||
|
}
|
||||||
|
|
||||||
|
item.iconResourceOk = R.drawable.ic_start_ok
|
||||||
|
item.iconResourceKo = R.drawable.ic_star_ko
|
||||||
|
}
|
||||||
|
goBack = false
|
||||||
|
listItems = list
|
||||||
|
buyersAdapter = ItemBuyersAdapter(listItems,pasillerosItemClickListener!!,object: OnStarSelectedListener{
|
||||||
|
override fun onStarSelected(vId: String, vStars: String) {
|
||||||
|
splash_progress.visibility = View.VISIBLE
|
||||||
|
viewModel.itemShelvingStarsUpdate(user,password,vId,vStars)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
shelving_buyers_items.adapter = buyersAdapter
|
||||||
|
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
shelving_buyers_items.layoutManager = lm
|
||||||
|
|
||||||
|
if (storedPosition < listItems.size)
|
||||||
|
goToPosition(storedPosition)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getCalendarFromDate(date:String): Calendar {
|
||||||
|
val sdf = SimpleDateFormat("yyyy-MM-dd")
|
||||||
|
val cal = Calendar.getInstance()
|
||||||
|
cal.setTime(sdf.parse(date))
|
||||||
|
return cal
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun findSale(matricula:String){
|
||||||
|
var isSearch = false
|
||||||
|
var index = 0
|
||||||
|
var position = 0
|
||||||
|
listItems.forEach { item ->
|
||||||
|
if (item.shelvingFk.toUpperCase() == matricula.toUpperCase()){
|
||||||
|
item.showStars = true
|
||||||
|
if (!isSearch){
|
||||||
|
position = index
|
||||||
|
isSearch = true
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
item.showStars = false
|
||||||
|
}
|
||||||
|
index += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
storedPosition = position
|
||||||
|
goToPosition(position)
|
||||||
|
|
||||||
|
buyersAdapter?.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun goToPosition(position:Int){
|
||||||
|
if (shelving_buyers_items != null){
|
||||||
|
shelving_buyers_items.addViewObserver {
|
||||||
|
lm!!.scrollToPositionWithOffset(position,0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.calidad.fragment
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import es.verdnatura.domain.GetQualityUserCase
|
||||||
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
|
import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerListVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||||
|
import retrofit2.Call
|
||||||
|
import retrofit2.Callback
|
||||||
|
import retrofit2.Response
|
||||||
|
|
||||||
|
class QaualityViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
private val getQualityUserCase: GetQualityUserCase = GetQualityUserCase()
|
||||||
|
|
||||||
|
private val _buyersList by lazy { MutableLiveData<ItemBuyerListVO>() }
|
||||||
|
val buyersList: LiveData<ItemBuyerListVO>
|
||||||
|
get() = _buyersList
|
||||||
|
|
||||||
|
|
||||||
|
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val response: LiveData<ResponseItemVO>
|
||||||
|
get() = _response
|
||||||
|
|
||||||
|
|
||||||
|
fun itemShelvingBuyerTask(user:String,password:String,userFk:String){
|
||||||
|
getQualityUserCase.itemShelvingBuyerTask(user,password,userFk).enqueue(object :
|
||||||
|
Callback<List<ItemBuyerVO>> {
|
||||||
|
override fun onFailure(call: Call<List<ItemBuyerVO>>, t: Throwable) {
|
||||||
|
val listError:ArrayList<ItemBuyerVO> = ArrayList()
|
||||||
|
listError.add(ItemBuyerVO(isError = true,errorMessage = t.message!!))
|
||||||
|
_buyersList.value = ItemBuyerListVO(listError)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(
|
||||||
|
call: Call<List<ItemBuyerVO>>,
|
||||||
|
response: Response<List<ItemBuyerVO>>
|
||||||
|
) {
|
||||||
|
if (response.body() != null){
|
||||||
|
_buyersList.value = response.body()?.let { ItemBuyerListVO(it) }
|
||||||
|
}else{
|
||||||
|
val listError:ArrayList<ItemBuyerVO> = ArrayList()
|
||||||
|
listError.add(ItemBuyerVO(isError = true,errorMessage = "Error en la llamada de itemShelvingBuyerTask"))
|
||||||
|
_buyersList.value = ItemBuyerListVO(listError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingStarsUpdate(usuario:String,password:String, vId: String,vStars: String) {
|
||||||
|
getQualityUserCase.itemShelvingStarsUpdate(usuario,password,vId,vStars).enqueue(object : Callback<String>{
|
||||||
|
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||||
|
if (response.body() == null){
|
||||||
|
_response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelvingStarsUpdate")
|
||||||
|
}else{
|
||||||
|
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.calidad.model
|
||||||
|
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||||
|
|
||||||
|
class BuyerVO (
|
||||||
|
var userFk:String = "",
|
||||||
|
var nickname:String= "",
|
||||||
|
var isError:Boolean = false,
|
||||||
|
var errorMessage:String = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class BuyerListVO (
|
||||||
|
var list: List<BuyerVO> = listOf()
|
||||||
|
)
|
||||||
|
|
||||||
|
class ItemBuyerVO (
|
||||||
|
var id:String = "",
|
||||||
|
var itemFk:String = "",
|
||||||
|
var longName:String = "",
|
||||||
|
var image:String = "",
|
||||||
|
var parking:String = "",
|
||||||
|
var shelvingFk:String = "",
|
||||||
|
var visible:String = "",
|
||||||
|
var created:String = "",
|
||||||
|
var stars:String = "",
|
||||||
|
var isError:Boolean = false,
|
||||||
|
var errorMessage:String = "",
|
||||||
|
var showStars:Boolean = false,
|
||||||
|
var iconResourceOk: Int = 0,
|
||||||
|
var iconResourceKo: Int = 0
|
||||||
|
)
|
||||||
|
|
||||||
|
class ItemBuyerListVO(
|
||||||
|
var list: List<ItemBuyerVO> = listOf()
|
||||||
|
)
|
|
@ -10,7 +10,6 @@ import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
import es.verdnatura.presentation.view.feature.login.model.SalixMessageVO
|
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.*
|
import es.verdnatura.presentation.view.feature.sacador.model.*
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
import retrofit2.Callback
|
import retrofit2.Callback
|
||||||
|
|
|
@ -4,11 +4,8 @@ import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.GetSacadorControladorUserCase
|
import es.verdnatura.domain.GetSacadorControladorUserCase
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeListVO
|
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
import retrofit2.Callback
|
import retrofit2.Callback
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.login.activity
|
package es.verdnatura.presentation.view.feature.login.activity
|
||||||
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.Button
|
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ActivityLoginBinding
|
import es.verdnatura.databinding.ActivityLoginBinding
|
||||||
import es.verdnatura.presentation.base.BaseActivity
|
import es.verdnatura.presentation.base.BaseActivity
|
||||||
|
|
|
@ -14,6 +14,8 @@ import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesFragment
|
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesFragment
|
||||||
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardFragment
|
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardFragment
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFragment
|
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFragment
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersFragment
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityFragment
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragment
|
||||||
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorFragment
|
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorFragment
|
||||||
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasFragment
|
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasFragment
|
||||||
|
@ -43,7 +45,7 @@ import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
|
||||||
class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClickListener,
|
class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClickListener,
|
||||||
OnTruckClickListener, OnPalletClickListener,OnComprobarPalletViewClickListener,OnCollectionSelectedListener {
|
OnTruckClickListener, OnPalletClickListener,OnComprobarPalletViewClickListener,OnCollectionSelectedListener,OnBuyerSelectedListener {
|
||||||
|
|
||||||
private var lastBottomMenuItemSelected: ItemMenuVO? = null
|
private var lastBottomMenuItemSelected: ItemMenuVO? = null
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
|
@ -199,6 +201,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClick
|
||||||
"Automatic" -> {
|
"Automatic" -> {
|
||||||
addFragmentOnTop(AutomaticAddItemFragment.newInstance(entryPoint))
|
addFragmentOnTop(AutomaticAddItemFragment.newInstance(entryPoint))
|
||||||
}
|
}
|
||||||
|
"Calidad" -> {
|
||||||
|
addFragmentOnTop(BuyersFragment.newInstance())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Log.i("Item: ",item.title)
|
Log.i("Item: ",item.title)
|
||||||
}
|
}
|
||||||
|
@ -251,4 +256,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClick
|
||||||
addFragmentOnTop(CollectionFragment.newInstance(collection,type))
|
addFragmentOnTop(CollectionFragment.newInstance(collection,type))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBuyerSelected(userFk: String) {
|
||||||
|
addFragmentOnTop(QaualityFragment.newInstance(userFk))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.pasillero.fragment
|
package es.verdnatura.presentation.view.feature.pasillero.fragment
|
||||||
|
|
||||||
|
|
||||||
import android.app.Application
|
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
@ -68,6 +67,12 @@ class PasilleroViewModel : BaseViewModel() {
|
||||||
"Shelving Parking",R.string.ShelvingParking)
|
"Shelving Parking",R.string.ShelvingParking)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_pasillerositem.add(
|
||||||
|
PasillerosItemVO(8,
|
||||||
|
R.drawable.ic_baseline_star_24,
|
||||||
|
"Calidad",R.string.Calidad)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,9 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
||||||
}else{
|
}else{
|
||||||
customDialogList.setValueTwo("")
|
customDialogList.setValueTwo("")
|
||||||
showErrorMessage("El resultado del procedimiento barcodeToItem de la etiqueta escaneada es: " +it.response)
|
showErrorMessage("El resultado del procedimiento barcodeToItem de la etiqueta escaneada es: " +it.response)
|
||||||
mperror?.start()
|
if (mperror != null) {
|
||||||
|
mperror?.start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,7 +296,9 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isOk) {
|
if (!isOk) {
|
||||||
mperror!!.start()
|
if (mperror != null) {
|
||||||
|
mperror!!.start()
|
||||||
|
}
|
||||||
("Elemento escaneado no encontrado: "+txtscan).toast(requireContext())
|
("Elemento escaneado no encontrado: "+txtscan).toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +329,9 @@ class PreSacadorFragment : BaseFragment<FragmentPreSacadorBinding,PreSacadorView
|
||||||
|
|
||||||
|
|
||||||
if (!isOk) {
|
if (!isOk) {
|
||||||
mperror!!.start()
|
if (mperror != null) {
|
||||||
|
mperror!!.start()
|
||||||
|
}
|
||||||
("Elemento escaneado no encontrado: "+txtscan).toast(requireContext())
|
("Elemento escaneado no encontrado: "+txtscan).toast(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,9 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ItemArticleRowBinding
|
import es.verdnatura.databinding.ItemArticleRowBinding
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
|
||||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||||
import es.verdnatura.presentation.view.feature.collection.adapter.PlacementAdapter
|
import es.verdnatura.presentation.view.feature.collection.adapter.PlacementAdapter
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.presacador.adapter.PreSacadorAdapter
|
|
||||||
import es.verdnatura.presentation.view.feature.presacador.mapper.toSale
|
|
||||||
import es.verdnatura.presentation.view.feature.presacador.mapper.toSaleReposicion
|
import es.verdnatura.presentation.view.feature.presacador.mapper.toSaleReposicion
|
||||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
|
|
|
@ -12,7 +12,6 @@ import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ReposicionFragmentBinding
|
import es.verdnatura.databinding.ReposicionFragmentBinding
|
||||||
import es.verdnatura.domain.ConstAndValues
|
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.*
|
import es.verdnatura.presentation.common.*
|
||||||
|
@ -24,18 +23,13 @@ import es.verdnatura.presentation.view.feature.articulo.adapter.BarcodeAdapter
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroFragment
|
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.presacador.adapter.PreSacadorAdapter
|
|
||||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||||
import es.verdnatura.presentation.view.feature.reposicion.adapter.ReposicionAdapter
|
import es.verdnatura.presentation.view.feature.reposicion.adapter.ReposicionAdapter
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
import kotlinx.android.synthetic.main.activity_main.*
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
import kotlinx.android.synthetic.main.reposicion_fragment.*
|
import kotlinx.android.synthetic.main.reposicion_fragment.*
|
||||||
import kotlinx.android.synthetic.main.reposicion_fragment.fragment_sacador_collections
|
|
||||||
import kotlinx.android.synthetic.main.reposicion_fragment.scan_input
|
|
||||||
import kotlinx.android.synthetic.main.reposicion_fragment.splash_progress
|
|
||||||
import kotlinx.android.synthetic.main.toolbar.*
|
import kotlinx.android.synthetic.main.toolbar.*
|
||||||
|
|
||||||
class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionViewModel>(
|
class ReposicionFragment : BaseFragment<ReposicionFragmentBinding, ReposicionViewModel>(
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.ubicador.fragment
|
package es.verdnatura.presentation.view.feature.ubicador.fragment
|
||||||
|
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.graphics.drawable.Drawable
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
@ -10,11 +9,9 @@ import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentAutomaticAddItemBinding
|
import es.verdnatura.databinding.FragmentAutomaticAddItemBinding
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnAutomaticItemClickListener
|
import es.verdnatura.presentation.common.OnAutomaticItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogUbicador
|
import es.verdnatura.presentation.view.component.CustomDialogUbicador
|
||||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapter
|
import es.verdnatura.presentation.view.feature.ubicador.adapter.AutomaticAdapter
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemEscanerVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemEscanerVO
|
||||||
|
|
|
@ -29,9 +29,7 @@ import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter
|
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
import kotlinx.android.synthetic.main.activity_main.*
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
|
||||||
import kotlinx.android.synthetic.main.fragment_ubicador.*
|
import kotlinx.android.synthetic.main.fragment_ubicador.*
|
||||||
import kotlinx.android.synthetic.main.fragment_ubicador.splash_progress
|
|
||||||
import kotlinx.android.synthetic.main.toolbar.*
|
import kotlinx.android.synthetic.main.toolbar.*
|
||||||
|
|
||||||
class UbicadorFragment(
|
class UbicadorFragment(
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<vector android:height="24dp" android:tint="#F7931E"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<vector android:height="24dp" android:tint="#D6D6D6"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<vector android:height="24dp" android:tint="#F7DF4D"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="viewModel"
|
||||||
|
type="es.verdnatura.presentation.view.feature.calidad.fragment.BuyersViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/verdnatura_black">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/buyers_items"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:listitem="@layout/item_card_row" />
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/main_toolbar"
|
||||||
|
layout="@layout/toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/splash_progress"
|
||||||
|
android:visibility="invisible"
|
||||||
|
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>
|
|
@ -0,0 +1,178 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tool="http://schemas.android.com/tools"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="itemBuyer"
|
||||||
|
type="es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO" />
|
||||||
|
</data>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginBottom="@dimen/layout_margin_1">
|
||||||
|
<!--CABECERA=================================================-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/item_row_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/verdnatura_black_2">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/verdnatura_warm_grey"
|
||||||
|
android:padding="@dimen/layout_margin_min"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:text="@{itemBuyer.itemFk}"
|
||||||
|
tool:text="1872"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="@dimen/h6"
|
||||||
|
android:layout_marginRight="@dimen/layout_margin_min"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:text="@{itemBuyer.longName}"
|
||||||
|
tool:text="Planta de prueba"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="@dimen/h8"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="@dimen/layout_margin_min">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center_vertical">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="@dimen/item_image_width_l"
|
||||||
|
android:layout_height="@dimen/item_image_width_l"
|
||||||
|
app:cardCornerRadius="30dp"
|
||||||
|
android:layout_marginRight="@dimen/layout_margin_1">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_item"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/layout_margin_min"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:text="@{itemBuyer.parking}"
|
||||||
|
tool:text="parking"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="@dimen/h8"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:text="@{itemBuyer.shelvingFk}"
|
||||||
|
tool:text="shelvingFk"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="@dimen/h8"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:text="@{itemBuyer.visible}"
|
||||||
|
tool:text="visible"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="@dimen/h8"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:text="@{itemBuyer.created}"
|
||||||
|
tool:text="created"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="@dimen/h8"/>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_stars"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="@dimen/layout_margin_min"
|
||||||
|
android:gravity="center_horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/s1"
|
||||||
|
android:tag="1"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:src="@drawable/ic_star_ko"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/s2"
|
||||||
|
android:tag="2"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:src="@drawable/ic_star_ko"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/s3"
|
||||||
|
android:tag="3"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:src="@drawable/ic_star_ko"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/s4"
|
||||||
|
android:tag="4"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:src="@drawable/ic_star_ko"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/s5"
|
||||||
|
android:tag="5"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:src="@drawable/ic_star_ko"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
|
@ -0,0 +1,77 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="viewModel"
|
||||||
|
type="es.verdnatura.presentation.view.feature.calidad.fragment.QaualityViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/verdnatura_black">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/scan_input"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="@android:color/white"
|
||||||
|
android:hint="@string/Escaner"
|
||||||
|
android:inputType="text"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/verdnatura_white"
|
||||||
|
android:textColorHint="@android:color/darker_gray"
|
||||||
|
android:textSize="@dimen/body2"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/main_toolbar"
|
||||||
|
android:paddingLeft="@dimen/default_layout_margin"/>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/shelving_buyers_items"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:listitem="@layout/item_buyer_row" />
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/main_toolbar"
|
||||||
|
layout="@layout/toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/splash_progress"
|
||||||
|
android:visibility="invisible"
|
||||||
|
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>
|
|
@ -91,4 +91,5 @@
|
||||||
<string name="CANTIDAD2">CANTIDAD</string>
|
<string name="CANTIDAD2">CANTIDAD</string>
|
||||||
<string name="DARALTA">DAR DE ALTA</string>
|
<string name="DARALTA">DAR DE ALTA</string>
|
||||||
<string name="DARBAJA">DAR DE BAJA</string>
|
<string name="DARBAJA">DAR DE BAJA</string>
|
||||||
|
<string name="Calidad">Calidad</string>
|
||||||
</resources>
|
</resources>
|
|
@ -72,6 +72,7 @@
|
||||||
<dimen name="options_image_width">40dp</dimen>
|
<dimen name="options_image_width">40dp</dimen>
|
||||||
<dimen name="options_image_padding">10dp</dimen>
|
<dimen name="options_image_padding">10dp</dimen>
|
||||||
<dimen name="item_image_width">40dp</dimen>
|
<dimen name="item_image_width">40dp</dimen>
|
||||||
|
<dimen name="item_image_width_l">80dp</dimen>
|
||||||
<dimen name="item_image_width_min">33dp</dimen>
|
<dimen name="item_image_width_min">33dp</dimen>
|
||||||
|
|
||||||
<!-- Sacadores -->
|
<!-- Sacadores -->
|
||||||
|
|
|
@ -90,4 +90,5 @@
|
||||||
<string name="CANTIDAD2">QUANTITY</string>
|
<string name="CANTIDAD2">QUANTITY</string>
|
||||||
<string name="DARALTA">ADD</string>
|
<string name="DARALTA">ADD</string>
|
||||||
<string name="DARBAJA">REMOVE</string>
|
<string name="DARBAJA">REMOVE</string>
|
||||||
|
<string name="Calidad">Quality</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue