I have problem with Android binding library. When I'm using property changed '_all' everything works, but when I'm specifying field it don't work. My question is why ? :)
public class Person extends BaseObservable{
private String name;
@Bindable
public String getName(){
return this.name;
}
//IT WORKS
public void setName(String name){
this.name = name;
notifyPropertyChanged(BR._all); //<- difference
}
//IT DONT WORK
public void setSurname(String name){
this.name = name;
notifyPropertyChanged(BR.name); //<- difference
}
And my xml file:
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="person"
type="com.myapp.Person" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{person.getName()}" />
</LinearLayout>
</layout>