use of com.example.jingbin.cloudreader.view.test.RCVListAdapter in project CloudReader by youlookwhat.
the class SlideScrollViewActivity method initRecyclerView.
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);
}
});
}
Aggregations