use of com.yumore.provider.entity.reseult.ChildrenBean in project RxMVP by Yumore.
the class CategoryAdapter method convert.
@Override
protected void convert(BaseViewHolder helper, KnowledgeSystem item) {
if (item == null) {
return;
}
helper.setText(R.id.item_life_title, item.getName());
FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager(mContext);
flexboxLayoutManager.setFlexDirection(FlexDirection.ROW);
flexboxLayoutManager.setFlexWrap(FlexWrap.WRAP);
flexboxLayoutManager.setJustifyContent(JustifyContent.FLEX_START);
RecyclerView recyclerView = helper.getView(R.id.item_life_list);
recyclerView.setLayoutManager(flexboxLayoutManager);
CateTagAdapter childAdapter = new CateTagAdapter(R.layout.item_life_child_recycler_list, item.getChildren());
recyclerView.setAdapter(childAdapter);
childAdapter.setOnItemClickListener((adapter, view, position) -> {
if (onItemTagClickListener == null) {
return;
}
ChildrenBean data = item.getChildren().get(position);
if (item.getLastId() != data.getId()) {
for (ChildrenBean childrenBean : item.getChildren()) {
childrenBean.setSelected(childrenBean.getId() == data.getId());
}
item.setLastId(data.getId());
childAdapter.notifyDataSetChanged();
}
onItemTagClickListener.onItemTagClick(adapter, view, helper.getAdapterPosition(), position);
});
helper.setVisible(R.id.item_life_holder, helper.getAdapterPosition() == 0);
}
use of com.yumore.provider.entity.reseult.ChildrenBean in project RxMVP by Yumore.
the class CategoryFragment method onItemTagClick.
@Override
public void onItemTagClick(BaseQuickAdapter<?, ?> adapter, View view, int parentId, int position) {
KnowledgeSystem knowledgeSystem = knowledgeSystems.get(parentId);
ChildrenBean childrenBean = knowledgeSystem.getChildren().get(position);
startActivity(new Intent(getContext(), KnowledgeActivity.class).putExtra("title", childrenBean.getName()).putExtra("cid", childrenBean.getId()));
}
Aggregations