use of com.shizhefei.view.coolrefreshview.header.JellyHeader in project MVCHelper by LuckyJayce.
the class JellyHeaderFragment method onCreateViewLazy.
@Override
protected void onCreateViewLazy(Bundle savedInstanceState) {
super.onCreateViewLazy(savedInstanceState);
setContentView(R.layout.fragment_recyclerview);
coolRefreshView = (CoolRefreshView) findViewById(R.id.recyclerview_funnyRefreshView);
recyclerView = (RecyclerView) findViewById(R.id.recyclerview_recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
//这个header要白色才能突出效果
coolRefreshView.setBackgroundColor(Color.WHITE);
JellyHeader jellyHeader = new JellyHeader(getContext());
jellyHeader.setDragLayoutColor(ContextCompat.getColor(getContext(), R.color.primary));
jellyHeader.setLoadingView(R.layout.layout_jelley_header);
coolRefreshView.setPullHeader(jellyHeader);
mvcHelper = new MVCCoolHelper<>(coolRefreshView);
mvcHelper.setDataSource(new BooksOkHttp_AsyncDataSource());
mvcHelper.setAdapter(new ReBooksAdapter(getContext()));
mvcHelper.refresh();
}
Aggregations