本文整理汇总了Java中com.example.jingbin.cloudreader.view.test.RCVListAdapter类的典型用法代码示例。如果您正苦于以下问题:Java RCVListAdapter类的具体用法?Java RCVListAdapter怎么用?Java RCVListAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RCVListAdapter类属于com.example.jingbin.cloudreader.view.test包,在下文中一共展示了RCVListAdapter类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initRecyclerView
import com.example.jingbin.cloudreader.view.test.RCVListAdapter; //导入依赖的package包/类
private void initRecyclerView() {
rcvGoodsList.setVisibility(View.VISIBLE);
final RCVListAdapter adapter = new RCVListAdapter(this);
View header = new View(this);
header.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
header.getLayoutParams().height = getResources().getDimensionPixelOffset(R.dimen.new_home_header_size) - getStatusBarHeight(this);
adapter.setHeader(header);
rcvGoodsList.setLayoutManager(new LinearLayoutManager(this));
rcvGoodsList.setItemAnimator(new DefaultItemAnimator());
rcvGoodsList.setAdapter(adapter);
adapter.setDataSource(Arrays.asList("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", ""));
adapter.notifyDataSetChanged();
rcvGoodsList.setOnScrollListener(new RecyclerView.OnScrollListener() {
public int scrolledY = 0;
@Override
public void onScrolled(RecyclerView recyclerView, final int dx, final int dy) {
super.onScrolled(recyclerView, dx, dy);
scrolledY += dy;
scrollChangeHeader(scrolledY);
}
});
}