I need to be able to dynamically set an EditText\'s height property. I am using data binding for other properties throughout my app, so I would love to be able to use data b
I solved it like this in Kotlin instead of Java.
Make a file called
MyBindings.kt
And put in:
@BindingAdapter("bind:customHeight")
fun setLayoutHeight(view: View, height: Float) {
view.layoutParams = view.layoutParams.apply { this.height = height.toInt() }
}
And then you can use this in your layouts: