本文整理汇总了Java中android.support.v7.widget.RecyclerView.AdapterDataObserver类的典型用法代码示例。如果您正苦于以下问题:Java AdapterDataObserver类的具体用法?Java AdapterDataObserver怎么用?Java AdapterDataObserver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AdapterDataObserver类属于android.support.v7.widget.RecyclerView包,在下文中一共展示了AdapterDataObserver类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupEmptyViewObserver
import android.support.v7.widget.RecyclerView.AdapterDataObserver; //导入依赖的package包/类
private void setupEmptyViewObserver(RecyclerView.Adapter paramAdapter)
{
if (paramAdapter != null)
{
if (this.mObserver != null)
{
paramAdapter.unregisterAdapterDataObserver(this.mObserver);
this.mObserver = null;
}
this.mObserver = new RecyclerView.AdapterDataObserver()
{
public final void onChanged()
{
PlayRecyclerView.this.updateEmptyStatus();
}
};
paramAdapter.registerAdapterDataObserver(this.mObserver);
}
}
示例2: associateWith
import android.support.v7.widget.RecyclerView.AdapterDataObserver; //导入依赖的package包/类
@Override
public void associateWith(final DataSetObserver observer) {
adObserver = new AdapterDataObserver() {
@Override
public void onChanged() {
observer.onChanged();
}
};
recyclerView.getAdapter().registerAdapterDataObserver(adObserver);
}
示例3: PlayHeaderListRecyclerViewListener
import android.support.v7.widget.RecyclerView.AdapterDataObserver; //导入依赖的package包/类
public PlayHeaderListRecyclerViewListener(PlayHeaderListLayout paramPlayHeaderListLayout)
{
this.mLayout = paramPlayHeaderListLayout;
this.mObserver = new RecyclerView.AdapterDataObserver()
{
public final void onChanged()
{
PlayHeaderListRecyclerViewListener.access$000$536d8310(PlayHeaderListRecyclerViewListener.this);
PlayHeaderListRecyclerViewListener.this.mLayout.mPendingListSync = 2;
}
public final void onItemRangeChanged$255f295()
{
onChanged();
}
public final void onItemRangeInserted(int paramAnonymousInt1, int paramAnonymousInt2)
{
onChanged();
}
public final void onItemRangeRemoved(int paramAnonymousInt1, int paramAnonymousInt2)
{
onChanged();
}
};
}
示例4: Listener
import android.support.v7.widget.RecyclerView.AdapterDataObserver; //导入依赖的package包/类
Listener(final T recyclerAdapter, final Observer<? super T> observer) {
this.recyclerAdapter = recyclerAdapter;
this.dataObserver = new AdapterDataObserver() {
@Override public void onChanged() {
if (!isDisposed()) {
observer.onNext(recyclerAdapter);
}
}
};
}