I need to enable my Button after check some condition, i want to call one method using @InverseBinding OR Two Way data binding and reflect the changes with return value.
my Code :
<Button
android:id="@+id/save_btn_disabled_3"
android:enabled="@={controller}"
....
/>
my Two Way data binding logic here :
@InverseBindingAdapter(attribute = "enable")
fun getEnableButton(view:View, controller:Controller): Boolean {
//some conditions
return false
}
i want to know am i going in correct direction ?, code is ok ? please suggest me.
enablethebuttonand itonclickmethod is that it you want?