Search in sources :

Example 1 with EmploymentListAdapter

use of com.itculturalfestival.smartcampus.adapter.EmploymentListAdapter in project SmartCampus by Vegen.

the class EmploymentListActivity method setupUI.

@Override
protected void setupUI() {
    type = getIntent().getIntExtra("type", Constant.NOTICE);
    title = getIntent().getStringExtra("title");
    url = getIntent().getStringExtra("url");
    setTitle(title);
    refreshLayout.setEnableLoadmore(false);
    refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {

        @Override
        public void onRefresh(TwinklingRefreshLayout refreshLayout) {
            super.onRefresh(refreshLayout);
            loadData();
        }
    });
    employmentListAdapter = new EmploymentListAdapter();
    employmentListAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setAdapter(employmentListAdapter);
    new QuickReturnTopManager(recyclerView);
    recyclerView.addItemDecoration(new ListItemDecoration());
    View emptyView = View.inflate(this, R.layout.app_view_empty, null);
    employmentListAdapter.setEmptyView(emptyView);
    employmentListAdapter.setOnLoadMoreListener(() -> presenter().getEmploymentList(url + page, type), recyclerView);
}
Also used : ListItemDecoration(com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration) RefreshListenerAdapter(com.lcodecore.tkrefreshlayout.RefreshListenerAdapter) TwinklingRefreshLayout(com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout) QuickReturnTopManager(com.itculturalfestival.smartcampus.utils.QuickReturnTopManager) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) EmploymentListAdapter(com.itculturalfestival.smartcampus.adapter.EmploymentListAdapter)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 EmploymentListAdapter (com.itculturalfestival.smartcampus.adapter.EmploymentListAdapter)1 ListItemDecoration (com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration)1 QuickReturnTopManager (com.itculturalfestival.smartcampus.utils.QuickReturnTopManager)1 RefreshListenerAdapter (com.lcodecore.tkrefreshlayout.RefreshListenerAdapter)1 TwinklingRefreshLayout (com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout)1