Search in sources :

Example 1 with JellyHeader

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();
}
Also used : BooksOkHttp_AsyncDataSource(com.shizhefei.test.models.datasource.okhttp.BooksOkHttp_AsyncDataSource) JellyHeader(com.shizhefei.view.coolrefreshview.header.JellyHeader) ReBooksAdapter(com.shizhefei.test.view.adapters.ReBooksAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 BooksOkHttp_AsyncDataSource (com.shizhefei.test.models.datasource.okhttp.BooksOkHttp_AsyncDataSource)1 ReBooksAdapter (com.shizhefei.test.view.adapters.ReBooksAdapter)1 JellyHeader (com.shizhefei.view.coolrefreshview.header.JellyHeader)1