Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

error: <identifier> expected when setting up binding adapters for two way data binding #22

Open
asuraphel opened this issue Apr 7, 2020 · 0 comments

Comments

@asuraphel
Copy link

I am trying to setup two way binding for TextInputEditText with Float variable.

Here is the entire content of my DataBindingAdapters class.

object DataBindingAdapters  {
    @BindingAdapter("android:text")
    @JvmStatic
    fun setText(view: TextInputEditText, value: Float) {
        if(value != view.text.toString().toFloat()) {
            view.setText(value.toString())
        }
    }


    @InverseBindingAdapter(attribute = "android:text")
    fun getText(view: TextInputEditText): Float  {

        return view.text.toString().toFloat()
    }

}

But I am getting:

error: expected
float callbackArg_0 = mBindingComponent.null.getText(inputFieldSize);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant