Package androidx.databinding
Interface ObservableList<T>
-
- All Superinterfaces:
java.util.Collection<T>,java.lang.Iterable<T>,java.util.List<T>
public interface ObservableList<T> extends java.util.List<T>AListthat notifies when changes are made. An ObservableList bound to the UI will keep the it up-to-date when changes occur.The ObservableList must notify its callbacks whenever a change to the list occurs, using
ObservableList.OnListChangedCallback.ObservableArrayList implements ObservableList with an underlying ArrayList. ListChangeRegistry can help in maintaining the callbacks of other implementations.
- See Also:
Observable,ObservableMap
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classObservableList.OnListChangedCallback<T extends ObservableList>The callback that is called by ObservableList when the list has changed.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)Adds a callback to be notified when changes to the list occur.voidremoveOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)Removes a callback previously added.-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
addOnListChangedCallback
void addOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
Adds a callback to be notified when changes to the list occur.- Parameters:
callback- The callback to be notified on list changes
-
removeOnListChangedCallback
void removeOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
Removes a callback previously added.- Parameters:
callback- The callback to remove.
-
-