本文整理汇总了Java中com.zhy.view.flowlayout.TagAdapter类的典型用法代码示例。如果您正苦于以下问题:Java TagAdapter类的具体用法?Java TagAdapter怎么用?Java TagAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TagAdapter类属于com.zhy.view.flowlayout包,在下文中一共展示了TagAdapter类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
final LayoutInflater mInflater = LayoutInflater.from(getActivity());
mFlowLayout = (TagFlowLayout) view.findViewById(R.id.id_flowlayout);
mFlowLayout.setMaxSelectCount(3);
mFlowLayout.setAdapter(new TagAdapter<String>(mVals)
{
@Override
public View getView(FlowLayout parent, int position, String s)
{
TextView tv = (TextView) mInflater.inflate(R.layout.tv,
mFlowLayout, false);
tv.setText(s);
return tv;
}
});
}
示例2: onViewCreated
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
final LayoutInflater mInflater = LayoutInflater.from(getActivity());
mFlowLayout = (TagFlowLayout) view.findViewById(R.id.id_flowlayout);
mFlowLayout.setAdapter(new TagAdapter<String>(mVals)
{
@Override
public View getView(FlowLayout parent, int position, String s)
{
TextView tv = (TextView) mInflater.inflate(R.layout.tv,
mFlowLayout, false);
tv.setText(s);
return tv;
}
});
}
示例3: setVideoTags
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
private void setVideoTags() {
List<String> tags = mVideoDetailsInfo.getTags();
mTagFlowLayout.setAdapter(new TagAdapter<String>(tags) {
@Override
public View getView(FlowLayout parent, int position, String s) {
TextView mTags = (TextView) LayoutInflater.from(getActivity())
.inflate(R.layout.layout_tags_item, parent, false);
mTags.setText(s);
return mTags;
}
});
}
示例4: bindData
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
private void bindData() {
tagLayout.setAdapter(new TagAdapter<String>(tags) {
@Override
public View getView(FlowLayout parent, int position, String tagName) {
TextView tag = (TextView) LayoutInflater.from(SearchActivity.this)
.inflate(R.layout.item_tag, parent, false);
tag.setText(tagName);
return tag;
}
});
tagLayout.setOnTagClickListener((view, position, parent) -> {
startResultActivity(tags.get(position));
return true;
});
}
示例5: setVideoTags
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
private void setVideoTags() {
List<String> tags = mVideoDetailsInfo.getTags();
mTagFlowLayout.setAdapter(new TagAdapter<String>(tags) {
@Override
public View getView(FlowLayout parent, int position, String tag) {
TextView tagView = (TextView) LayoutInflater.from(getActivity()).inflate(R.layout.layout_tags_item, parent, false);
tagView.setText(tag);
return tagView;
}
});
}
示例6: tagAdapter
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
private TagAdapter tagAdapter(String[] tags) {
return new TagAdapter<String>(tags) {
@Override
public View getView(FlowLayout parent, int position, String text) {
TextView tv = (TextView) getLayoutInflater().inflate(R.layout.view_tag,
mTagFlowLayout, false);
tv.setText(text);
return tv;
}
};
}
示例7: finishTask
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
@SuppressLint("SetTextI18n")
@Override
public void finishTask()
{
//设置番剧封面
Glide.with(this)
.load(result.getCover())
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.bili_default_image_tv)
.dontAnimate()
.into(mBangumiPic);
//设置背景高斯模糊图片
Glide.with(this)
.load(result.getCover())
.bitmapTransform(new BlurTransformation(this))
.into(mBangumiBackgroundImage);
//设置番剧标题
mBangumiTitle.setText(result.getTitle());
//设置番剧更新状态
if (result.getIs_finish().equals("0"))
{
mUpdateIndex.setText("更新至第" + result.getNewest_ep_index() + "话");
mBangumiUpdate.setText("连载中");
} else
{
mUpdateIndex.setText(result.getNewest_ep_index() + "话全");
mBangumiUpdate.setText("已完结" + result.getNewest_ep_index() + "话全");
}
//设置番剧播放和追番数量
mBangumiPlay.setText("播放:" + NumberUtil.converString(Integer.valueOf(result.getPlay_count()))
+ " " + "追番:" + NumberUtil.converString(Integer.valueOf(result.getFavorites())));
//设置番剧简介
mBangumiIntroduction.setText(result.getEvaluate());
//设置评论数量
mBangumiCommentCount.setText("评论 第1话(" + mPageInfo.getAcount() + ")");
//设置标签布局
List<BangumiDetailsInfo.ResultBean.TagsBean> tags = result.getTags();
mTagsLayout.setAdapter(new TagAdapter<BangumiDetailsInfo.ResultBean.TagsBean>(tags)
{
@Override
public View getView(FlowLayout parent, int position, BangumiDetailsInfo.ResultBean.TagsBean tagsBean)
{
TextView mTags = (TextView) LayoutInflater.from(BangumiDetailsActivity.this)
.inflate(R.layout.layout_tags_item, parent, false);
mTags.setText(tagsBean.getTag_name());
return mTags;
}
});
//设置番剧分季版本
initSeasonsRecycler();
//设置番剧选集
initSelectionRecycler();
//设置番剧推荐
initRecommendRecycler();
//设置番剧评论
initCommentRecycler();
//加载完毕隐藏进度条
hideProgressBar();
}
示例8: onViewCreated
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
@Override
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState)
{
initDatas();
mListView = (ListView) view.findViewById(R.id.id_listview);
mListView.setAdapter(new CommonAdapter<List<String>>(getActivity(), R.layout.item_for_listview, mDatas)
{
Map<Integer, Set<Integer>> selectedMap = new HashMap<Integer, Set<Integer>>();
@Override
public void convert(final ViewHolder viewHolder, List<String> strings)
{
TagFlowLayout tagFlowLayout = viewHolder.getView(R.id.id_tagflowlayout);
TagAdapter<String> tagAdapter = new TagAdapter<String>(strings)
{
@Override
public View getView(FlowLayout parent, int position, String o)
{
//can use viewholder
TextView tv = (TextView) mInflater.inflate(R.layout.tv,
parent, false);
tv.setText(o);
return tv;
}
};
tagFlowLayout.setAdapter(tagAdapter);
//重置状态
tagAdapter.setSelectedList(selectedMap.get(viewHolder.getItemPosition()));
tagFlowLayout.setOnSelectListener(new TagFlowLayout.OnSelectListener()
{
@Override
public void onSelected(Set<Integer> selectPosSet)
{
selectedMap.put(viewHolder.getItemPosition(), selectPosSet);
}
});
}
});
}
示例9: finishTask
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
@SuppressLint("SetTextI18n")
@Override
public void finishTask() {
//设置番剧封面
Glide.with(this)
.load(result.getCover())
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.bili_default_image_tv)
.dontAnimate()
.into(mBangumiPic);
//设置背景高斯模糊图片
Glide.with(this)
.load(result.getCover())
.bitmapTransform(new BlurTransformation(this))
.into(mBangumiBackgroundImage);
//设置番剧标题
mBangumiTitle.setText(result.getTitle());
//设置番剧更新状态
if (result.getIs_finish().equals("0")) {
mUpdateIndex.setText("更新至第" + result.getNewest_ep_index() + "话");
mBangumiUpdate.setText("连载中");
} else {
mUpdateIndex.setText(result.getNewest_ep_index() + "话全");
mBangumiUpdate.setText("已完结" + result.getNewest_ep_index() + "话全");
}
//设置番剧播放和追番数量
mBangumiPlay.setText("播放:" + NumberUtil.converString(Integer.valueOf(result.getPlay_count()))
+ " " + "追番:" + NumberUtil.converString(Integer.valueOf(result.getFavorites())));
//设置番剧简介
mBangumiIntroduction.setText(result.getEvaluate());
//设置评论数量
mBangumiCommentCount.setText("评论 第1话(" + mPageInfo.getAcount() + ")");
//设置标签布局
List<BangumiDetailsInfo.ResultBean.TagsBean> tags = result.getTags();
mTagsLayout.setAdapter(new TagAdapter<BangumiDetailsInfo.ResultBean.TagsBean>(tags) {
@Override
public View getView(FlowLayout parent, int position, BangumiDetailsInfo.ResultBean.TagsBean tagsBean) {
TextView mTags = (TextView) LayoutInflater.from(BangumiDetailsActivity.this)
.inflate(R.layout.layout_tags_item, parent, false);
mTags.setText(tagsBean.getTag_name());
return mTags;
}
});
//设置番剧分季版本
initSeasonsRecycler();
//设置番剧选集
initSelectionRecycler();
//设置番剧推荐
initRecommendRecycler();
//设置番剧评论
initCommentRecycler();
//加载完毕隐藏进度条
hideProgressBar();
}
示例10: finishTask
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
@Override
public void finishTask() {
// 设置番剧封面
Glide.with(this)
.load(mResult.getCover())
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.bili_default_image_tv)
.dontAnimate()
.into(mIvBangumiPic);
// 设置背景高斯模糊图片
Glide.with(this)
.load(mResult.getCover())
.bitmapTransform(new BlurTransformation(this))
.into(mIvBangumiBg);
// 设置番剧标题
mTvBangumiTitle.setText(mResult.getTitle());
// 设置番剧更新状态
if (mResult.getIs_finish().equals("0")){
mTvUpdateIndex.setText("更新至第" + mResult.getNewest_ep_index() + "话");
mTvBangumiUpdate.setText("连载中");
} else {
mTvUpdateIndex.setText(mResult.getNewest_ep_index() + "话全");
mTvBangumiUpdate.setText("已完结" + mResult.getNewest_ep_index() + "话全");
}
// 设置番剧播放和追番数量
mTvBangumiPlay.setText("播放:" + NumberUtil.converString(Integer.valueOf(mResult.getPlay_count()))
+ " 追番:" + NumberUtil.converString(Integer.valueOf(mResult.getFavorites())));
//设置番剧简介
mTvBangumiIntroduction.setText(mResult.getEvaluate());
//设置评论数量
mTvBangumiCommentCount.setText("评论 第1话(" + mPageInfo.getAcount() + ")");
//设置标签布局
List<BangumiDetailsInfo.ResultBean.TagsBean> tags = mResult.getTags();
mTagFlowLayout.setAdapter(new TagAdapter<BangumiDetailsInfo.ResultBean.TagsBean>(tags) {
@Override
public View getView(FlowLayout parent, int position, BangumiDetailsInfo.ResultBean.TagsBean tagsBean) {
TextView tvTag = (TextView) LayoutInflater.from(BangumiDetailsActivity.this).inflate(R.layout.layout_tags_item, parent, false);
tvTag.setText(tagsBean.getTag_name());
return tvTag;
}
});
//设置番剧分季版本
initSeasonsRecycler();
//设置番剧选集
initSelectionRecycler();
//设置番剧推荐
initRecommendRecycler();
//设置番剧评论
initCommentRecycler();
//加载完毕隐藏进度条
hideProgressBar();
}
示例11: initData
import com.zhy.view.flowlayout.TagAdapter; //导入依赖的package包/类
@Override
public void initData() {
super.initData();
if (TextUtils.isEmpty(CityName))
return;
CityName = CityName.replace(getResources().getString(R.string.town), "");
OkGo.post(HttpUrlPath.GET_SEARCH_KEY_INTO)
.params("CityName", CityName)
.params("Platform", 1)
.execute(new StringCallback() {
@Override
public void onSuccess(String s, Call call, Response response) {
Type type = new TypeToken<SearchInfo>() {
}.getType();
SearchInfo searchInfo = new Gson().fromJson(s, type);
mSearchListEntities = searchInfo.getResult().getSearchList();
if (mSearchListEntities.size() > 0 && mSearchListEntities != null) {
List<String> titles = new ArrayList<>();
for (SearchListEntity entity : mSearchListEntities) {
titles.add(entity.getKey());
}
mIdFlowlayout.setAdapter(new TagAdapter<String>(titles) {
@Override
public View getView(FlowLayout parent, int position, String title) {
TextView tv = (TextView) LayoutInflater.from(SearchActivity.this).inflate(R.layout.tv,
mIdFlowlayout, false);
tv.setTextSize(16);
tv.setText(title);
return tv;
}
});
mIdFlowlayout.setOnTagClickListener((view, position, parent) -> {
String key = titles.get(position);
Intent intent = new Intent(SearchActivity.this, SearchResultActivity.class);
intent.putExtra("key", key);
startActivity(intent);
return true;
});
}
}
});
requestHistoryData();
}