Modificado customDialog para modificar inputText dinámicamente
This commit is contained in:
parent
ad4910948d
commit
ea63ddc24d
|
@ -7,13 +7,12 @@ import android.view.View
|
|||
import com.google.android.material.textfield.TextInputEditText
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ComponentCustomEditDialogBinding
|
||||
import es.verdnatura.presentation.common.showKeyboard
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
|
||||
|
||||
class CustomDialogInput(context: Context) : Dialog(context, R.style.DialogTheme) {
|
||||
|
||||
private var binding: ComponentCustomEditDialogBinding = ComponentCustomEditDialogBinding.inflate(layoutInflater)
|
||||
private var binding: ComponentCustomEditDialogBinding =
|
||||
ComponentCustomEditDialogBinding.inflate(layoutInflater)
|
||||
|
||||
|
||||
init {
|
||||
|
@ -89,9 +88,10 @@ class CustomDialogInput (context: Context) : Dialog(context, R.style.DialogTheme
|
|||
return this
|
||||
}
|
||||
|
||||
fun setInputText(){
|
||||
binding.customDialogValue.inputType= InputType.TYPE_CLASS_NUMBER
|
||||
fun setInputText(typeClassNumber: Int = InputType.TYPE_CLASS_NUMBER) {
|
||||
binding.customDialogValue.inputType = typeClassNumber
|
||||
}
|
||||
|
||||
fun setFocusText() {
|
||||
binding.customDialogValue.requestFocus()
|
||||
}
|
||||
|
|
|
@ -2291,7 +2291,7 @@ class CollectionFragment(
|
|||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||
// customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
@ -2351,7 +2351,7 @@ class CollectionFragment(
|
|||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
|
|
@ -2390,7 +2390,7 @@ import org.json.JSONObject
|
|||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||
// customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
@ -2450,7 +2450,7 @@ import org.json.JSONObject
|
|||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
|
|
@ -2365,7 +2365,7 @@ class CollectionFragmentPreChecker(
|
|||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||
// customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
@ -2425,7 +2425,7 @@ class CollectionFragmentPreChecker(
|
|||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.packingHolland.fragment
|
||||
|
||||
import android.text.InputType
|
||||
import android.view.View.*
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import es.verdnatura.R
|
||||
|
@ -84,7 +85,7 @@ class PackingHollandFragment(var entrypoint: String) :
|
|||
|
||||
private fun showQuantityPacking() {
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||
customDialogInput.setTitle(getString(R.string.titlePackingHolland))
|
||||
customDialogInput.setDescription(getString(R.string.packingQuantity) + shelvingScaned)
|
||||
.setValue("")
|
||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.presacador.fragment
|
|||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.text.InputType
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ImageView
|
||||
|
@ -127,7 +128,7 @@ class InitPreSacadorFragment(
|
|||
|
||||
private fun showPrintPrevious() {
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||
customDialogInput.setTitle(getString(R.string.printTicket))
|
||||
customDialogInput.setDescription(getString(R.string.printPreviousGroup))
|
||||
.setValue("")
|
||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.sacador.fragment
|
|||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.text.InputType
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ImageView
|
||||
|
@ -139,7 +140,7 @@ class SacadorFragment(
|
|||
|
||||
private fun showPrintPrevious() {
|
||||
|
||||
customDialogInput.setInputText()
|
||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||
customDialogInput.setTitle(getString(R.string.printTicket))
|
||||
customDialogInput.setDescription(getString(R.string.printPreviousGroup))
|
||||
.setValue("")
|
||||
|
|
Loading…
Reference in New Issue