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