I am using a data binding library to update TextView visibility with an attribute installer using a method
TextView:
<TextView
android:id="@+id/profileLblTtv"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/profile_photo_gr"
android:gravity="center"
android:layout_marginTop="15dp"
android:visibility="@{viewmodel.kalase(), default=gone}"
app:layout_constraintTop_toBottomOf="@+id/reqfldsTtv"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
and bindable viewmodel 'kalase' method:
@Bindable
public int kalase() {
return userRole != null && userRole.getId() != 0 ? View.VISIBLE : View.GONE;
}
I get the following error: "@Bindable associated with the method must follow the JavaBeans kalase () convention." Can someone tell me what is going wrong?
tsiro source
share