use of cn.nicolite.palm300heroes.view.adapter.TalentAdapter in project Palm300Heroes by nicolite.
the class TalentActivity method doBusiness.
@Override
protected void doBusiness() {
toolbarTitle.setText("天赋技能");
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
}
lRecyclerView.setLayoutManager(new GridLayoutManager(context, 3, OrientationHelper.VERTICAL, false));
lRecyclerViewAdapter = new LRecyclerViewAdapter(new TalentAdapter(context, dataList));
lRecyclerView.setAdapter(lRecyclerViewAdapter);
lRecyclerView.setLoadMoreEnabled(false);
talentPresenter = new TalentPresenter(this, this);
lRecyclerView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
talentPresenter.showTalent(true);
}
});
lRecyclerView.setOnNetWorkErrorListener(new OnNetWorkErrorListener() {
@Override
public void reload() {
talentPresenter.showTalent(true);
}
});
lRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Talent talent = dataList.get(position);
Bundle bundle = new Bundle();
bundle.putString("picture", talent.getPicture());
bundle.putString("name", talent.getName());
bundle.putString("recommend", talent.getRecommend());
bundle.putString("belongTo", talent.getBelongTo());
bundle.putString("skill", talent.getSkill());
bundle.putString("level", String.valueOf(talent.getLevel()));
startActivity(TalentDetailActivity.class, bundle);
}
});
talentPresenter.showTalent(false);
}
Aggregations