Methods Summary |
---|
public abstract java.lang.Object | get(int position)Returns the item for the given position.
|
public long | getId(int position)Returns id for the given position.
return NO_ID;
|
public final Presenter | getPresenter(java.lang.Object item)Returns the {@link Presenter} for the given item from the adapter.
if (mPresenterSelector == null) {
throw new IllegalStateException("Presenter selector must not be null");
}
return mPresenterSelector.getPresenter(item);
|
public final PresenterSelector | getPresenterSelector()Returns the presenter selector for this ObjectAdapter.
return mPresenterSelector;
|
public final boolean | hasStableIds()Indicates whether the item ids are stable across changes to the
underlying data. When this is true, clients of the ObjectAdapter can use
{@link #getId(int)} to correlate Objects across changes.
return mHasStableIds;
|
protected final void | notifyChanged()
mObservable.notifyChanged();
|
protected final void | notifyItemRangeChanged(int positionStart, int itemCount)
mObservable.notifyItemRangeChanged(positionStart, itemCount);
|
protected final void | notifyItemRangeInserted(int positionStart, int itemCount)
mObservable.notifyItemRangeInserted(positionStart, itemCount);
|
protected final void | notifyItemRangeRemoved(int positionStart, int itemCount)
mObservable.notifyItemRangeRemoved(positionStart, itemCount);
|
protected void | onHasStableIdsChanged()Called when {@link #setHasStableIds(boolean)} is called and the status
of stable ids has changed.
|
protected void | onPresenterSelectorChanged()Called when {@link #setPresenterSelector(PresenterSelector)} is called
and the PresenterSelector differs from the previous one.
|
public final void | registerObserver(android.support.v17.leanback.widget.ObjectAdapter$DataObserver observer)Register a DataObserver for data change notifications.
mObservable.registerObserver(observer);
|
public final void | setHasStableIds(boolean hasStableIds)Sets whether the item ids are stable across changes to the underlying
data.
boolean changed = mHasStableIds != hasStableIds;
mHasStableIds = hasStableIds;
if (changed) {
onHasStableIdsChanged();
}
|
public final void | setPresenterSelector(PresenterSelector presenterSelector)Set the presenter selector. May not be null.
if (presenterSelector == null) {
throw new IllegalArgumentException("Presenter selector must not be null");
}
final boolean update = (mPresenterSelector != null);
final boolean selectorChanged = update && mPresenterSelector != presenterSelector;
mPresenterSelector = presenterSelector;
if (selectorChanged) {
onPresenterSelectorChanged();
}
if (update) {
notifyChanged();
}
|
public abstract int | size()Returns the number of items in the adapter.
|
public final void | unregisterAllObservers()Unregister all DataObservers for this ObjectAdapter.
mObservable.unregisterAll();
|
public final void | unregisterObserver(android.support.v17.leanback.widget.ObjectAdapter$DataObserver observer)Unregister a DataObserver for data change notifications.
mObservable.unregisterObserver(observer);
|