Search in sources :

Example 1 with RecommendAdapter

use of com.bilirecommendui.main.widget.adapter.RecommendAdapter in project AndroidDevelop by 7449.

the class MainActivity method initCreate.

@Override
protected void initCreate(Bundle savedInstanceState) {
    toolbar.setTitle("推荐");
    setSupportActionBar(toolbar);
    presenter = new RecommendPresenterImpl(this);
    adapter = new RecommendAdapter();
    recyclerView.setAdapter(adapter);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
    swipeRefreshLayout.setOnRefreshListener(this);
    swipeRefreshLayout.setColorSchemeColors(ContextCompat.getColor(getBaseContext(), R.color.colorPrimary));
    swipeRefreshLayout.post(new Runnable() {

        @Override
        public void run() {
            onRefresh();
        }
    });
}
Also used : RecommendPresenterImpl(com.bilirecommendui.main.presenter.RecommendPresenterImpl) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) RecommendAdapter(com.bilirecommendui.main.widget.adapter.RecommendAdapter)

Aggregations

StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 RecommendPresenterImpl (com.bilirecommendui.main.presenter.RecommendPresenterImpl)1 RecommendAdapter (com.bilirecommendui.main.widget.adapter.RecommendAdapter)1