本文整理汇总了Java中cn.droidlover.xrecyclerview.RecyclerItemCallback类的典型用法代码示例。如果您正苦于以下问题:Java RecyclerItemCallback类的具体用法?Java RecyclerItemCallback怎么用?Java RecyclerItemCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RecyclerItemCallback类属于cn.droidlover.xrecyclerview包,在下文中一共展示了RecyclerItemCallback类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAdapter
import cn.droidlover.xrecyclerview.RecyclerItemCallback; //导入依赖的package包/类
@Override
public SimpleRecAdapter getAdapter() {
if (adapter == null) {
adapter = new HomeAdapter(context);
adapter.setRecItemClick(new RecyclerItemCallback<GankResults.Item, HomeAdapter.ViewHolder>() {
@Override
public void onItemClick(int position, GankResults.Item model, int tag, HomeAdapter.ViewHolder holder) {
super.onItemClick(position, model, tag, holder);
switch (tag) {
case HomeAdapter.TAG_VIEW:
WebActivity.launch(context, model.getUrl(), model.getDesc());
break;
}
}
});
}
return adapter;
}
示例2: getAdapter
import cn.droidlover.xrecyclerview.RecyclerItemCallback; //导入依赖的package包/类
@Override
public SimpleRecAdapter getAdapter() {
if (adapter == null) {
adapter = new GanhuoAdapter(context);
adapter.setRecItemClick(new RecyclerItemCallback<GankResults.Item, GanhuoAdapter.ViewHolder>() {
@Override
public void onItemClick(int position, GankResults.Item model, int tag, GanhuoAdapter.ViewHolder holder) {
super.onItemClick(position, model, tag, holder);
switch (tag) {
case GanhuoAdapter.TAG_VIEW:
WebActivity.launch(context, model.getUrl(), model.getDesc());
break;
}
}
});
}
return adapter;
}
示例3: getAdapter
import cn.droidlover.xrecyclerview.RecyclerItemCallback; //导入依赖的package包/类
@Override
public SimpleRecAdapter getAdapter() {
if (adapter == null) {
adapter = new GirlAdapter(context);
adapter.setRecItemClick(new RecyclerItemCallback<GankResults.Item, GirlAdapter.ViewHolder>() {
@Override
public void onItemClick(int position, GankResults.Item model, int tag, GirlAdapter.ViewHolder holder) {
super.onItemClick(position, model, tag, holder);
}
});
}
return adapter;
}
示例4: getAdapter
import cn.droidlover.xrecyclerview.RecyclerItemCallback; //导入依赖的package包/类
public SimpleRecAdapter getAdapter() {
if (mAdapter == null) {
mAdapter = new ShortVideoAdapter(context);
mAdapter.setRecItemClick(new RecyclerItemCallback<MovieInfo.Item, ShortVideoAdapter.ViewHolder>() {
@Override
public void onItemClick(int position, MovieInfo.Item model, int tag, ShortVideoAdapter.ViewHolder holder) {
super.onItemClick(position, model, tag, holder);
}
});
}
return mAdapter;
}
示例5: getAdapter
import cn.droidlover.xrecyclerview.RecyclerItemCallback; //导入依赖的package包/类
public SimpleRecAdapter getAdapter() {
if (mAdapter == null) {
mAdapter = new ShortVideoAdapter(context);
((ShortVideoAdapter)mAdapter).setIsSeriesVideoAdapter(true);
mAdapter.setRecItemClick(new RecyclerItemCallback<MovieInfo.Item, ShortVideoAdapter.ViewHolder>() {
@Override
public void onItemClick(int position, MovieInfo.Item model, int tag, ShortVideoAdapter.ViewHolder holder) {
super.onItemClick(position, model, tag, holder);
}
});
}
return mAdapter;
}
示例6: getAdapter
import cn.droidlover.xrecyclerview.RecyclerItemCallback; //导入依赖的package包/类
public SimpleRecAdapter getAdapter() {
if (mType == 0) {
if(mAccountAdapter == null)
mAccountAdapter = new AccountDetailAdapter(context);
return mAccountAdapter;
}
if (mType == 1) {
if(mChargeAdapter == null){
mChargeAdapter = new ChargeDetailAdapter(context);
mChargeAdapter.setRecItemClick(new RecyclerItemCallback<AccountManager.ChargeItem, ChargeDetailAdapter.ViewHolder>() {
@Override
public void onItemClick(int position, AccountManager.ChargeItem model, int tag, ChargeDetailAdapter.ViewHolder holder) {
super.onItemClick(position, model, tag, holder);
}
});
}
return mChargeAdapter;
}
if (mType == 2) {
if(mAwardDetailAdapter == null){
mAwardDetailAdapter = new AwardDetailAdapter(context);
}
return mAwardDetailAdapter;
}
return null;
}
示例7: initAdapter
import cn.droidlover.xrecyclerview.RecyclerItemCallback; //导入依赖的package包/类
private void initAdapter() {
if (adapter == null) adapter = new TestRecAdapter(this);
recyclerView.verticalLayoutManager(this) //设置layoutManager
.setAdapter(adapter); //设置Adapter
adapter.setRecItemClick(new RecyclerItemCallback<TestRecAdapter.Item, TestRecAdapter.ViewHolder>() {
@Override
public void onItemClick(int position, TestRecAdapter.Item model, int tag, TestRecAdapter.ViewHolder holder) {
super.onItemClick(position, model, tag, holder);
switch (tag) {
case TestRecAdapter.TAG_CLICK:
//TODO 事件处理
break;
}
}
});
recyclerView.horizontalDivider(R.color.x_red, R.dimen.divider_height); //设置divider
recyclerView.setOnRefreshAndLoadMoreListener(new XRecyclerView.OnRefreshAndLoadMoreListener() { //设置刷新和上拉加载监听
@Override
public void onRefresh() {
loadData(1);
}
@Override
public void onLoadMore(int page) {
loadData(page);
}
});
recyclerView.useDefLoadMoreView();
}