use of com.itculturalfestival.smartcampus.utils.QuickReturnTopManager 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);
}
use of com.itculturalfestival.smartcampus.utils.QuickReturnTopManager 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);
}
use of com.itculturalfestival.smartcampus.utils.QuickReturnTopManager 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();
}
});
}
Aggregations