Search in sources :

Example 1 with MaterialHeader

use of com.shizhefei.view.coolrefreshview.header.MaterialHeader in project MVCHelper by LuckyJayce.

the class MaterialHeaderFragment 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);
    coolRefreshView.setPullHeader(new MaterialHeader(getContext()));
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    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) MaterialHeader(com.shizhefei.view.coolrefreshview.header.MaterialHeader) ReBooksAdapter(com.shizhefei.test.view.adapters.ReBooksAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 2 with MaterialHeader

use of com.shizhefei.view.coolrefreshview.header.MaterialHeader in project MVCHelper by LuckyJayce.

the class PinContentMaterialHeaderFragment 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);
    coolRefreshView.setPullHeader(new MaterialHeader(getContext()), true);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    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) MaterialHeader(com.shizhefei.view.coolrefreshview.header.MaterialHeader) ReBooksAdapter(com.shizhefei.test.view.adapters.ReBooksAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

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