当前位置: 首页>>代码示例>>Java>>正文


Java FlowLayout类代码示例

本文整理汇总了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;
        }
    });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:LimitSelectedFragment.java

示例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;
        }
    });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:SimpleFragment.java

示例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;
      }
    });
  }
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:17,代码来源:VideoIntroductionFragment.java

示例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;
    });
}
 
开发者ID:Assassinss,项目名称:Interessant,代码行数:17,代码来源:SearchActivity.java

示例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;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:9,代码来源:TingSearchActivity.java

示例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;
        }
    });
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:12,代码来源:VideoIntroductionFragment.java

示例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;
}
 
开发者ID:GitLqr,项目名称:LQRBiliBlili,代码行数:14,代码来源:MyTagAdapter.java

示例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;
    });
}
 
开发者ID:yansha87,项目名称:douban-movie,代码行数:41,代码来源:SearchActivity.java

示例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;
        }
    };
}
 
开发者ID:yansha87,项目名称:douban-movie,代码行数:13,代码来源:SearchActivity.java

示例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();
}
 
开发者ID:WeDevelopTeam,项目名称:HeroVideo-master,代码行数:70,代码来源:BangumiDetailsActivity.java

示例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);
                }
            });
        }
    });

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:45,代码来源:ListViewTestFragment.java

示例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;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:7,代码来源:TingSearchActivity.java

示例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();
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:64,代码来源:BangumiDetailsActivity.java

示例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();
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:60,代码来源:BangumiDetailsActivity.java

示例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;
}
 
开发者ID:ittianyu,项目名称:POCenter,代码行数:7,代码来源:TypeActivity.java


注:本文中的com.zhy.view.flowlayout.FlowLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。