本文整理汇总了Java中com.zhy.view.flowlayout.TagFlowLayout类的典型用法代码示例。如果您正苦于以下问题:Java TagFlowLayout类的具体用法?Java TagFlowLayout怎么用?Java TagFlowLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TagFlowLayout类属于com.zhy.view.flowlayout包,在下文中一共展示了TagFlowLayout类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import com.zhy.view.flowlayout.TagFlowLayout; //导入依赖的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.TagFlowLayout; //导入依赖的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: createHeadView
import com.zhy.view.flowlayout.TagFlowLayout; //导入依赖的package包/类
private void createHeadView() {
headView = LayoutInflater.from(this)
.inflate(R.layout.layout_head_copy_details, mRecyclerView, false);
mCover = (ImageView) headView.findViewById(R.id.iv_cover);
mType = (TextView) headView.findViewById(R.id.tv_type);
mNoticeMore = (TextView) headView.findViewById(R.id.notice_more);
mContent = (TextView) headView.findViewById(R.id.tv_content);
mTime = (TextView) headView.findViewById(R.id.tv_time);
mTagFlowLayout = (TagFlowLayout) headView.findViewById(R.id.tag_flow_layout);
mPhotoAlbumLayout = (LinearLayout) headView.findViewById(R.id.ll_photo_album);
mMessageBoardLayout = (LinearLayout) headView.findViewById(R.id.ll_message_board);
mBlogHasNotice = (TextView) headView.findViewById(R.id.blog_has_notice);
mAnnouncementText = (TextView) headView.findViewById(R.id.announcement_text);
mPhotoCount = (TextView) headView.findViewById(R.id.tv_photo_count);
momentPicView = (MomentPicView) headView.findViewById(R.id.pwv_photos);
mMessageCount = (TextView) headView.findViewById(R.id.tv_message_count);
mMessageLayout = (LinearLayout) headView.findViewById(R.id.ll_messages);
mNoticeLayout = (LinearLayout) headView.findViewById(R.id.event_notice_layout);
mTagsLayout = (RelativeLayout) headView.findViewById(R.id.rl_tags);
mTimeLayout = (RelativeLayout) headView.findViewById(R.id.rl_time);
}
示例4: onCreate
import com.zhy.view.flowlayout.TagFlowLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
mTagFlowLayout = (TagFlowLayout) findViewById(R.id.tag_flow_layout);
mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
mHintText = (TextView) findViewById(R.id.hint_text);
mTagLayout = (LinearLayout) findViewById(R.id.tag_layout);
mFragmentContainer = (FrameLayout) findViewById(R.id.fragment_container);
mSearchView = (SearchView) findViewById(R.id.search_view);
mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
mFragmentContainer.setVisibility(View.GONE);
searchData(query);
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
mExitButton = (Button) findViewById(R.id.exit_button);
mExitButton.setOnClickListener(this);
mFragmentManager = getSupportFragmentManager();
loadData();
}
示例5: onCreate
import com.zhy.view.flowlayout.TagFlowLayout; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tagLayout = (TagFlowLayout) findViewById(R.id.tag_layout);
searchEdit = (EditText) findViewById(R.id.search_edit);
ImageButton clearButton = (ImageButton) findViewById(R.id.clear_btn);
clearButton.setOnClickListener(this);
loadTrendingTag();
keyListener();
}
示例6: onViewCreated
import com.zhy.view.flowlayout.TagFlowLayout; //导入依赖的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);
}
});
}
});
}