本文整理汇总了Java中com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF类的典型用法代码示例。如果您正苦于以下问题:Java RecyclerAdapterWithHF类的具体用法?Java RecyclerAdapterWithHF怎么用?Java RecyclerAdapterWithHF使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RecyclerAdapterWithHF类属于com.chanven.lib.cptr.recyclerview包,在下文中一共展示了RecyclerAdapterWithHF类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setListener
import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Override
protected void setListener() {
mAdapterWithHf.setOnItemClickListener(new RecyclerAdapterWithHF.OnItemClickListener() {
@Override
public void onItemClick(RecyclerAdapterWithHF adapter, RecyclerView.ViewHolder vh, int position) {
StatusDetailActivity.start(getActivity(), (StatusModel) mDao.getList().get(position));
}
});
}
示例2: setListener
import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Override
protected void setListener() {
mAdapterWithHf.setOnItemClickListener(new RecyclerAdapterWithHF.OnItemClickListener() {
@Override
public void onItemClick(RecyclerAdapterWithHF adapter, RecyclerView.ViewHolder vh, int position) {
StatusDetailActivity.start(getActivity(), ((CommentModel) mDao.getList().get(position)).status);
}
});
}
示例3: setListener
import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Override
protected void setListener() {
mAdapterWithHf.setOnItemClickListener(new RecyclerAdapterWithHF.OnItemClickListener() {
@Override
public void onItemClick(RecyclerAdapterWithHF adapter, RecyclerView.ViewHolder vh, int position) {
StatusDetailActivity.start(getActivity(), ((StatusModel) mDao.getList().get(position)).retweeted_status);
}
});
}
示例4: onCreateView
import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.abs_timeline_status_recycler, container, false);
mView = view;
//获取recyclerView
mRecyclerView = (RecyclerView) view.findViewById(R.id.abs_timeline_fragment_content_recyclerView);
//
mPtrClassicFrameLayout = (PtrClassicFrameLayout) view.findViewById(R.id.abs_timeline_fragment_content_ptrFrame);
mPtrClassicFrameLayout.setClickable(true);
mDao = bindDao();
//cache读取数据
mDao.loadFromCache();
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.addItemDecoration(new RecyclerViewDivider(getActivity(), LinearLayoutManager.HORIZONTAL));
mAdapter = bindAdapter();
mAdapterWithHf = new RecyclerAdapterWithHF(mAdapter);
mRecyclerView.setAdapter(mAdapterWithHf);
setListener();
//第一次执行刷新
mPtrClassicFrameLayout.postDelayed(new Runnable() {
@Override
public void run() {
mPtrClassicFrameLayout.autoRefresh(true);
}
}, 150);
mPtrClassicFrameLayout.setPtrHandler(new PtrDefaultHandler() {
@Override
public void onRefreshBegin(PtrFrameLayout frame) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
new Refresher(mView).execute(true);
mPtrClassicFrameLayout.setLoadMoreEnable(true);
mAdapterWithHf.notifyDataSetChanged();
mPtrClassicFrameLayout.refreshComplete();
}
}, 1500);
}
});
mPtrClassicFrameLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void loadMore() {
handler.postDelayed(new Runnable() {
@Override
public void run() {
new Refresher(mView).execute(false);
mPtrClassicFrameLayout.loadMoreComplete(true);
mAdapterWithHf.notifyDataSetChanged();
}
}, 1000);
}
});
return view;
}
示例5: init
import com.chanven.lib.cptr.recyclerview.RecyclerAdapterWithHF; //导入依赖的package包/类
private void init() {
adapter = new RecyclerAdapter(this, mData);
mAdapter = new RecyclerAdapterWithHF(adapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setAdapter(mAdapter);
ptrClassicFrameLayout.postDelayed(new Runnable() {
@Override
public void run() {
ptrClassicFrameLayout.autoRefresh(true);
}
}, 150);
ptrClassicFrameLayout.setPtrHandler(new PtrDefaultHandler() {
@Override
public void onRefreshBegin(PtrFrameLayout frame) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
page = 0;
mData.clear();
for (int i = 0; i < 17; i++) {
mData.add(new String(" RecyclerView item -" + i));
}
mAdapter.notifyDataSetChanged();
ptrClassicFrameLayout.refreshComplete();
ptrClassicFrameLayout.setLoadMoreEnable(true);
}
}, 1500);
}
});
ptrClassicFrameLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void loadMore() {
handler.postDelayed(new Runnable() {
@Override
public void run() {
mData.add(new String(" RecyclerView item - add " + page));
mAdapter.notifyDataSetChanged();
ptrClassicFrameLayout.loadMoreComplete(true);
page++;
Toast.makeText(RecyclerViewActivity.this, "load more complete", Toast.LENGTH_SHORT).show();
}
}, 1000);
}
});
}