FormInputs
FormInputs copied to clipboard
Add text onChange listener and databinding
Hello,
Your plugins is very helpful however it would be nice to be able to define a listener on change on the text of all the formInput as well as to give the possibility to use databinding on the inputs.
Ok my bad for the change listener we can use getInputBox() to perform with EditText directly. You really should write a documentation with your API for others.
Ok my bad for the change listener we can use getInputBox() to perform with EditText directly. You really should write a documentation with your API for others.
Hi @Hraph You are correct about the documentation. By the way, for data binding, you can use BindingAdapter it will be easier.
//Create file fileName.kt
@BindingAdapter("setTextInputText")
fun setTextToFormInputTextView(view: FormInputText, text:String?){
if(!text.isNullOrBlank()){
view.setValue(text)
}
}
//In your XML file, you can set text like this to the FormInputText
app:setTextInputText="@{yourData}
Hello,
Your plugins is very helpful however it would be nice to be able to define a listener on change on the text of all the formInput as well as to give the possibility to use databinding on the inputs.
Also if you want to listen to the text change, you can listen like this in the code
viewName.setOnTextChangeListener(object :OnTextChangeListener{
override fun onTextChange(value: String) {
//your code
}
})
Hello, Your plugins is very helpful however it would be nice to be able to define a listener on change on the text of all the formInput as well as to give the possibility to use databinding on the inputs.
Also if you want to listen to the text change, you can listen like this in the code
viewName.setOnTextChangeListener(object :OnTextChangeListener{ override fun onTextChange(value: String) { //your code } })
The method setOnTextChangeListener is only available for FormInputText and not Password, Multiline, ...
Also another feature I missed is the ability to pass to the Spinner / Autocomplete input any adapter inherited from BaseAdapter and not only a List. Thanks for your work
Hi @Hraph Now the method setOnTextChangeListener is available to all views. The other feature, I will work on it