- BaseObservable 两种域改变通知UI刷新
@Bindable和notifyPropertyChanged(BR.xxx);通知相关的UI刷新,可视为局部刷新
@Bindable
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
notifyPropertyChanged(BR.firstName);
}
notifyChange();可视为和这个model相关的UI全部刷新
public void setFired(boolean fired) {
isFired = fired;
notifyChange();
}
网友评论