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
For me did this the trick:
@BindingAdapter("android:layout_height")
public static void setLayoutHeight(View view, final Number height) {
final ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
layoutParams.height = height.intValue();
view.setLayoutParams(layoutParams);
}
And the xml:
android:layout_height="@{item.isItemCollapsed ? @dimen/radar_item_first_background_height : item.textMaxLines, default=@dimen/radar_item_first_background_height}"