Search in sources :

Example 11 with TwinklingRefreshLayout

use of com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout in project SmartCampus by Vegen.

the class LostAndFoundActivity method setupUI.

@Override
protected void setupUI() {
    setTitle("失物招领");
    lostAndFoundAdapter = new LostAndFoundAdapter();
    lostAndFoundAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
    RecyclerView.LayoutManager layoutManage = /*new FullyGridLayoutManager(this, 2); // */
    new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
    recyclerView.setLayoutManager(layoutManage);
    recyclerView.setAdapter(lostAndFoundAdapter);
    new QuickReturnTopManager(recyclerView);
    recyclerView.addItemDecoration(new GridItemDecoration());
    View emptyView = View.inflate(this, R.layout.app_view_empty, null);
    lostAndFoundAdapter.setEmptyView(emptyView);
    lostAndFoundAdapter.setOnLoadMoreListener(() -> {
        presenter().getLostList(SKIP, skip);
        LogUtils.e("更多更多!!!");
    }, recyclerView);
    lostAndFoundAdapter.disableLoadMoreIfNotFullPage();
    refreshLayout.setEnableLoadmore(false);
    refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {

        @Override
        public void onRefresh(TwinklingRefreshLayout refreshLayout) {
            super.onRefresh(refreshLayout);
            loadData();
        }
    });
}
Also used : RefreshListenerAdapter(com.lcodecore.tkrefreshlayout.RefreshListenerAdapter) TwinklingRefreshLayout(com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout) RecyclerView(android.support.v7.widget.RecyclerView) QuickReturnTopManager(com.itculturalfestival.smartcampus.utils.QuickReturnTopManager) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) LostAndFoundAdapter(com.itculturalfestival.smartcampus.adapter.LostAndFoundAdapter) GridItemDecoration(com.itculturalfestival.smartcampus.utils.ItemDecoration.GridItemDecoration)

Aggregations

TwinklingRefreshLayout (com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout)11 RefreshListenerAdapter (com.lcodecore.tkrefreshlayout.RefreshListenerAdapter)10 Handler (android.os.Handler)7 View (android.view.View)6 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 RecyclerView (android.support.v7.widget.RecyclerView)4 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)3 QuickReturnTopManager (com.itculturalfestival.smartcampus.utils.QuickReturnTopManager)3 BezierLayout (com.lcodecore.tkrefreshlayout.header.bezierlayout.BezierLayout)3 ProgressLayout (com.lcodecore.tkrefreshlayout.header.progresslayout.ProgressLayout)3 PhotoAdapter (com.lcodecore.twinklingrefreshlayout.adapter.PhotoAdapter)3 AdapterView (android.widget.AdapterView)2 ListItemDecoration (com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration)2 SuppressLint (android.annotation.SuppressLint)1 GridView (android.widget.GridView)1 ListView (android.widget.ListView)1 EmploymentListAdapter (com.itculturalfestival.smartcampus.adapter.EmploymentListAdapter)1 LostAndFoundAdapter (com.itculturalfestival.smartcampus.adapter.LostAndFoundAdapter)1 MoreNewsAdapter (com.itculturalfestival.smartcampus.adapter.MoreNewsAdapter)1 GridItemDecoration (com.itculturalfestival.smartcampus.utils.ItemDecoration.GridItemDecoration)1