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


Java TagAdapter类代码示例

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

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

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

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

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

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

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

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

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

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

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

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


}
 
开发者ID:wuyinlei,项目名称:TravelAround,代码行数:52,代码来源:SearchActivity.java


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