本文整理汇总了Java中com.zhy.view.flowlayout.FlowLayout类的典型用法代码示例。如果您正苦于以下问题:Java FlowLayout类的具体用法?Java FlowLayout怎么用?Java FlowLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FlowLayout类属于com.zhy.view.flowlayout包,在下文中一共展示了FlowLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的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.FlowLayout; //导入依赖的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.FlowLayout; //导入依赖的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.FlowLayout; //导入依赖的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: onTagClick
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的package包/类
@Override
public boolean onTagClick(View view, int position, FlowLayout parent) {
String keyword = ((TextView) view).getText().toString();
mTingSearchBox.setText(keyword);
pageNum = 1;
mSearchPresenter.goSearch(keyword, pageNum);
return true;
}
示例6: setVideoTags
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的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;
}
});
}
示例7: getView
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的package包/类
@Override
public View getView(FlowLayout parent, int position, Summary.DataBean.TagBean tagBean) {
TextView tv = new TextView(parent.getContext());
int paddingTopAndBottom = 10;
int paddingLeftAndRight = 25;
tv.setPadding(paddingLeftAndRight, paddingTopAndBottom, paddingLeftAndRight, paddingTopAndBottom);
tv.setText(tagBean.getTag_name());
tv.setTextSize(12);
tv.setTextColor(ArmsUtils.getColor(parent.getContext(), R.color.text_title));
tv.setBackgroundResource(R.drawable.shape_tv_tag_video_detail);
AutoUtils.auto(tv);
return tv;
}
示例8: initListeners
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的package包/类
@Override
protected void initListeners() {
mSearchView.setOnQueryClearListener(() -> {
// clear content in RecyclerView
if (mData != null)
mData.clear();
if (mAdapter != null)
mAdapter.notifyDataSetChanged();
initialSearchTags();
// update tag flow layout
mTagFlowLayout.setAdapter(tagAdapter(mSearchTags));
mTagFlowLayout.setVisibility(View.VISIBLE);
return true;
});
mSearchView.setOnQueryChangeListener((String query) -> {
try {
loadSearchData(URLEncoder.encode(query, "UTF-8"));
if (mDialog == null) {
mDialog = new ProgressDialog(SearchActivity.this);
mDialog.setMessage(getString(R.string.search_message));
mDialog.setCancelable(true);
}
mDialog.show();
mSearchView.clearFocus();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} finally {
PrefsUtil.saveSearchTags(SearchActivity.this, new String[]{query});
}
return true;
});
mTagFlowLayout.setOnTagClickListener((View view, int position, FlowLayout parent) -> {
mSearchView.setQueryText(mSearchTags[position]);
return true;
});
}
示例9: tagAdapter
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的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;
}
};
}
示例10: finishTask
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的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();
}
示例11: onViewCreated
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的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);
}
});
}
});
}
示例12: getView
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的package包/类
@Override
public View getView(FlowLayout parent, int position, String s) {
TextView tvTag = (TextView) LayoutInflater.from(parent.getContext()).inflate(R.layout.view_search_tag, parent, false);
tvTag.setText(s);
return tvTag;
}
示例13: finishTask
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的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();
}
示例14: finishTask
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的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();
}
示例15: getView
import com.zhy.view.flowlayout.FlowLayout; //导入依赖的package包/类
@Override
public View getView(FlowLayout parent, int position, String s) {
TextView tv = (TextView) LayoutInflater.from(parent.getContext()).inflate(R.layout.view_type, parent, false);
tv.setText(s);
return tv;
}