use of com.github.jdsjlzx.interfaces.OnLoadMoreListener in project Palm300Heroes by nicolite.
the class EquJJCFragment method doBusiness.
@Override
protected void doBusiness() {
// 根据屏幕宽度计算一行能放多少个
int spanCount = (int) (ScreenUtils.getScreenWidth(context) / ScreenUtils.dp2px(context, 80));
// 防止每行个数为0
if (spanCount == 0) {
spanCount = 4;
}
equJJCPresenter = new EquJJCPresenter(this, this);
lRecyclerView.setLayoutManager(new GridLayoutManager(context, spanCount, OrientationHelper.VERTICAL, false));
lRecyclerViewAdapter = new LRecyclerViewAdapter(new EquipmentJJCAdapter(context, dataList));
lRecyclerView.setAdapter(lRecyclerViewAdapter);
lRecyclerView.setLoadMoreEnabled(false);
lRecyclerView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
equJJCPresenter.showEquJJCList(true);
}
});
lRecyclerView.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore() {
}
});
lRecyclerView.setOnNetWorkErrorListener(new OnNetWorkErrorListener() {
@Override
public void reload() {
}
});
lRecyclerViewAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Equipment equipment = dataList.get(position);
String purchasePrice = equipment.getPurchasePrice() == null ? "" : String.valueOf(equipment.getPurchasePrice());
String compoundPrice = equipment.getCompoundPrice() == null ? "无法合成" : String.valueOf(equipment.getCompoundPrice());
String attribute = TextUtils.isEmpty(equipment.getAttribute()) ? "无" : equipment.getAttribute();
String skill = TextUtils.isEmpty(equipment.getSkill()) ? "无" : equipment.getSkill();
Bundle bundle = new Bundle();
bundle.putString("picture", equipment.getPicture());
bundle.putString("name", equipment.getName());
bundle.putString("pp", purchasePrice);
bundle.putString("cp", compoundPrice);
bundle.putString("attribute", attribute);
bundle.putString("skill", skill);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
startActivity(EquJJCDetailActivity.class, bundle);
} else {
Bundle options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, view, "equJJCTransition").toBundle();
startActivity(EquJJCDetailActivity.class, bundle, options);
}
}
});
}
Aggregations