Search in sources :

Example 1 with ListItemDecoration

use of com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration in project SmartCampus by Vegen.

the class MoreNewsActivity method setupUI.

@Override
protected void setupUI() {
    newsType = getIntent().getIntExtra("newsType", Constant.NEWS_TYPE_FLASH);
    setTitle(setTitleText(newsType));
    nextUrl = getIntent().getStringExtra("nextUrl");
    if (nextUrl == null)
        nextUrl = "/PreviewPhoto.aspx?classid=";
    MORE_NEWS_URL = Url.ROOT_URL + nextUrl;
    refreshLayout.setEnableLoadmore(false);
    refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {

        @Override
        public void onRefresh(TwinklingRefreshLayout refreshLayout) {
            super.onRefresh(refreshLayout);
            loadData();
        }
    });
    moreNewsAdapter = new MoreNewsAdapter();
    moreNewsAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setAdapter(moreNewsAdapter);
    new QuickReturnTopManager(recyclerView);
    recyclerView.addItemDecoration(new ListItemDecoration());
    View emptyView = View.inflate(this, R.layout.app_view_empty, null);
    moreNewsAdapter.setEmptyView(emptyView);
    newsList = new ArrayList<>();
    moreNewsAdapter.setNewData(newsList);
    moreNewsAdapter.setOnLoadMoreListener(() -> presenter().getNewsList(page, MORE_NEWS_URL, newsType, __VIEWSTATE, __VIEWSTATEGENERATOR, __EVENTVALIDATION), 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) MoreNewsAdapter(com.itculturalfestival.smartcampus.adapter.MoreNewsAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 2 with ListItemDecoration

use of com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration in project SmartCampus by Vegen.

the class RecruitAndEmploymentMessageActivity method setupUI.

@Override
protected void setupUI() {
    type = getIntent().getIntExtra("type", Constant.MESSAGE_RECRUIT);
    if (type == Constant.MESSAGE_RECRUIT) {
        setTitle("招生信息");
    } else {
        setTitle("就业信息");
    }
    refreshLayout.setEnabled(false);
    recruitMessageAdapter = new RecruitMessageAdapter();
    // recruitMessageAdapter.openLoadAnimation(BaseQuickAdapter.SLIDEIN_RIGHT);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setAdapter(recruitMessageAdapter);
    recyclerView.addItemDecoration(new ListItemDecoration(10, 0, 0));
    View emptyView = View.inflate(this, R.layout.app_view_empty, null);
    recruitMessageAdapter.setEmptyView(emptyView);
    recruitMessageAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {

        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            LogUtils.e(tag, "url:" + recruitAndEmploymentList.get(position).getUrl());
            if (type == Constant.MESSAGE_RECRUIT) {
                // 打开网页端
                TopFunArticleDetailActivity.start(RecruitAndEmploymentMessageActivity.this, recruitAndEmploymentList.get(position).getTitle(), recruitAndEmploymentList.get(position).getUrl());
            } else {
                // 跳转到招聘列表
                EmploymentListActivity.start(RecruitAndEmploymentMessageActivity.this, recruitAndEmploymentList.get(position).getTitle(), recruitAndEmploymentList.get(position).getUrl(), position);
            }
        }
    });
    final LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(this, R.anim.layout_animation_slide_right);
    recyclerView.setLayoutAnimation(controller);
    recyclerView.scheduleLayoutAnimation();
}
Also used : ListItemDecoration(com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) RecruitMessageAdapter(com.itculturalfestival.smartcampus.adapter.RecruitMessageAdapter) LayoutAnimationController(android.view.animation.LayoutAnimationController) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 3 with ListItemDecoration

use of com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration 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)3 RecyclerView (android.support.v7.widget.RecyclerView)3 View (android.view.View)3 ListItemDecoration (com.itculturalfestival.smartcampus.utils.ItemDecoration.ListItemDecoration)3 QuickReturnTopManager (com.itculturalfestival.smartcampus.utils.QuickReturnTopManager)2 RefreshListenerAdapter (com.lcodecore.tkrefreshlayout.RefreshListenerAdapter)2 TwinklingRefreshLayout (com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout)2 LayoutAnimationController (android.view.animation.LayoutAnimationController)1 BaseQuickAdapter (com.chad.library.adapter.base.BaseQuickAdapter)1 EmploymentListAdapter (com.itculturalfestival.smartcampus.adapter.EmploymentListAdapter)1 MoreNewsAdapter (com.itculturalfestival.smartcampus.adapter.MoreNewsAdapter)1 RecruitMessageAdapter (com.itculturalfestival.smartcampus.adapter.RecruitMessageAdapter)1