public class BaseObservable extends Object implements Observable
Observable
interface and provides
notifyPropertyChanged(int)
and notifyChange()
methods.Observable.OnPropertyChangedCallback
Constructor and Description |
---|
BaseObservable() |
Modifier and Type | Method and Description |
---|---|
void |
addOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)
Adds a callback to listen for changes to the Observable.
|
void |
notifyChange()
Notifies listeners that all properties of this instance have changed.
|
void |
notifyPropertyChanged(int fieldId)
Notifies listeners that a specific property has changed.
|
void |
removeOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)
Removes a callback from those listening for changes.
|
public void addOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)
Observable
addOnPropertyChangedCallback
in interface Observable
callback
- The callback to start listening.public void removeOnPropertyChangedCallback(Observable.OnPropertyChangedCallback callback)
Observable
removeOnPropertyChangedCallback
in interface Observable
callback
- The callback that should stop listening.public void notifyChange()
public void notifyPropertyChanged(int fieldId)
Bindable
to generate a field in
BR
to be used as fieldId
.fieldId
- The generated BR id for the Bindable field.