use of com.knight.wanandroid.module_home.module_adapter.MoreKnowLedgeAdapter in project wanandroid by KnightAndroid.
the class KnowledgeLabelActivity method initData.
@Override
public void initData() {
myTagInfos.addAll(addTags("fix", fixDataList, TagInfo.TYPE_TAG_SERVICE));
myTagInfos.addAll(addTags("default", mDefaultList, TagInfo.TYPE_TAG_USER));
mDatabind.homeKnowledgetTag.setTags(myTagInfos);
mManager = new FlexboxLayoutManager(this);
mManager.setFlexDirection(FlexDirection.ROW);
// 左对齐
mManager.setJustifyContent(JustifyContent.FLEX_START);
mManager.setAlignItems(AlignItems.CENTER);
mDatabind.homeMoreknowledgeRv.setLayoutManager(mManager);
// 首先读取本地是否有保存
moreKnowLedgeList = CacheUtils.getDataInfo("moreknowledgeLabel", new TypeToken<List<TagInfo>>() {
}.getType());
if (moreKnowLedgeList == null || moreKnowLedgeList.size() == 0) {
moreKnowLedgeList = new ArrayList<>();
}
mMoreKnowLedgeAdapter = new MoreKnowLedgeAdapter(moreKnowLedgeList);
mDatabind.homeMoreknowledgeRv.setAdapter(mMoreKnowLedgeAdapter);
mDatabind.homeTvMorelabel.setText(getString(R.string.home_more_knowledge) + "(" + mMoreKnowLedgeAdapter.getData().size() + "/10)");
initLinstener();
}
Aggregations