Modificar synthetic por databinding/viewbinding
This commit is contained in:
parent
af1b0541d5
commit
42023e7f61
|
@ -76,10 +76,14 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_login.xml" value="0.134375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_main.xml" value="0.17916666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/buyers_fragment.xml" value="0.18333333333333332" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_dialog.xml" value="0.1490036231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_list_dialog.xml" value="0.1490036231884058" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.12817028985507245" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_automatic_add_item.xml" value="0.20625" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer.xml" value="0.1408514492753623" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_load.xml" value="0.20923913043478262" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_loadexpedition.xml" value="0.1398176291793313" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item.xml" value="0.21014492753623187" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_collection.xml" value="0.23007246376811594" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_controlador.xml" value="0.20153985507246377" />
|
||||
|
|
|
@ -40,7 +40,7 @@ android {
|
|||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = false
|
||||
viewBinding = true
|
||||
}
|
||||
dataBinding {
|
||||
enabled = true
|
||||
|
|
Binary file not shown.
|
@ -110,10 +110,11 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
requestRecordAudioPermissionNew()
|
||||
init()
|
||||
}*/
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||
{
|
||||
super.onViewCreated(view,savedInstanceState)
|
||||
|
||||
initDataBinding()
|
||||
getBundleArguments()
|
||||
observeViewModel()
|
||||
runSound()
|
||||
|
|
|
@ -27,6 +27,10 @@ interface OnPasillerosItemClickListener {
|
|||
}
|
||||
|
||||
|
||||
interface hideBottomNavigation{
|
||||
fun hideBottomNavigation(entryPoint:String)
|
||||
}
|
||||
|
||||
interface OnAjustesItemClickListener {
|
||||
fun onAjustesItemClickListener(item: AjustesItemVO)
|
||||
}
|
||||
|
|
|
@ -4,58 +4,61 @@ import android.app.Dialog
|
|||
import android.content.Context
|
||||
import android.view.View
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_dialog.*
|
||||
import es.verdnatura.databinding.ComponentCustomDialogBinding
|
||||
//import kotlinx.android.synthetic.main.component_custom_dialog.*
|
||||
|
||||
//import kotlinx.android.synthetic.main.component_custom_dialog.*
|
||||
//import es.verdnatura.databinding.ComponentCustomDialogBinding
|
||||
|
||||
//private lateinit var binding: ComponentCustomDialogBinding
|
||||
private lateinit var binding: ComponentCustomDialogBinding
|
||||
|
||||
class CustomDialog(context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
init {
|
||||
|
||||
setContentView(R.layout.component_custom_dialog)
|
||||
//setContentView(R.layout.component_custom_dialog)
|
||||
//sergio: lo nuevo para quitar synthetic de kotlin
|
||||
/* binding = ComponentCustomDialogBinding.inflate(layoutInflater)
|
||||
val view = binding.root
|
||||
setContentView(view)*/
|
||||
|
||||
binding = ComponentCustomDialogBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun setTitle(title: String): CustomDialog {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
/* binding.customDialogTitle.visibility = View.VISIBLE
|
||||
binding.customDialogTitle.text = title*/
|
||||
/*custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title*/
|
||||
binding.customDialogTitle.visibility = View.VISIBLE
|
||||
binding.customDialogTitle.text = title
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
fun setDescription(description: String): CustomDialog {
|
||||
custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description
|
||||
/*binding.customDialogDescription.visibility = View.VISIBLE
|
||||
binding.customDialogDescription.text = description*/
|
||||
/*custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description*/
|
||||
binding.customDialogDescription.visibility = View.VISIBLE
|
||||
binding.customDialogDescription.text = description
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialog {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
/* custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
/*binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
||||
binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOk.text = text
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }*/
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialog {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
/* custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
/* binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
||||
binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonKo.text = text
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }*/
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -6,49 +6,73 @@ import android.content.Context
|
|||
import android.view.View
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_hour.*
|
||||
import es.verdnatura.databinding.ComponentCustomHourBinding
|
||||
//import kotlinx.android.synthetic.main.component_custom_hour.*
|
||||
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
||||
class CustomDialogHour(context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
private var binding: ComponentCustomHourBinding = ComponentCustomHourBinding.inflate(layoutInflater)
|
||||
|
||||
init {
|
||||
setContentView(R.layout.component_custom_hour)
|
||||
|
||||
setContentView(binding.root)
|
||||
|
||||
//setContentView(R.layout.component_custom_hour)
|
||||
}
|
||||
|
||||
fun getDestinoEditText(): TextInputEditText {
|
||||
return custom_dialog_destino_value
|
||||
|
||||
//return custom_dialog_destino_value
|
||||
return binding.customDialogDestinoValue
|
||||
}
|
||||
|
||||
fun getDestinoValue(): String {
|
||||
return custom_dialog_destino_value.text.toString()
|
||||
// return custom_dialog_destino_value.text.toString()
|
||||
return binding.customDialogDestinoValue.text.toString()
|
||||
}
|
||||
|
||||
fun setDestinoValue(value: String): CustomDialogHour {
|
||||
custom_dialog_destino_value.setText(value)
|
||||
custom_dialog_destino_value.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogDestinoValue.setText(value)
|
||||
binding.customDialogDestinoValue.visibility=View.VISIBLE
|
||||
return this
|
||||
/*custom_dialog_destino_value.setText(value)
|
||||
custom_dialog_destino_value.visibility = View.VISIBLE
|
||||
return this*/
|
||||
}
|
||||
|
||||
|
||||
fun getHoraEditText(): TextInputEditText {
|
||||
return custom_dialog_hour_value
|
||||
return binding.customDialogHourValue
|
||||
//return custom_dialog_hour_value
|
||||
}
|
||||
|
||||
fun getHoraValue(): String {
|
||||
return custom_dialog_hour_value.text.toString()
|
||||
return binding.customDialogHourValue.text.toString()
|
||||
//return custom_dialog_hour_value.text.toString()
|
||||
}
|
||||
|
||||
fun setHoraValue(value: String): CustomDialogHour {
|
||||
custom_dialog_hour_value.setText(value)
|
||||
custom_dialog_hour_value.visibility = View.VISIBLE
|
||||
ib_obtener_hora.setOnClickListener {
|
||||
val cal = Calendar.getInstance()
|
||||
|
||||
binding.customDialogHourValue.setText(value)
|
||||
binding.customDialogHourValue.visibility=View.VISIBLE
|
||||
binding.ibObtenerHora.setOnClickListener{
|
||||
|
||||
}
|
||||
//custom_dialog_hour_value.setText(value)
|
||||
//custom_dialog_hour_value.visibility = View.VISIBLE
|
||||
// ib_obtener_hora.setOnClickListener {
|
||||
binding.ibObtenerHora.setOnClickListener{
|
||||
val cal = Calendar.getInstance()
|
||||
val timeSetListener = TimePickerDialog.OnTimeSetListener { timePicker, hour, minute ->
|
||||
cal.set(Calendar.HOUR_OF_DAY, hour)
|
||||
cal.set(Calendar.MINUTE, minute)
|
||||
custom_dialog_hour_value.setText(SimpleDateFormat("HH:mm").format(cal.time))
|
||||
binding.customDialogHourValue.setText(SimpleDateFormat("HH:mm").format(cal.time))
|
||||
//custom_dialog_hour_value.setText(SimpleDateFormat("HH:mm").format(cal.time))
|
||||
}
|
||||
TimePickerDialog(context, timeSetListener, cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), true).show()
|
||||
}
|
||||
|
@ -56,28 +80,41 @@ class CustomDialogHour(context: Context) : Dialog(context, R.style.DialogTheme)
|
|||
}
|
||||
|
||||
fun setTitle(title: String): CustomDialogHour {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
binding.customDialogTitle.visibility=View.VISIBLE
|
||||
binding.customDialogTitle.text=title
|
||||
// custom_dialog_title.visibility = View.VISIBLE
|
||||
//custom_dialog_title.text = title
|
||||
return this
|
||||
}
|
||||
|
||||
fun setDescription(description: String): CustomDialogHour {
|
||||
custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description
|
||||
binding.customDialogDescription.visibility=View.VISIBLE
|
||||
binding.customDialogDescription.text = description
|
||||
|
||||
//custom_dialog_description.visibility = View.VISIBLE
|
||||
//custom_dialog_description.text = description
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogHour {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
binding.customDialogButtonOk.visibility=View.VISIBLE
|
||||
binding.customDialogButtonOk.text=text
|
||||
|
||||
//custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
// custom_dialog_button_ok.text = text
|
||||
// custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
binding.customDialogButtonOk.setOnClickListener{ onButtonClicked() }
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogHour {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonKo.text = text
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||
/*custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -5,55 +5,84 @@ import android.content.Context
|
|||
import android.view.View
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_dialog.custom_dialog_button_ko
|
||||
import kotlinx.android.synthetic.main.component_custom_dialog.custom_dialog_button_ok
|
||||
import kotlinx.android.synthetic.main.component_custom_dialog.custom_dialog_description
|
||||
import kotlinx.android.synthetic.main.component_custom_dialog.custom_dialog_title
|
||||
import kotlinx.android.synthetic.main.component_custom_edit_dialog.*
|
||||
import es.verdnatura.databinding.ComponentCustomEditDialogBinding
|
||||
|
||||
|
||||
class CustomDialogInput (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
private var binding: ComponentCustomEditDialogBinding = ComponentCustomEditDialogBinding.inflate(layoutInflater)
|
||||
|
||||
|
||||
init {
|
||||
setContentView(R.layout.component_custom_edit_dialog)
|
||||
|
||||
setContentView(binding.root)
|
||||
//setContentView(R.layout.component_custom_edit_dialog)
|
||||
}
|
||||
|
||||
fun getEditText() : TextInputEditText {
|
||||
return custom_dialog_value
|
||||
|
||||
return binding.customDialogValue
|
||||
//return custom_dialog_value
|
||||
}
|
||||
|
||||
fun getValue() : String {
|
||||
return custom_dialog_value.text.toString()
|
||||
|
||||
return binding.customDialogValue.text.toString()
|
||||
//return custom_dialog_value.text.toString()
|
||||
|
||||
}
|
||||
|
||||
fun setValue(value : String): CustomDialogInput{
|
||||
custom_dialog_value.setText(value)
|
||||
custom_dialog_value.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogValue.setText(value)
|
||||
binding.customDialogValue.visibility= View.VISIBLE
|
||||
|
||||
// custom_dialog_value.setText(value)
|
||||
// custom_dialog_value.visibility = View.VISIBLE
|
||||
return this
|
||||
}
|
||||
|
||||
fun setTitle(title: String): CustomDialogInput {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
|
||||
binding.customDialogTitle.visibility=View.VISIBLE
|
||||
binding.customDialogTitle.text=title
|
||||
// custom_dialog_title.visibility = View.VISIBLE
|
||||
// custom_dialog_title.text = title
|
||||
return this
|
||||
}
|
||||
|
||||
fun setDescription(description: String): CustomDialogInput {
|
||||
custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description
|
||||
|
||||
binding.customDialogDescription.visibility = View.VISIBLE
|
||||
binding.customDialogDescription.text = description
|
||||
|
||||
/*custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogInput {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOk.text =text
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogInput {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonKo.text =text
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/*custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -6,91 +6,126 @@ import android.view.View
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_list_dialog.*
|
||||
import es.verdnatura.databinding.ComponentCustomListDialogBinding
|
||||
//import kotlinx.android.synthetic.main.component_custom_list_dialog.*
|
||||
|
||||
|
||||
class CustomDialogList (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
|
||||
private var binding: ComponentCustomListDialogBinding = ComponentCustomListDialogBinding.inflate(layoutInflater)
|
||||
init {
|
||||
setContentView(R.layout.component_custom_list_dialog)
|
||||
|
||||
setContentView(binding.root)
|
||||
//setContentView(R.layout.component_custom_list_dialog)
|
||||
}
|
||||
|
||||
fun getRecyclerView() : RecyclerView {
|
||||
return item_recyclerview
|
||||
|
||||
return binding.itemRecyclerview
|
||||
//return item_recyclerview
|
||||
}
|
||||
|
||||
fun getEditText() : TextInputEditText {
|
||||
return custom_dialog_value
|
||||
return binding.customDialogValue
|
||||
//return custom_dialog_value
|
||||
}
|
||||
|
||||
fun getEditTextTwo() : TextInputEditText {
|
||||
return custom_dialog_value_two
|
||||
return binding.customDialogValueTwo
|
||||
//return custom_dialog_value_two
|
||||
}
|
||||
|
||||
fun getValue() : String {
|
||||
return custom_dialog_value.text.toString()
|
||||
return binding.customDialogValue.text.toString()
|
||||
//return custom_dialog_value.text.toString()
|
||||
}
|
||||
|
||||
fun setValue(value : String): CustomDialogList{
|
||||
custom_dialog_value.setText(value)
|
||||
textinputlayout_username.visibility = View.VISIBLE
|
||||
binding.customDialogValue.setText(value)
|
||||
binding.textinputlayoutUsername.visibility=View.VISIBLE
|
||||
/*custom_dialog_value.setText(value)
|
||||
textinputlayout_username.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun getValueTwo() : String {
|
||||
return custom_dialog_value_two.text.toString()
|
||||
return binding.customDialogValueTwo.text.toString()
|
||||
//return custom_dialog_value_two.text.toString()
|
||||
}
|
||||
|
||||
fun setValueTwo(value : String): CustomDialogList{
|
||||
custom_dialog_value_two.setText(value)
|
||||
textinputlayout_two.visibility = View.VISIBLE
|
||||
binding.customDialogValueTwo.setText(value)
|
||||
binding.textinputlayoutTwo.visibility=View.VISIBLE
|
||||
|
||||
/* custom_dialog_value_two.setText(value)
|
||||
textinputlayout_two.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setTitle(title: String): CustomDialogList {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
binding.customDialogTitle.visibility=View.VISIBLE
|
||||
binding.customDialogTitle.text=title
|
||||
/* custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setDescription(title: String): CustomDialogList {
|
||||
custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = title
|
||||
binding.customDialogDescription.visibility=View.VISIBLE
|
||||
binding.customDialogDescription.text=title
|
||||
|
||||
/*custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = title*/
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOk.visibility=View.VISIBLE
|
||||
binding.customDialogButtonOk.text=text
|
||||
|
||||
/*custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogList {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
|
||||
binding.customDialogButtonKo.visibility=View.VISIBLE
|
||||
binding.customDialogButtonKo.text=text
|
||||
/*custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text*/
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||
// custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
return this
|
||||
}
|
||||
|
||||
fun setHintValue(text:String): CustomDialogList{
|
||||
custom_dialog_value.hint = text
|
||||
|
||||
binding.customDialogValue.hint=text
|
||||
// custom_dialog_value.hint = text
|
||||
return this
|
||||
}
|
||||
|
||||
fun setHintValueTwo(text:String): CustomDialogList{
|
||||
custom_dialog_value_two.hint = text
|
||||
binding.customDialogValueTwo.hint=text
|
||||
//custom_dialog_value_two.hint = text
|
||||
return this
|
||||
}
|
||||
|
||||
fun setTextTwoGone():CustomDialogList{
|
||||
textinputlayout_two.visibility = View.GONE
|
||||
binding.textinputlayoutTwo.visibility = View.GONE
|
||||
//textinputlayout_two.visibility = View.GONE
|
||||
return this
|
||||
}
|
||||
|
||||
fun hideDialog():CustomDialogList{
|
||||
custom_dialog_value.visibility = View.GONE
|
||||
binding.customDialogValue.visibility = View.GONE
|
||||
//custom_dialog_value.visibility = View.GONE
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
package es.verdnatura.presentation.view.component
|
||||
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ComponentCustomDialogBinding
|
||||
import kotlinx.android.synthetic.main.component_custom_dialog.*
|
||||
|
||||
private lateinit var binding: ComponentCustomDialogBinding
|
||||
|
||||
class CustomDialogMainActivity(context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
init {
|
||||
//sergio: de momento se deja el componentDialogMainActivity porque no acaba de funciona bien
|
||||
// con el viewbinding del customDialog
|
||||
|
||||
setContentView(R.layout.component_custom_dialog)
|
||||
|
||||
/* binding = ComponentCustomDialogBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun setTitle(title: String): CustomDialogMainActivity {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
/* binding.customDialogTitle.visibility = View.VISIBLE
|
||||
binding.customDialogTitle.text = title*/
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
fun setDescription(description: String): CustomDialogMainActivity {
|
||||
custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description
|
||||
/*binding.customDialogDescription.visibility = View.VISIBLE
|
||||
binding.customDialogDescription.text = description*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
/* binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOk.text = text
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogMainActivity {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
/* binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonKo.text = text
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
}
|
|
@ -5,86 +5,129 @@ import android.content.Context
|
|||
import android.view.View
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ko
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_button_ok_two
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_description
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.custom_dialog_title
|
||||
import es.verdnatura.databinding.ComponentCustomThreeDialogBinding
|
||||
|
||||
|
||||
class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
private var binding: ComponentCustomThreeDialogBinding = ComponentCustomThreeDialogBinding.inflate(layoutInflater)
|
||||
|
||||
init {
|
||||
setContentView(R.layout.component_custom_three_dialog)
|
||||
|
||||
setContentView(binding.root)
|
||||
//setContentView(R.layout.component_custom_three_dialog)
|
||||
}
|
||||
|
||||
|
||||
fun setTitle(title: String): CustomDialogThreeButtons {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
|
||||
binding.customDialogTitle.visibility= View.VISIBLE
|
||||
binding.customDialogTitle.text=title
|
||||
/* custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setDescription(description: String): CustomDialogThreeButtons {
|
||||
custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description
|
||||
binding.customDialogDescription.visibility= View.VISIBLE
|
||||
binding.customDialogDescription.text=description
|
||||
|
||||
/* custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOk.text =text
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
fun getValue() : String {
|
||||
return custom_dialog_value.text.toString()
|
||||
return binding.customDialogValue.text.toString()
|
||||
//return custom_dialog_value.text.toString()
|
||||
}
|
||||
|
||||
fun getEditText() : TextInputEditText {
|
||||
return custom_dialog_value
|
||||
return binding.customDialogValue
|
||||
//return custom_dialog_value
|
||||
}
|
||||
fun setValue(value : String): CustomDialogThreeButtons{
|
||||
custom_dialog_value.setText(value)
|
||||
textinputlayout.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogValue.setText(value)
|
||||
binding.textinputlayout.visibility = View.VISIBLE
|
||||
/* custom_dialog_value.setText(value)
|
||||
textinputlayout.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButtonTwo(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||
custom_dialog_button_ok_two.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOkTwo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOkTwo.text = text
|
||||
binding.customDialogButtonOkTwo.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ok_two.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok_two.text = text
|
||||
custom_dialog_button_ok_two.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok_two.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButtonThree(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||
custom_dialog_button_ok_three.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOkThree.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOkThree.text = text
|
||||
binding.customDialogButtonOkThree.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ok_three.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok_three.text = text
|
||||
custom_dialog_button_ok_three.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok_three.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButtonFour(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||
custom_dialog_button_ok_four.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOkFour.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOkFour.text = text
|
||||
binding.customDialogButtonOkFour.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ok_four.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok_four.text = text
|
||||
custom_dialog_button_ok_four.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok_four.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButtonAdd(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||
custom_dialog_button_add.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonAdd.visibility = View.VISIBLE
|
||||
binding.customDialogButtonAdd.text = text
|
||||
binding.customDialogButtonAdd.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_add.visibility = View.VISIBLE
|
||||
custom_dialog_button_add.text = text
|
||||
custom_dialog_button_add.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_add.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonKo.text = text
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setCustomDialogValue(visibility:Int){
|
||||
binding.customDialogValue.visibility=visibility
|
||||
}
|
||||
}
|
|
@ -4,45 +4,72 @@ import android.app.Dialog
|
|||
import android.content.Context
|
||||
import android.view.View
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_two_dialog.*
|
||||
import es.verdnatura.databinding.ComponentCustomTwoDialogBinding
|
||||
//import kotlinx.android.synthetic.main.component_custom_two_dialog.*
|
||||
|
||||
class CustomDialogTwoButtons (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
private var binding: ComponentCustomTwoDialogBinding= ComponentCustomTwoDialogBinding.inflate(layoutInflater)
|
||||
|
||||
init {
|
||||
setContentView(R.layout.component_custom_two_dialog)
|
||||
|
||||
setContentView(binding.root)
|
||||
//setContentView(R.layout.component_custom_two_dialog)
|
||||
}
|
||||
|
||||
|
||||
fun setTitle(title: String): CustomDialogTwoButtons {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
|
||||
binding.customDialogTitle.visibility= View.VISIBLE
|
||||
binding.customDialogTitle.text=title
|
||||
|
||||
/* custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setDescription(description: String): CustomDialogTwoButtons {
|
||||
custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description
|
||||
|
||||
binding.customDialogDescription.visibility= View.VISIBLE
|
||||
binding.customDialogDescription.text=description
|
||||
/* custom_dialog_description.visibility = View.VISIBLE
|
||||
custom_dialog_description.text = description*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogTwoButtons {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOk.text =text
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/*custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOkButtonTwo(text: String, onButtonClicked: () -> Unit): CustomDialogTwoButtons {
|
||||
custom_dialog_button_ok_two.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOkTwo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOkTwo.text = text
|
||||
binding.customDialogButtonOkTwo.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ok_two.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok_two.text = text
|
||||
custom_dialog_button_ok_two.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok_two.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogTwoButtons {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonKo.text =text
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/*custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -5,101 +5,150 @@ import android.content.Context
|
|||
import android.view.View
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import kotlinx.android.synthetic.main.component_custom_ubicador_dialog.*
|
||||
import es.verdnatura.databinding.ComponentCustomUbicadorDialogBinding
|
||||
|
||||
//import kotlinx.android.synthetic.main.component_custom_ubicador_dialog.*
|
||||
|
||||
class CustomDialogUbicador (context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
private var binding: ComponentCustomUbicadorDialogBinding = ComponentCustomUbicadorDialogBinding.inflate(layoutInflater)
|
||||
|
||||
init {
|
||||
setContentView(R.layout.component_custom_ubicador_dialog)
|
||||
|
||||
setContentView(binding.root)
|
||||
//setContentView(R.layout.component_custom_ubicador_dialog)
|
||||
}
|
||||
|
||||
|
||||
fun setTitle(title: String): CustomDialogUbicador {
|
||||
custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title
|
||||
binding.customDialogTitle.visibility= View.VISIBLE
|
||||
binding.customDialogTitle.text=title
|
||||
/*custom_dialog_title.visibility = View.VISIBLE
|
||||
custom_dialog_title.text = title*/
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
fun setItemValue(value : String) : CustomDialogUbicador{
|
||||
custom_dialog_item.setText(value)
|
||||
custom_dialog_item.visibility = View.VISIBLE
|
||||
binding.customDialogItem.setText(value)
|
||||
binding.customDialogItem.visibility=View.VISIBLE
|
||||
|
||||
/*custom_dialog_item.setText(value)
|
||||
custom_dialog_item.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun getItemValue() : String{
|
||||
return custom_dialog_item.text.toString()
|
||||
|
||||
return binding.customDialogItem.text.toString()
|
||||
|
||||
// return custom_dialog_item.text.toString()
|
||||
}
|
||||
|
||||
fun getEditItem() : TextInputEditText {
|
||||
return custom_dialog_item
|
||||
|
||||
return binding.customDialogItem
|
||||
//return custom_dialog_item
|
||||
}
|
||||
|
||||
|
||||
fun setEtiquetaValue(value : String) : CustomDialogUbicador{
|
||||
custom_dialog_etiquetas.setText(value)
|
||||
custom_dialog_etiquetas.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogEtiquetas.setText(value)
|
||||
binding.customDialogEtiquetas.visibility = View.VISIBLE
|
||||
/* custom_dialog_etiquetas.setText(value)
|
||||
custom_dialog_etiquetas.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun getEtiquetaValue() : String{
|
||||
return custom_dialog_etiquetas.text.toString()
|
||||
return binding.customDialogEtiquetas.text.toString()
|
||||
//return custom_dialog_etiquetas.text.toString()
|
||||
}
|
||||
|
||||
fun getEtiquetaItem() : TextInputEditText {
|
||||
return custom_dialog_etiquetas
|
||||
|
||||
return binding.customDialogEtiquetas
|
||||
//return custom_dialog_etiquetas
|
||||
}
|
||||
|
||||
|
||||
fun setPackingValue(value : String) : CustomDialogUbicador{
|
||||
custom_dialog_packing.setText(value)
|
||||
custom_dialog_packing.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogPacking.setText(value)
|
||||
binding.customDialogPacking.visibility = View.VISIBLE
|
||||
|
||||
/* custom_dialog_packing.setText(value)
|
||||
custom_dialog_packing.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setGroupingValue(value:String):CustomDialogUbicador{
|
||||
custom_dialog_grouping.setText(value)
|
||||
custom_dialog_grouping.visibility = View.VISIBLE
|
||||
binding.customDialogGrouping.setText(value)
|
||||
binding.customDialogGrouping.visibility = View.VISIBLE
|
||||
/*custom_dialog_grouping.setText(value)
|
||||
custom_dialog_grouping.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
fun getGroupingValue() : String{
|
||||
return custom_dialog_grouping.text.toString()
|
||||
return binding.customDialogGrouping.text.toString()
|
||||
//return custom_dialog_grouping.text.toString()
|
||||
}
|
||||
|
||||
fun getPackingValue() : String{
|
||||
return custom_dialog_packing.text.toString()
|
||||
return binding.customDialogPacking.text.toString()
|
||||
// return custom_dialog_packing.text.toString()
|
||||
}
|
||||
|
||||
fun getPackingItem() : TextInputEditText {
|
||||
return custom_dialog_packing
|
||||
return binding.customDialogPacking
|
||||
//return custom_dialog_packing
|
||||
}
|
||||
|
||||
fun setVisibleValue(value : String) : CustomDialogUbicador{
|
||||
custom_dialog_visible.setText(value)
|
||||
custom_dialog_visible.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogVisible.setText(value)
|
||||
binding.customDialogVisible.visibility = View.VISIBLE
|
||||
|
||||
/* custom_dialog_visible.setText(value)
|
||||
custom_dialog_visible.visibility = View.VISIBLE*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun getVisibleValue() : String{
|
||||
return custom_dialog_visible.text.toString()
|
||||
|
||||
return binding.customDialogVisible.text.toString()
|
||||
//return custom_dialog_visible.text.toString()
|
||||
}
|
||||
|
||||
fun getVisibleItem() : TextInputEditText {
|
||||
return custom_dialog_visible
|
||||
return binding.customDialogVisible
|
||||
|
||||
//return custom_dialog_visible
|
||||
}
|
||||
|
||||
|
||||
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialogUbicador {
|
||||
custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonOk.visibility = View.VISIBLE
|
||||
binding.customDialogButtonOk.text = text
|
||||
binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ok.visibility = View.VISIBLE
|
||||
custom_dialog_button_ok.text = text
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialogUbicador {
|
||||
custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
|
||||
binding.customDialogButtonKo.visibility = View.VISIBLE
|
||||
binding.customDialogButtonKo.text = text
|
||||
binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }
|
||||
|
||||
/* custom_dialog_button_ko.visibility = View.VISIBLE
|
||||
custom_dialog_button_ko.text = text
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
|
||||
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }*/
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package es.verdnatura.presentation.view.feature.ajustes.fragment
|
||||
|
||||
//import android.preference.PreferenceManager
|
||||
//import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
|
@ -7,12 +10,10 @@ import android.content.Context
|
|||
import android.content.Context.CLIPBOARD_SERVICE
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
//import android.preference.PreferenceManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import android.provider.Settings
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentAjustesBinding
|
||||
|
@ -26,11 +27,9 @@ import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
|||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_ajustes.*
|
||||
import kotlinx.android.synthetic.main.fragment_ajustes.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_login.*
|
||||
import timber.log.Timber
|
||||
import kotlinx.android.synthetic.main.activity_main.view.*
|
||||
|
||||
//import kotlinx.android.synthetic.main.fragment_login.*
|
||||
|
||||
class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(AjustesViewModel::class) {
|
||||
|
||||
|
@ -51,34 +50,56 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
}
|
||||
override fun getLayoutId(): Int = R.layout.fragment_ajustes
|
||||
|
||||
|
||||
|
||||
|
||||
/* override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
// binding=FragmentAjustesBinding.inflate(inflater,container,false)
|
||||
//val view=binding.root
|
||||
//return view
|
||||
return super.onCreateView(inflater, container, savedInstanceState)
|
||||
}*/
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
prefs = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
customDialog = CustomDialog(requireContext())
|
||||
// binding = DataBindingUtil.setContentView(requireActivity(), R.layout.activity_main)
|
||||
|
||||
|
||||
//modificat el InitilializeAjusts
|
||||
viewModel.inititializeDefaultAjusts(prefs!!.getString(SECTORDESCRIP,getString(R.string.Sinsector)).toString(),prefs!!.getInt(SECTORFK,0),prefs!!.getInt(WAREHOUSEFK,0),prefs!!.getString(VOZ,"NO").toString(),prefs!!.getInt(WAGON,2).toString(),prefs!!.getString(TAGSTYPE,"Stickers").toString())
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
requireActivity().main_bottom_navigation.visibility = View.VISIBLE
|
||||
user_text.setText(prefs!!.getString(USERFK,""))
|
||||
//ActivityMainBinding.bind(main_bottom_navigation).mainBottomNavigation.visibility=View.VISIBLE
|
||||
(activity as MainActivity).hideBottomNavigation(View.VISIBLE)
|
||||
//requireActivity().main_bottom_navigation.visibility = View.VISIBLE
|
||||
binding.userText.setText(prefs!!.getString(USERFK,""))
|
||||
//user_text.setText(prefs!!.getString(USERFK,""))
|
||||
val versionName = requireActivity().packageManager.getPackageInfo(requireActivity().packageName,0).versionName!!
|
||||
item_version.setText(versionName)
|
||||
binding.itemVersion.setText(versionName)
|
||||
//item_version.setText(versionName)
|
||||
user = prefs!!.getString(USER,"")
|
||||
userFk =prefs!!.getString(USERFK,"")
|
||||
password = prefs!!.getString(PASSWORD,"")
|
||||
androidid_text.setText(Settings.Secure.getString(context?.contentResolver, Settings.Secure.ANDROID_ID))
|
||||
binding.androididText.setText(Settings.Secure.getString(context?.contentResolver, Settings.Secure.ANDROID_ID))
|
||||
//androidid_text.setText(Settings.Secure.getString(context?.contentResolver, Settings.Secure.ANDROID_ID))
|
||||
|
||||
|
||||
txtserver.setText(this.getDefaults("base_url",this.requireContext()))
|
||||
txtserver.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
|
||||
binding.txtserver.setText(this.getDefaults("base_url",this.requireContext()))
|
||||
//txtserver.setText(this.getDefaults("base_url",this.requireContext()))
|
||||
binding.txtserver.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
|
||||
//binding.txtserver.setOnKeyListener((View.OnKeyListener { v, keyCode, event ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) {
|
||||
this.setDefaults("base_url",txtserver.text.toString(),this.requireContext())
|
||||
//this.setDefaults("base_url",txtserver.text.toString(),this.requireContext())
|
||||
this.setDefaults("base_url",binding.txtserver.toString(),this.requireContext())
|
||||
// sergio: se comenta línea de abajo porque da fallo en la app//
|
||||
// this.setDefaults("base_url", edittext_server.text.toString(), this.requireContext())
|
||||
this.hideKeyboard()
|
||||
|
@ -99,8 +120,11 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
}
|
||||
|
||||
fun setEvents() {
|
||||
androidid_text.setOnClickListener { copyanddrag(androidid_text.text.toString()) }
|
||||
androidid_text.setOnLongClickListener { copyanddrag(androidid_text.text.toString()) }
|
||||
binding.androididText.setOnClickListener{copyanddrag(binding.androididText.text.toString()) }
|
||||
binding.androididText.setOnLongClickListener{copyanddrag(binding.androididText.text.toString()) }
|
||||
|
||||
/*androidid_text.setOnClickListener { copyanddrag(androidid_text.text.toString()) }
|
||||
androidid_text.setOnLongClickListener { copyanddrag(androidid_text.text.toString()) }*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,7 +133,8 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
ajustesAdapter = AjustesAdapter(ajustesitem,object: OnAjustesItemClickListener{
|
||||
override fun onAjustesItemClickListener(item: AjustesItemVO) {
|
||||
if (item.id == 0){
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
//splash_progress.visibility = View.VISIBLE
|
||||
viewModel.getSectors(user!!,password!!)
|
||||
} else if (item.id == 5){
|
||||
requireActivity().onBackPressed()
|
||||
|
@ -150,12 +175,15 @@ class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(Aj
|
|||
}
|
||||
}
|
||||
})
|
||||
ajustess_items.adapter = ajustesAdapter
|
||||
ajustess_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.ajustessItems.adapter=ajustesAdapter
|
||||
binding.ajustessItems.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
//austess_items.adapter = ajustesAdapter
|
||||
//ajustess_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
loadSectorList.observe(viewLifecycleOwner, { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
splash_progress.visibility = View.INVISIBLE
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
//splash_progress.visibility = View.INVISIBLE
|
||||
if (it.list.isNotEmpty() && it.list.get(0).isError){
|
||||
customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage).setOkButton(getString(R.string.Close)){
|
||||
customDialog.dismiss()
|
||||
|
|
|
@ -35,11 +35,11 @@ import es.verdnatura.presentation.view.feature.imageview.activity.ImageViewActiv
|
|||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.splash_progress
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import timber.log.Timber
|
||||
|
||||
class ItemCardFragment(
|
||||
|
@ -69,18 +69,19 @@ class ItemCardFragment(
|
|||
private lateinit var customDialogList: CustomDialogList
|
||||
private lateinit var customDialogTwo: CustomDialogTwoButtons
|
||||
|
||||
/*private val _buyersList by lazy { MutableLiveData<BuyerListVO>() }
|
||||
val buyersList: LiveData<BuyerListVO>
|
||||
get() = _buyersList*/
|
||||
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_item_card
|
||||
|
||||
override fun init() {
|
||||
itemcard_layout.visibility = View.GONE
|
||||
requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
//binding.itemcardLayout.visibility = View.GONE
|
||||
binding.itemcardLayout.visibility=View.GONE
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
|
||||
setEvents()
|
||||
toolbar_title.text = getString(R.string.ConsultarArticulo)
|
||||
//toolbar_title.text = getString(R.string.ConsultarArticulo)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.ConsultarArticulo)
|
||||
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
|
@ -95,7 +96,7 @@ class ItemCardFragment(
|
|||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private fun setToolBar(){
|
||||
|
@ -104,10 +105,13 @@ class ItemCardFragment(
|
|||
val iconHistory : Drawable = resources.getDrawable(R.drawable.ic_history_black_24dp,resources.newTheme())
|
||||
listIcons.add(iconReload)
|
||||
listIcons.add(iconHistory)
|
||||
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
//toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
// binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
getItemCard(itemFk)
|
||||
}
|
||||
if (item == iconHistory){
|
||||
|
@ -124,28 +128,35 @@ class ItemCardFragment(
|
|||
}
|
||||
|
||||
})
|
||||
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
//toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
edit_itemFk.requestFocus()
|
||||
edit_itemFk.setOnEditorActionListener { v, actionId, event ->
|
||||
//edit_itemFk.requestFocus()
|
||||
binding.editItemFk.requestFocus()
|
||||
//edit_itemFk.setOnEditorActionListener { v, actionId, event ->
|
||||
binding.editItemFk.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!edit_itemFk.text.toString().isNullOrEmpty())
|
||||
getItemCard(edit_itemFk.text.toString())
|
||||
edit_itemFk.setText("")
|
||||
(activity as MainActivity).hideKeyboard(edit_itemFk)
|
||||
//if (!edit_itemFk.text.toString().isNullOrEmpty())
|
||||
if (!binding.editItemFk.text.toString().isNullOrEmpty())
|
||||
getItemCard(binding.editItemFk.text.toString())
|
||||
binding.editItemFk.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.editItemFk)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
backButton.setOnClickListener {
|
||||
//backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
itemcard_image.setOnClickListener {
|
||||
//itemcard_image.setOnClickListener {
|
||||
binding.itemcardImage.setOnClickListener{
|
||||
|
||||
val i:Intent = Intent(activity,ImageViewActivity::class.java)
|
||||
i.putExtra("url",urlLarge)
|
||||
i.putExtra("title",titleImage)
|
||||
|
@ -159,7 +170,7 @@ class ItemCardFragment(
|
|||
password = prefs.getString(PASSWORD,"").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
this.itemFk = itemFk
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getItemCard(itemFk,warehouseFk,user,password,"item_card")
|
||||
viewModel.getItemPackingType(user,password,"get_ItemPackingType")
|
||||
}
|
||||
|
@ -167,20 +178,20 @@ class ItemCardFragment(
|
|||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
itemcard.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
itemcard_layout.visibility = View.GONE
|
||||
toolbar_title.text = "ItemCard"
|
||||
binding.itemcardLayout.visibility = View.GONE
|
||||
binding.mainToolbar.toolbarTitle.text = "ItemCard"
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}else{
|
||||
if (it.id != "0"){
|
||||
itemcard_layout.visibility = View.VISIBLE
|
||||
binding.itemcardLayout.visibility = View.VISIBLE
|
||||
setItemCard(it)
|
||||
}else{
|
||||
itemcard_layout.visibility = View.GONE
|
||||
toolbar_title.text = "ItemCard"
|
||||
binding.itemcardLayout.visibility = View.GONE
|
||||
binding.mainToolbar.toolbarTitle.text = "ItemCard"
|
||||
customDialog.setTitle("Sin resultados").setDescription("No hemos podido encontrar el articulo. Revisa el sector.").setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
@ -190,14 +201,14 @@ class ItemCardFragment(
|
|||
})
|
||||
|
||||
itemspackinglist.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
// //Log.i("VERDNATURA:","el code es $it.code")
|
||||
// //Log.i("VERDNATURA:","la descrip es $it.description")
|
||||
createItemTypeTypeList(it.list)
|
||||
})
|
||||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
|
@ -226,15 +237,15 @@ class ItemCardFragment(
|
|||
|
||||
private fun setItemCard(itemInfo:ItemCardVO){
|
||||
itemInfoG = itemInfo
|
||||
toolbar_title.text = itemInfo.id+"-"+itemInfo.longName
|
||||
binding.mainToolbar.toolbarTitle.text = itemInfo.id+"-"+itemInfo.longName
|
||||
titleImage = itemInfo.id+"-"+itemInfo.longName
|
||||
itemcard_image.setImageDrawable(resources.getDrawable(R.drawable.loadphoto,resources.newTheme()))
|
||||
itemcard_image.loadUrl(itemInfo.urlImage200)
|
||||
// binding.itemcardImage.setImageDrawable(resources.getDrawable(R.drawable.loadphoto,resources.newTheme()))
|
||||
binding.itemcardImage.loadUrl(itemInfo.urlImage200)
|
||||
urlLarge = itemInfo.urlImage
|
||||
itemcard_tag1.text = itemInfo.size
|
||||
itemcard_tag2.text = itemInfo.value5
|
||||
itemcard_tag3.text = itemInfo.value6
|
||||
itemcard_tag4.text = itemInfo.value7 + " " + itemInfo.origin
|
||||
binding.itemcardTag1.text = itemInfo.size
|
||||
binding.itemcardTag2.text = itemInfo.value5
|
||||
binding.itemcardTag3.text = itemInfo.value6
|
||||
binding.itemcardTag4.text = itemInfo.value7 + " " + itemInfo.origin
|
||||
listItemsRow = ArrayList()
|
||||
listItemsRow.add(ItemCardRowVO(title = getString(R.string.total),value = itemInfo.total,isEditable = false))
|
||||
listItemsRow.add(ItemCardRowVO(title = getString(R.string.Disponible),value = itemInfo.available,isEditable = false))
|
||||
|
@ -367,14 +378,15 @@ class ItemCardFragment(
|
|||
}
|
||||
}
|
||||
})
|
||||
itemcard_recyclerview.adapter = adapter
|
||||
itemcard_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
scroll_view.post({
|
||||
//itemcard_recyclerview.adapter = adapter
|
||||
binding.itemcardRecyclerview.adapter = adapter
|
||||
//itemcard_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.itemcardRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.scrollView.post({
|
||||
val position = IntArray(2)
|
||||
if (itemcard_image != null){
|
||||
itemcard_image.getLocationInWindow(position)
|
||||
scroll_view.scrollTo(0, position[1])
|
||||
if (binding.itemcardImage != null){
|
||||
binding.itemcardImage.getLocationInWindow(position)
|
||||
binding.scrollView.scrollTo(0, position[1])
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -389,7 +401,7 @@ class ItemCardFragment(
|
|||
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item,value)
|
||||
"itemPlacementSave" -> viewModel.itemPlacementSave(itemFk = itemFk, warehouseFk = warehouseFk, user = user, password = password, value = value,"itemPlacementSave")
|
||||
"updateGrouping" -> viewModel.updateGrouping(itemFk = itemFk, user = user, password = password, value = value,warehouseFk = warehouseFk,"buy_updateGrouping")
|
||||
"updatePacking" -> viewModel.updatePacking(itemFk = itemFk, user = user, password = password, value = value,warehouseFk = warehouseFk,"buy_updateGrouping")
|
||||
"updatePacking" -> viewModel.updatePacking(itemFk = itemFk, user = user, password = password, value = value,warehouseFk = warehouseFk,"buy_updatePacking")
|
||||
"itemSaveMin" -> viewModel.itemSaveMin(itemFk = itemFk, user = user, password = password, value = value,"itemSaveMin")
|
||||
"item_saveReference"->viewModel.item_saveReference(itemFk = itemFk, user = user, password = password, value = value,"item_saveReference")
|
||||
|
||||
|
@ -403,12 +415,12 @@ class ItemCardFragment(
|
|||
//sergio: changeOffLineValue solo hace visible el progress
|
||||
|
||||
private fun showProgress(){
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
/* private fun changeOfflineValue(item:ItemCardRowVO,newValue:String, barcodes:List<BarcodeVO>){
|
||||
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
//sergio: esta parte ya estaba comentada
|
||||
/*var i = 0
|
||||
|
@ -449,7 +461,7 @@ class ItemCardFragment(
|
|||
viewModel.itemStockUpdate(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "0")
|
||||
}
|
||||
}catch (e:Exception){
|
||||
itemcard_layout.visibility = View.GONE
|
||||
binding.itemcardLayout.visibility = View.GONE
|
||||
customDialog.setTitle("Error").setDescription("El elemento introducido no es un número").setKoButton("Cancelar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
@ -483,7 +495,7 @@ class ItemCardFragment(
|
|||
viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = (value.toInt() * -1).toString(),isTrash = "0","itemTrash")
|
||||
}
|
||||
}catch (e:Exception){
|
||||
itemcard_layout.visibility = View.GONE
|
||||
binding.itemcardLayout.visibility = View.GONE
|
||||
customDialog.setTitle("Error").setDescription("El elemento introducido no es un número").setKoButton("Cancelar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
@ -564,7 +576,7 @@ class ItemCardFragment(
|
|||
}
|
||||
|
||||
private fun updateItemPackingType(itemPackingType:String) {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.updatePackingType(this.itemFk,user,password,itemPackingType,"item_updatePackingType")
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.buffer.fragment
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
|
@ -14,9 +13,9 @@ import es.verdnatura.presentation.base.BaseFragment
|
|||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
//import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
//import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
class BufferFragment(
|
||||
var entryPoint: String = ""
|
||||
|
@ -28,7 +27,6 @@ class BufferFragment(
|
|||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_buffer
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var type = ""
|
||||
|
@ -37,20 +35,11 @@ class BufferFragment(
|
|||
fun newInstance(entryPoint: String) = BufferFragment(entryPoint)
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
if (context is OnCollectionSelectedListener) onCollectionSelectedListener = context
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
|
||||
// Log.i("VERDNATURA:", "entrypoint es : ${entryPoint}")
|
||||
|
||||
splash_progress.visibility = View.GONE
|
||||
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog = CustomDialog(requireContext())
|
||||
//toolbar_title.text = getString(R.string.verticket)
|
||||
setToolbar()
|
||||
setEvents()
|
||||
super.init()
|
||||
|
@ -58,7 +47,7 @@ class BufferFragment(
|
|||
|
||||
private fun setToolbar() {
|
||||
|
||||
toolbar_title.text = entryPoint
|
||||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
|
@ -78,33 +67,33 @@ class BufferFragment(
|
|||
|
||||
private fun setEvents() {
|
||||
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
scan_input.requestFocus()
|
||||
scan_input.setOnEditorActionListener { _, actionId, _ ->
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
goBack = false
|
||||
if (!scan_input.text.isNullOrEmpty()) {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
if (! binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
if (entryPoint.equals("Vaciado buffer")){
|
||||
viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"UNLOADING","buffer_setTypeByName")
|
||||
viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"UNLOADING","buffer_setTypeByName")
|
||||
}
|
||||
if (entryPoint.equals("Llenado buffer")){
|
||||
viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"LOADING","buffer_setTypeByName")
|
||||
viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"LOADING","buffer_setTypeByName")
|
||||
}
|
||||
if (entryPoint.equals("Acumulación buffer")){
|
||||
viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"ACCUMULATION","buffer_setTypeByName")
|
||||
viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"ACCUMULATION","buffer_setTypeByName")
|
||||
}
|
||||
if (entryPoint.equals("Desactivado buffer")){
|
||||
viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"DISABLED","buffer_setTypeByName")
|
||||
viewModel.buffer_setTypeByName(user,password, binding.scanInput.text.toString(),"DISABLED","buffer_setTypeByName")
|
||||
}
|
||||
|
||||
}
|
||||
scan_input.setText("")
|
||||
(activity as MainActivity).hideKeyboard(scan_input)
|
||||
binding.scanInput.setText("")
|
||||
(activity as MainActivity).hideKeyboard( binding.scanInput)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
|
@ -115,7 +104,7 @@ class BufferFragment(
|
|||
|
||||
with(viewModel) {
|
||||
itembuffertype.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Aceptar") {
|
||||
|
@ -127,7 +116,7 @@ class BufferFragment(
|
|||
customDialog.setTitle("Mensaje").setDescription("Operación "+entryPoint.lowercase() + " realizada correctamente")
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
backButton.performClick()
|
||||
binding.mainToolbar.backButton.performClick()
|
||||
}.show()
|
||||
|
||||
}
|
||||
|
|
|
@ -23,9 +23,9 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() {
|
|||
get() = _itembuffertype
|
||||
|
||||
|
||||
private val _bufferresponse by lazy { MutableLiveData<Boolean>() }
|
||||
/*private val _bufferresponse by lazy { MutableLiveData<Boolean>() }
|
||||
val bufferresponse: LiveData<Boolean>
|
||||
get() = _bufferresponse
|
||||
get() = _bufferresponse*/
|
||||
|
||||
private val _bufferloadresponse by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val bufferloadresponse: LiveData<ResponseItemVO>
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
package es.verdnatura.presentation.view.feature.buffer.fragment
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View.*
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentBufferBinding
|
||||
import es.verdnatura.databinding.FragmentBufferLoadBinding
|
||||
import es.verdnatura.databinding.FragmentSacadorAssociatesmarttagBinding
|
||||
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -25,20 +20,10 @@ import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
|||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.smarttag.adapter.SmartTagAdapter
|
||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.scan_input
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_expedition_scan.*
|
||||
import kotlinx.android.synthetic.main.fragment_login.*
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
class BufferLoadFragment(
|
||||
var entryPoint: String = ""
|
||||
) : BaseFragment<FragmentBufferLoadBinding, BufferFragmentViewModel>(
|
||||
) : BaseFragment<FragmentBufferLoadexpeditionBinding, BufferFragmentViewModel>(
|
||||
BufferFragmentViewModel::class
|
||||
) {
|
||||
|
||||
|
@ -49,7 +34,7 @@ class BufferLoadFragment(
|
|||
private var sectorFk = ""
|
||||
private var warehouseFk = ""
|
||||
private var goBack: Boolean = false
|
||||
override fun getLayoutId(): Int = R.layout.fragment_sacador_associatesmarttag
|
||||
override fun getLayoutId(): Int = R.layout.fragment_buffer_loadexpedition
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private lateinit var customDialogList: CustomDialogList
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
|
@ -64,27 +49,7 @@ class BufferLoadFragment(
|
|||
companion object {
|
||||
fun newInstance(entryPoint: String) = BufferLoadFragment(entryPoint)
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
// sergio: en test: Log.i("VERDNATURA:","attached")
|
||||
val callback: OnBackPressedCallback =
|
||||
object : OnBackPressedCallback(true)
|
||||
{
|
||||
override fun handleOnBackPressed() {
|
||||
// Leave empty do disable back press or
|
||||
// write your code which you want
|
||||
// Log.i("VERDNATURA:","PULSADO")
|
||||
|
||||
}
|
||||
}
|
||||
requireActivity().onBackPressedDispatcher.addCallback(
|
||||
this,
|
||||
callback
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
|
@ -93,8 +58,8 @@ class BufferLoadFragment(
|
|||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
goBack = false
|
||||
requireActivity().main_bottom_navigation.visibility = GONE
|
||||
splash_progress.visibility = GONE
|
||||
(activity as MainActivity).hideBottomNavigation(GONE)
|
||||
binding.splashProgress.visibility = GONE
|
||||
mperror = MediaPlayer.create((activity as MainActivity),R.raw.error)
|
||||
mpok= MediaPlayer.create((activity as MainActivity),R.raw.ok)
|
||||
|
||||
|
@ -112,24 +77,21 @@ class BufferLoadFragment(
|
|||
|
||||
private fun setToolBar() {
|
||||
|
||||
toolbar_title.text = entryPoint
|
||||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun checkLoadExpedition(ExpeditionOrBuffer: String) {
|
||||
|
||||
|
||||
// if (listTags.isNullOrEmpty()){
|
||||
listTags.add(SmartTag(ExpeditionOrBuffer, getTextScaned(listTags.size + 1) + ExpeditionOrBuffer))
|
||||
customDialogList.setTitle(getTextToPosition(listTags.size + 1))
|
||||
listTags.add(SmartTag(ExpeditionOrBuffer, getTextScaned(listTags.size + 1) + ExpeditionOrBuffer))
|
||||
customDialogList.setTitle(getTextToPosition(listTags.size + 1))
|
||||
|
||||
tagsAdapter!!.notifyDataSetChanged()
|
||||
|
||||
// }
|
||||
|
||||
if (listTags.size==2) {
|
||||
splash_progress.visibility = VISIBLE
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.expeditionLoading_add(
|
||||
usuario = user,
|
||||
password=password,
|
||||
|
@ -143,20 +105,6 @@ class BufferLoadFragment(
|
|||
}
|
||||
|
||||
|
||||
private fun scanRequest() {
|
||||
if (scan_input != null) {
|
||||
scan_input.requestFocus()
|
||||
}
|
||||
hideKeyboards()
|
||||
}
|
||||
|
||||
private fun hideKeyboards() {
|
||||
try {
|
||||
requireActivity().hideKeyboard()
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
user = prefs.getString(USER, "").toString()
|
||||
|
@ -170,10 +118,9 @@ class BufferLoadFragment(
|
|||
}
|
||||
|
||||
|
||||
|
||||
private fun setEvents() {
|
||||
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
|
@ -184,7 +131,7 @@ class BufferLoadFragment(
|
|||
|
||||
|
||||
with(viewModel) {
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
bufferloadresponse.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
@ -219,7 +166,7 @@ class BufferLoadFragment(
|
|||
customDialogList.setValue("")*/
|
||||
|
||||
}
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.buscaritem.fragment
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -14,9 +15,7 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
|||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.adapter.LocationAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_buscar_item.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
|
||||
class BuscarItemFragment(
|
||||
var itemFk:String = ""
|
||||
|
@ -40,8 +39,9 @@ class BuscarItemFragment(
|
|||
override fun getLayoutId(): Int = R.layout.fragment_buscar_item
|
||||
|
||||
override fun init() {
|
||||
requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
toolbar_title.text = getString(R.string.getubicaition)
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getubicaition)
|
||||
customDialog = CustomDialog(requireContext())
|
||||
setEvents()
|
||||
if (!itemFk.isNullOrEmpty()){
|
||||
|
@ -52,20 +52,20 @@ class BuscarItemFragment(
|
|||
|
||||
|
||||
private fun setEvents(){
|
||||
edit_itemFk.requestFocus()
|
||||
edit_itemFk.setOnEditorActionListener { v, actionId, event ->
|
||||
binding.editItemFk.requestFocus()
|
||||
binding.editItemFk.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!edit_itemFk.text.toString().isNullOrEmpty())
|
||||
getLocations(edit_itemFk.text.toString())
|
||||
edit_itemFk.setText("")
|
||||
(activity as MainActivity).hideKeyboard(edit_itemFk)
|
||||
if (!binding.editItemFk.text.toString().isNullOrEmpty())
|
||||
getLocations(binding.editItemFk.text.toString())
|
||||
binding.editItemFk.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.editItemFk)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ class BuscarItemFragment(
|
|||
password = prefs.getString(PASSWORD,"").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
|
||||
this.itemFk = itemFk
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getLocations(user,password,itemFk,"getItemUbication")
|
||||
}
|
||||
|
||||
|
@ -86,18 +86,18 @@ class BuscarItemFragment(
|
|||
loadLocationList.observe(viewLifecycleOwner, Observer { event ->
|
||||
|
||||
event.getContentIfNotHandled().notNull {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
adapter = LocationAdapter(it.list,pasillerosItemClickListener!!)
|
||||
|
||||
location_recyclerview.adapter = adapter
|
||||
location_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.locationRecyclerview.adapter = adapter
|
||||
binding.locationRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
var totalVisible:Int = 0
|
||||
it.list.forEach {
|
||||
if (!it.visible.isNullOrEmpty())
|
||||
totalVisible += it.visible.toInt()
|
||||
}
|
||||
toolbar_title.text = "Item: "+itemFk+ " Total visible: "+totalVisible
|
||||
binding.mainToolbar.toolbarTitle.text = "Item: "+itemFk+ " Total visible: "+totalVisible
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,22 +9,22 @@ 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 es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
/*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.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(BuyersViewModel::class) {
|
||||
|
||||
|
@ -48,6 +48,8 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
super.onAttach(context)
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER,0)
|
||||
user = prefs.getString(USER,"").toString()
|
||||
|
@ -60,9 +62,11 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
toolbar_title.text = getString(R.string.quality)
|
||||
//requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.quality)
|
||||
|
||||
setToolBar()
|
||||
setEvents()
|
||||
super.init()
|
||||
|
@ -72,20 +76,20 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
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 {
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility= View.VISIBLE
|
||||
viewModel.itemShelvingBuyerGet(user = user,password = password,"itemShelving_BuyerGet")
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +97,7 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
buyersList.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createBuyerList(it.list)
|
||||
})
|
||||
}
|
||||
|
@ -120,8 +124,8 @@ class BuyersFragment : BaseFragment<BuyersFragmentBinding,BuyersViewModel>(Buyer
|
|||
onBuyerSelectedListener?.onBuyerSelected(item.id.toString())
|
||||
}
|
||||
})
|
||||
buyers_items.adapter = buyersAdapter
|
||||
buyers_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.buyersItems.adapter = buyersAdapter
|
||||
binding.buyersItems.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
}
|
||||
|
||||
}
|
|
@ -3,10 +3,7 @@ package es.verdnatura.presentation.view.feature.controlador.fragment
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
|
@ -17,9 +14,12 @@ import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
|||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
|
||||
/*
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
*/
|
||||
|
||||
class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorViewModel>(ControladorViewModel::class) {
|
||||
|
||||
|
@ -44,11 +44,12 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
|
||||
override fun init() {
|
||||
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog = CustomDialog(requireContext())
|
||||
toolbar_title.text = getString(R.string.controlticket)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
|
||||
setEvents()
|
||||
requireActivity().main_bottom_navigation.visibility = View.VISIBLE
|
||||
//requireActivity().main_bottom_navigation.visibility = View.VISIBLE
|
||||
(activity as MainActivity).hideBottomNavigation(View.VISIBLE)
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -72,28 +73,28 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
|
||||
private fun setEvents(){
|
||||
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
scan_input.requestFocus()
|
||||
scan_input.setOnEditorActionListener { v, actionId, event ->
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
goBack=false
|
||||
if (!scan_input.text.isNullOrEmpty()) {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
usuario = user,
|
||||
password = password,
|
||||
sectorFk = sectorFk,
|
||||
collectionFk = scan_input.text.toString(),
|
||||
collectionFk = binding.scanInput.text.toString(),
|
||||
type = type
|
||||
,callFunction = "collection_getTickets")
|
||||
// viewModel.ticket_checkControlled(user,password,scan_input.text.toString())
|
||||
}
|
||||
scan_input.setText("")
|
||||
(activity as MainActivity).hideKeyboard(scan_input)
|
||||
binding.scanInput.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.scanInput)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
|
@ -103,7 +104,7 @@ class ControladorFragment : BaseFragment<FragmentControladorBinding,ControladorV
|
|||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError){
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
|
||||
customDialog.dismiss()
|
||||
|
|
|
@ -1,33 +1,26 @@
|
|||
package es.verdnatura.presentation.view.feature.controlador.fragment
|
||||
|
||||
|
||||
import android.content.Intent
|
||||
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
|
||||
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.webkit.WebChromeClient
|
||||
import android.webkit.WebSettings
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentQrBinding
|
||||
import es.verdnatura.databinding.FragmentWebBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import kotlinx.android.synthetic.main.fragment_web.*
|
||||
import kotlinx.android.synthetic.main.fragment_web.**/
|
||||
|
||||
|
||||
class WebFragment(
|
||||
var entryPoint: String = ""
|
||||
) : BaseFragment<FragmentQrBinding, QrFragmentViewModel>(QrFragmentViewModel::class) {
|
||||
) : BaseFragment<FragmentWebBinding, ControladorViewModel>(ControladorViewModel::class) {
|
||||
|
||||
private var user = ""
|
||||
private var password = ""
|
||||
|
@ -58,12 +51,12 @@ class WebFragment(
|
|||
// webView = WebViewClient()
|
||||
|
||||
|
||||
webView.setWebChromeClient (WebChromeClient())
|
||||
binding.webView.setWebChromeClient (WebChromeClient())
|
||||
// webView.setWebViewClient (wvClient);
|
||||
webView.getSettings (). setJavaScriptEnabled (true)
|
||||
binding.webView.getSettings (). setJavaScriptEnabled (true)
|
||||
// sergio:deprecated
|
||||
//webView.getSettings (). setPluginState (WebSettings.PluginState.ON)
|
||||
val webSettings = webView.settings
|
||||
val webSettings = binding.webView.settings
|
||||
webSettings.javaScriptEnabled = true
|
||||
webSettings.domStorageEnabled = true
|
||||
webSettings.loadWithOverviewMode = true
|
||||
|
@ -74,7 +67,7 @@ class WebFragment(
|
|||
webSettings.defaultTextEncodingName = "utf-8"
|
||||
|
||||
|
||||
webView.loadUrl ("https://salix.verdnatura.es/#!/item/index")
|
||||
binding.webView.loadUrl ("https://salix.verdnatura.es/#!/item/index")
|
||||
|
||||
val openURL = Intent(Intent.ACTION_VIEW)
|
||||
// openURL.data = Uri.parse("https://salix.verdnatura.es/#!/ticket/3271614/tracking/index")
|
||||
|
@ -91,7 +84,7 @@ class WebFragment(
|
|||
|
||||
private fun setToolbar() {
|
||||
|
||||
toolbar_title.text = entryPoint
|
||||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
|
@ -133,11 +126,11 @@ class WebFragment(
|
|||
false
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
qrresponse.observe(viewLifecycleOwner, Observer {
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
//splash_progress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
|
||||
|
@ -152,7 +145,7 @@ class WebFragment(
|
|||
.setDescription("Operación " + itemscaned + ". " + it.response)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
backButton.performClick()
|
||||
binding.mainToolbar.backButton.performClick()
|
||||
}.show()
|
||||
|
||||
}
|
||||
|
@ -162,6 +155,6 @@ class WebFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +1,17 @@
|
|||
package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.View.*
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
|
||||
import es.verdnatura.domain.ConstAndValues
|
||||
import es.verdnatura.domain.ConstAndValues.MAINACTIVITY
|
||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -31,16 +24,14 @@ import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
|||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
/*import kotlinx.android.synthetic.main.component_custom_three_dialog.*
|
||||
import kotlinx.android.synthetic.main.fragment_collection.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.*
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.scan_input
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.binding.scanInput
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_login.*
|
||||
import kotlinx.android.synthetic.main.fragment_sacador.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import java.text.SimpleDateFormat
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
@ -82,7 +73,7 @@ class ControlVehiculoFragment(
|
|||
customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
|
||||
goBack = false
|
||||
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
||||
/* if (getWagons() < 2 && !tagName.equals(SacadorFragment.TAG))
|
||||
{
|
||||
|
@ -109,8 +100,8 @@ class ControlVehiculoFragment(
|
|||
|
||||
private fun setToolBar(direction: String) {
|
||||
|
||||
toolbar_title.text = getString(R.string.vehiclecontrol)
|
||||
toolbar_title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13F)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontrol)
|
||||
binding.mainToolbar.toolbarTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13F)
|
||||
|
||||
val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
val iconHistory: Drawable =
|
||||
|
@ -138,7 +129,7 @@ class ControlVehiculoFragment(
|
|||
}
|
||||
|
||||
|
||||
toolbar_icons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
||||
if (item == iconHistory) {
|
||||
|
@ -154,7 +145,7 @@ class ControlVehiculoFragment(
|
|||
|
||||
}
|
||||
})
|
||||
toolbar_icons.layoutManager =
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
|
@ -200,7 +191,7 @@ class ControlVehiculoFragment(
|
|||
private fun checkControlTimeVehicle() {
|
||||
|
||||
if (!goBack) {
|
||||
splash_progress.visibility = VISIBLE
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.workerMachinery_isRegistered(user, password,"workerMachinery_isRegistered")
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +204,7 @@ class ControlVehiculoFragment(
|
|||
plateNumber
|
||||
)
|
||||
} else if (direction.equals("IN")) {
|
||||
splash_progress.visibility = VISIBLE
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.machineWorker_add(user, password, plateNumber,"machineWorker_add")
|
||||
|
||||
} else if (direction.equals("OUT")) {
|
||||
|
@ -226,8 +217,8 @@ class ControlVehiculoFragment(
|
|||
}
|
||||
|
||||
private fun scanRequest() {
|
||||
if (scan_input != null) {
|
||||
scan_input.requestFocus()
|
||||
if (binding.scanInput != null) {
|
||||
binding.scanInput.requestFocus()
|
||||
}
|
||||
hideKeyboards()
|
||||
}
|
||||
|
@ -251,23 +242,23 @@ class ControlVehiculoFragment(
|
|||
|
||||
private fun setEvents() {
|
||||
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
scan_input.requestFocus()
|
||||
scan_input.setOnEditorActionListener { v, actionId, event ->
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!scan_input.text.isNullOrEmpty()) {
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
|
||||
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
|
||||
showOptionsHistorical(scan_input.text.toString())
|
||||
showOptionsHistorical(binding.scanInput.text.toString())
|
||||
} else {
|
||||
showOptionsVehicleControl(scan_input.text.toString())
|
||||
showOptionsVehicleControl(binding.scanInput.text.toString())
|
||||
}
|
||||
}
|
||||
scan_input.setText("")
|
||||
(activity as MainActivity).hideKeyboard(scan_input)
|
||||
binding.scanInput.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.scanInput)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
|
@ -276,7 +267,7 @@ class ControlVehiculoFragment(
|
|||
|
||||
private fun showOptionsVehicleControl(plate: String) {
|
||||
|
||||
customDialogThreeButtons.custom_dialog_value.visibility = GONE
|
||||
customDialogThreeButtons.setCustomDialogValue(GONE)
|
||||
|
||||
customDialogThreeButtons.setDescription("¿Qué desea hacer con el vehículo de matrícula $plate")
|
||||
.setValue(plate)
|
||||
|
@ -285,7 +276,7 @@ class ControlVehiculoFragment(
|
|||
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
|
||||
"Vuelva a escanear".toast(requireContext())
|
||||
} else {
|
||||
splash_progress.visibility = VISIBLE
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
customDialogThreeButtons.dismiss()
|
||||
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "IN")
|
||||
}
|
||||
|
@ -296,7 +287,7 @@ class ControlVehiculoFragment(
|
|||
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()) {
|
||||
"Vuelva a escanear".toast(requireContext())
|
||||
} else {
|
||||
splash_progress.visibility = VISIBLE
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
customDialogThreeButtons.dismiss()
|
||||
insertControlTimeVehicle(customDialogThreeButtons.getValue(), "OUT")
|
||||
}
|
||||
|
@ -318,7 +309,7 @@ class ControlVehiculoFragment(
|
|||
|
||||
private fun showOptionsHistorical(plate: String) {
|
||||
|
||||
customDialogThreeButtons.custom_dialog_value.visibility = GONE
|
||||
customDialogThreeButtons.setCustomDialogValue(GONE)
|
||||
|
||||
customDialogThreeButtons.setDescription("¿Qué desea hacer con el vehículo de matrícula $plate")
|
||||
.setValue(plate)
|
||||
|
@ -341,7 +332,7 @@ class ControlVehiculoFragment(
|
|||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
responseinsert.observe(viewLifecycleOwner, Observer {
|
||||
Log.i(
|
||||
"VERDNATURA",
|
||||
|
@ -379,11 +370,11 @@ class ControlVehiculoFragment(
|
|||
|
||||
}
|
||||
}
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
})
|
||||
|
||||
responsecontrol.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
// Log.i("VERDNATURA:","${it.response}")
|
||||
if (it.isError) {
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
|
|
|
@ -6,16 +6,19 @@ import android.view.View.*
|
|||
import androidx.lifecycle.Observer
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolBinding
|
||||
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.loadUrl
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import kotlinx.android.synthetic.main.fragment_controlador.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_vehiclecontrol_user.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
/*import kotlinx.android.synthetic.main.fragment_controlador.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_vehiclecontrol_user.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class ControlVehiculoUsuarioFragment(
|
||||
var vUserFK: String = ""
|
||||
) : BaseFragment<FragmentVehiclecontrolBinding, ControlVehiculoViewModel>(
|
||||
) : BaseFragment<FragmentVehiclecontrolUserBinding, ControlVehiculoViewModel>(
|
||||
ControlVehiculoViewModel::class
|
||||
) {
|
||||
|
||||
|
@ -27,7 +30,6 @@ class ControlVehiculoUsuarioFragment(
|
|||
private var token = ""
|
||||
private var goBack: Boolean = false
|
||||
private var android_id: String = ""
|
||||
// private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
override fun getLayoutId(): Int = R.layout.fragment_vehiclecontrol_user
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
||||
|
@ -36,17 +38,12 @@ class ControlVehiculoUsuarioFragment(
|
|||
}
|
||||
|
||||
override fun init() {
|
||||
toolbar_title.text = getString(R.string.vehiclecontroluser)
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontroluser)
|
||||
customDialog = CustomDialog(requireContext())
|
||||
|
||||
goBack = false
|
||||
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
setEvents()
|
||||
setControlVehicleUser()
|
||||
//sergio:se queda pendiente de revisar con javi
|
||||
// setDialog()
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
@ -66,7 +63,7 @@ class ControlVehiculoUsuarioFragment(
|
|||
|
||||
if (userFk.equals(vUserFK)) {
|
||||
|
||||
splash_progress.visibility = VISIBLE
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.machine_getWorkerPlate(user, password,"machine_getWorkerPlate")
|
||||
viewModel.deviceProduction_getnameDevice(user, password, android_id,"deviceProduction_getnameDevice")
|
||||
viewModel.deviceProductionUser_getWorker(user, password, android_id,"deviceProductionUser_getWorker")
|
||||
|
@ -74,17 +71,17 @@ class ControlVehiculoUsuarioFragment(
|
|||
} else {
|
||||
userFk = vUserFK
|
||||
|
||||
user_information.visibility = INVISIBLE
|
||||
name_vehiclecontrol.visibility = INVISIBLE
|
||||
user_image.setOnClickListener({backButton.performClick()})
|
||||
binding.userInformation.visibility = INVISIBLE
|
||||
binding.nameVehiclecontrol.visibility = INVISIBLE
|
||||
binding.userInformation.setOnClickListener({binding.mainToolbar.backButton.performClick()})
|
||||
|
||||
}
|
||||
user_image.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=$token")
|
||||
binding.userImage.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=$token")
|
||||
viewModel.machine_getWorkerPlate(user, password,"machine_getWorkerPlate")
|
||||
name_vehiclecontrol.text = user
|
||||
registered_vehiclecontrol.text = ""
|
||||
deviceName.text = ""
|
||||
assigned_devicename.text = ""
|
||||
binding.nameVehiclecontrol.text = user
|
||||
binding.registeredVehiclecontrol.text = ""
|
||||
binding.deviceName.text = ""
|
||||
binding.assignedDevicename.text = ""
|
||||
|
||||
}
|
||||
|
||||
|
@ -100,7 +97,7 @@ class ControlVehiculoUsuarioFragment(
|
|||
|
||||
private fun setEvents() {
|
||||
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
|
@ -144,11 +141,11 @@ private fun setDialog(){
|
|||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
||||
|
||||
responsemachine.observe(viewLifecycleOwner, Observer {
|
||||
splash_progress.visibility = GONE
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (it.isError) {
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Cerrar") {
|
||||
|
@ -165,13 +162,13 @@ private fun setDialog(){
|
|||
// Log.i("VERDNATURA::", "valor devuelto ${it.response}")
|
||||
|
||||
if (it.type.equals("getnameDevice")) {
|
||||
deviceName.text = it.response
|
||||
binding.deviceName.text = it.response
|
||||
}
|
||||
if (it.type.equals("getWorker")) {
|
||||
assigned_devicename.text = it.response
|
||||
binding.assignedDevicename.text = it.response
|
||||
}
|
||||
if (it.type.equals("getWorkerPlate")) {
|
||||
registered_vehiclecontrol.text = it.response
|
||||
binding.registeredVehiclecontrol.text = it.response
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,9 +16,8 @@ import es.verdnatura.presentation.view.component.CustomDialogList
|
|||
import es.verdnatura.presentation.view.feature.diadeventa.adapter.DayOfSaleAdapter
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionStateRow
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.buyers_fragment.*
|
||||
import kotlinx.android.synthetic.main.fragment_historicovehiculo.*
|
||||
import kotlinx.android.synthetic.main.fragment_item_card.*
|
||||
|
@ -27,7 +26,7 @@ import kotlinx.android.synthetic.main.fragment_item_card.splash_progress
|
|||
import kotlinx.android.synthetic.main.fragment_itemexpeditionstate_card.*
|
||||
import kotlinx.android.synthetic.main.fragment_itemshelvingdayofsale.*
|
||||
import kotlinx.android.synthetic.main.fragment_parking.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class DayOfSaleFragment(
|
||||
var entryPoint: String = ""
|
||||
|
@ -38,7 +37,6 @@ class DayOfSaleFragment(
|
|||
private var password = ""
|
||||
private var warehouseFk = ""
|
||||
private var adapter: DayOfSaleAdapter? = null
|
||||
private var listItemsRow: ArrayList<ItemExpeditionStateRow> = ArrayList()
|
||||
private var itemScan = ""
|
||||
|
||||
companion object {
|
||||
|
@ -60,7 +58,7 @@ class DayOfSaleFragment(
|
|||
}
|
||||
|
||||
private fun setToolBar(title: String) {
|
||||
toolbar_title.text = title
|
||||
binding.mainToolbar.toolbarTitle.text = title
|
||||
|
||||
|
||||
val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
|
@ -69,7 +67,7 @@ class DayOfSaleFragment(
|
|||
|
||||
listIcons.add(iconParking)
|
||||
|
||||
toolbar_icons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
||||
if (item == iconParking) {
|
||||
|
@ -80,29 +78,29 @@ class DayOfSaleFragment(
|
|||
|
||||
}
|
||||
})
|
||||
toolbar_icons.layoutManager =
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
edit_itemFk.requestFocus()
|
||||
edit_itemFk.setOnEditorActionListener { v, actionId, event ->
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!edit_itemFk.text.toString().isNullOrEmpty()) {
|
||||
getItemsSaleDate(edit_itemFk.text.toString())
|
||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||
getItemsSaleDate(binding.scanInput.text.toString())
|
||||
|
||||
itemScan = edit_itemFk.text.toString()
|
||||
itemScan = binding.scanInput.text.toString()
|
||||
}
|
||||
edit_itemFk.setText("")
|
||||
(activity as MainActivity).hideKeyboard(edit_itemFk)
|
||||
binding.scanInput.setText("")
|
||||
(activity as MainActivity).hideKeyboard(binding.scanInput)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
|
@ -116,7 +114,7 @@ class DayOfSaleFragment(
|
|||
user = prefs.getString(USER, "").toString()
|
||||
password = prefs.getString(PASSWORD, "").toString()
|
||||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelving_getSaleDate(user, password,vShelvingFK,"itemShelving_getSaleDate")
|
||||
|
||||
}
|
||||
|
@ -127,14 +125,12 @@ class DayOfSaleFragment(
|
|||
|
||||
loadItemShelvingSaleDateList.observe(viewLifecycleOwner, Observer{ event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
adapter = DayOfSaleAdapter(it.list)
|
||||
|
||||
itemexpeditionstate_recyclerview.adapter = adapter
|
||||
itemexpeditionstate_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.itemexpeditionstateRecyclerview.adapter = adapter
|
||||
binding.itemexpeditionstateRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
|
||||
// navigateToToday(it)
|
||||
if (it.list.isEmpty()){
|
||||
customDialog.setTitle("Sin resultados")
|
||||
.setDescription("No se ha podido obtener datos de la etiqueta escaneada. ")
|
||||
|
@ -157,7 +153,7 @@ class DayOfSaleFragment(
|
|||
response.observe(viewLifecycleOwner, Observer {
|
||||
if (it.isError){
|
||||
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
@ -177,29 +173,6 @@ class DayOfSaleFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* private fun setItemExpeditionState(itemInfo: itemExpedetionState) {
|
||||
setToolBar(getString(R.string.wagon) +":"+ itemScan)
|
||||
|
||||
listItemsRow = ArrayList()
|
||||
for (i in itemInfo.list) {
|
||||
listItemsRow.add(
|
||||
ItemExpeditionStateRow(
|
||||
title = i.key,
|
||||
value = i.value.replace(".0",""),
|
||||
isEditable = false
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
itemexpeditionstate_recyclerview.adapter = adapter
|
||||
itemexpeditionstate_recyclerview.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
|
||||
}*/
|
||||
private fun showParking() {
|
||||
|
||||
customDialogList.setTitle("Escanea el parking")
|
||||
|
|
|
@ -21,9 +21,9 @@ import es.verdnatura.presentation.view.feature.faltas.adapter.FaltasAdapter
|
|||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_faltas.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import kotlinx.android.synthetic.main.toolbar.**/
|
||||
|
||||
class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(FaltasViewModel::class) {
|
||||
|
||||
|
@ -62,9 +62,9 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
}
|
||||
|
||||
override fun init() {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
toolbar_title.text = getString(R.string.faultsReview)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.faultsReview)
|
||||
setToolBar()
|
||||
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
|
@ -73,7 +73,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
if (reload){
|
||||
reload = false
|
||||
hideLoad = false
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getFaltas(user,password,warehouseFk)
|
||||
}
|
||||
super.init()
|
||||
|
@ -84,25 +84,25 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
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 {
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getFaltas(user,password,warehouseFk)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setEvents(){
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
filter_itemFk.setOnKeyListener { v, keyCode, event ->
|
||||
if (filter_itemFk.text.toString().isNullOrEmpty()){
|
||||
binding.filterItemFk.setOnKeyListener { v, keyCode, event ->
|
||||
if (binding.filterItemFk.text.toString().isNullOrEmpty()){
|
||||
if (listInvetory.size != listInvetoryAux.size){
|
||||
listInvetory.removeAll(listInvetoryAux)
|
||||
listInvetoryAux.forEach {
|
||||
|
@ -114,7 +114,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
}else{
|
||||
listInvetory.removeAll(listInvetoryAux)
|
||||
listInvetoryAux.forEach {
|
||||
if (it.itemFk.contains(filter_itemFk.text.toString(),true)){
|
||||
if (it.itemFk.contains(binding.filterItemFk.text.toString(),true)){
|
||||
listInvetory.add(it)
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
with(viewModel){
|
||||
faltasList.observe(viewLifecycleOwner, Observer {
|
||||
if (hideLoad){
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
}else{
|
||||
hideLoad = true
|
||||
}
|
||||
|
@ -174,8 +174,8 @@ class FaltasFragment : BaseFragment<FragmentFaltasBinding, FaltasViewModel>(Falt
|
|||
}
|
||||
|
||||
},pasillerosItemClickListener!!)
|
||||
location_recyclerview.adapter = adapter
|
||||
location_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.locationRecyclerview.adapter = adapter
|
||||
binding.locationRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
package es.verdnatura.presentation.view.feature.historico.fragment
|
||||
|
||||
/*import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_buscar_item.*
|
||||
import kotlinx.android.synthetic.main.fragment_historico.*
|
||||
import kotlinx.android.synthetic.main.fragment_historico. binding.splashProgress
|
||||
import kotlinx.android.synthetic.main.fragment_inventary.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import java.text.SimpleDateFormat*/
|
||||
import android.content.SharedPreferences
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.graphics.Color.*
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.widget.TooltipCompat
|
||||
import androidx.core.content.ContextCompat.getColor
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -25,12 +29,7 @@ import es.verdnatura.presentation.view.feature.historico.adapter.HistoricoAdapte
|
|||
import es.verdnatura.presentation.view.feature.historico.model.ItemHistoricoListVO
|
||||
import es.verdnatura.presentation.view.feature.historico.model.ItemHistoricoVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_buscar_item.*
|
||||
import kotlinx.android.synthetic.main.fragment_historico.*
|
||||
import kotlinx.android.synthetic.main.fragment_historico.splash_progress
|
||||
import kotlinx.android.synthetic.main.fragment_inventary.*
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
@ -66,10 +65,10 @@ class HistoricoFragment(
|
|||
warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString()
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
requireActivity().main_bottom_navigation.visibility = View.GONE
|
||||
(activity as MainActivity).hideBottomNavigation(View.GONE)
|
||||
filter = "all"
|
||||
viewModel.itemDiary(user, password, itemFk, warehouseFk,"itemDiary")
|
||||
toolbar_title.text = getString(R.string.itemdiary) + ":" + itemFk
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
||||
|
@ -111,13 +110,13 @@ class HistoricoFragment(
|
|||
listIcons.add(iconReload)
|
||||
|
||||
|
||||
toolbar_icons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
||||
|
||||
if (item == iconReload) {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModelwithFilter("all")
|
||||
// TooltipCompat.setTooltipText(view!!, "Recarga");
|
||||
// view?.let { TooltipCompat.setTooltipText(it, "Recarga") };
|
||||
|
@ -133,13 +132,13 @@ class HistoricoFragment(
|
|||
}
|
||||
|
||||
if (item == iconGargabe) {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModelwithFilter("contenedor")
|
||||
view?.performLongClick()
|
||||
|
||||
}
|
||||
if (item == iconFault) {
|
||||
splash_progress.visibility = View.VISIBLE
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModelwithFilter("falta")
|
||||
|
||||
|
||||
|
@ -154,7 +153,7 @@ class HistoricoFragment(
|
|||
}
|
||||
|
||||
})
|
||||
toolbar_icons.layoutManager =
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
|
||||
}
|
||||
|
@ -165,13 +164,12 @@ class HistoricoFragment(
|
|||
}
|
||||
|
||||
private fun setEvents() {
|
||||
backButton.setOnClickListener {
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
filter_nameordateitem.setOnKeyListener { v, keyCode, event ->
|
||||
// //Log.i("VERDNATURA:","El key a filtrar ${filter_nameordateitem.text.toString()}")
|
||||
if (filter_nameordateitem.text.toString().isNullOrEmpty()) {
|
||||
binding.filterNameordateitem.setOnKeyListener { v, keyCode, event ->
|
||||
if (binding.filterNameordateitem.text.toString().isNullOrEmpty()) {
|
||||
if (listHistoric.size != listHistoryAux.size) {
|
||||
listHistoric.removeAll(listHistoryAux)
|
||||
listHistoryAux.forEach {
|
||||
|
@ -186,7 +184,7 @@ class HistoricoFragment(
|
|||
|
||||
|
||||
if (it.name != null && (it.name.contains(
|
||||
filter_nameordateitem.text.toString(),
|
||||
binding.filterNameordateitem.text.toString(),
|
||||
true
|
||||
))
|
||||
) {
|
||||
|
@ -210,13 +208,9 @@ class HistoricoFragment(
|
|||
loadHistoricoList.observe(viewLifecycleOwner, Observer { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
|
||||
splash_progress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
listToAdapter(it.list, filter)
|
||||
// //Log.i("VERDNATURA:","el total original es ${it.list.size}")
|
||||
/* adapter = HistoricoAdapter(it.list)
|
||||
historico_recyclerview.adapter = adapter
|
||||
historico_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)*/
|
||||
navigateToToday(it)
|
||||
navigateToToday(it)
|
||||
|
||||
}
|
||||
})
|
||||
|
@ -244,8 +238,8 @@ class HistoricoFragment(
|
|||
}
|
||||
|
||||
adapter = HistoricoAdapter(listHistoric)
|
||||
historico_recyclerview.adapter = adapter
|
||||
historico_recyclerview.layoutManager =
|
||||
binding.historicoRecyclerview.adapter = adapter
|
||||
binding.historicoRecyclerview.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
listHistoryAux.addAll(listHistoric)
|
||||
|
@ -264,7 +258,7 @@ class HistoricoFragment(
|
|||
positionToday += 1
|
||||
}
|
||||
|
||||
historico_recyclerview.scrollToPosition(positionToday)
|
||||
binding.historicoRecyclerview.scrollToPosition(positionToday)
|
||||
}
|
||||
|
||||
}
|
|
@ -9,8 +9,10 @@ import kotlinx.android.synthetic.main.toolbar.*
|
|||
|
||||
|
||||
class ImageViewActivity : BaseActivity<ActivityImageviewBinding>(){
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.activity_imageview
|
||||
|
||||
|
||||
override fun init() {
|
||||
toolbar_title.text = (intent.getStringExtra("title"))
|
||||
imgView.loadUrl(intent.getStringExtra("url"))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.main.activity
|
||||
|
||||
//import kotlinx.android.synthetic.main.activity_main.*
|
||||
import android.content.SharedPreferences
|
||||
import android.view.Menu
|
||||
import androidx.core.content.ContextCompat
|
||||
|
@ -11,7 +12,7 @@ import es.verdnatura.databinding.ActivityMainBinding
|
|||
import es.verdnatura.domain.ConstAndValues.MAINACTIVITY
|
||||
import es.verdnatura.presentation.base.BaseActivity
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogMainActivity
|
||||
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.ItemProposalFragment
|
||||
|
@ -50,7 +51,6 @@ import es.verdnatura.presentation.view.feature.smarttag.register.RegisterSmartTa
|
|||
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.AssociateSmartTagsFragment
|
||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemFragment
|
||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorFragment
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -62,7 +62,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
OnCollectionSelectedListener, OnBuyerSelectedListener {
|
||||
|
||||
private var lastBottomMenuItemSelected: ItemMenuVO? = null
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private lateinit var customDialog: CustomDialogMainActivity
|
||||
var firstItem: ItemMenuVO? = null
|
||||
var fm = supportFragmentManager
|
||||
var TAG = "MainActivity"
|
||||
|
@ -70,7 +70,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
override fun getLayoutId(): Int = R.layout.activity_main
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(this)
|
||||
customDialog = CustomDialogMainActivity(this)
|
||||
setBottomMenu()
|
||||
if (haveSector()) addFragment(
|
||||
PasilleroFragment.newInstance("Verdnatura"),
|
||||
|
@ -101,7 +101,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
private fun setBottomMenu() {
|
||||
val bottomMenu = main_bottom_navigation
|
||||
val bottomMenu = binding.mainBottomNavigation
|
||||
bottomMenu.itemIconTintList = null
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
val bottomMenuItems: ArrayList<ItemMenuVO> = ArrayList()
|
||||
|
@ -519,5 +519,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(ExpeditionStateFragment.newInstance("main"))
|
||||
|
||||
}
|
||||
fun hideBottomNavigation(visible:Int){
|
||||
binding.mainBottomNavigation.visibility = visible
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,6 +45,14 @@ class QrFragment(
|
|||
|
||||
splash_progress.visibility = View.GONE
|
||||
customDialog = CustomDialog(requireContext())
|
||||
|
||||
customDialog.setTitle("Mensaje")
|
||||
.setDescription("Operación " )
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
backButton.performClick()
|
||||
}.show()
|
||||
|
||||
setToolbar()
|
||||
setEvents()
|
||||
super.init()
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/verdnatura_black">
|
||||
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/verdnatura_black_8_alpha_6"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<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>
|
|
@ -27,14 +27,14 @@
|
|||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textinputlayout_username"
|
||||
android:id="@+id/textinputlayout_scan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColorHint="@android:color/darker_gray"
|
||||
android:layout_marginTop="@dimen/toolbar_height">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edit_itemFk"
|
||||
android:id="@+id/scan_input"
|
||||
style="@style/InputLineTextSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:backgroundTint="@android:color/white"
|
||||
|
|
Loading…
Reference in New Issue