FormInputs icon indicating copy to clipboard operation
FormInputs copied to clipboard

Add text onChange listener and databinding

Open Hraph opened this issue 3 years ago • 5 comments

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.

Hraph avatar Mar 12 '21 17:03 Hraph

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.

Hraph avatar Mar 12 '21 17:03 Hraph

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}

OmarShehe avatar Mar 12 '21 19:03 OmarShehe

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
            }
})

OmarShehe avatar Mar 12 '21 19:03 OmarShehe

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

Hraph avatar Mar 14 '21 11:03 Hraph

Hi @Hraph Now the method setOnTextChangeListener is available to all views. The other feature, I will work on it

OmarShehe avatar Mar 19 '21 16:03 OmarShehe