Java Code Examples for com.zhy.adapter.recyclerview.base.ViewHolder#setText()
The following examples show how to use
com.zhy.adapter.recyclerview.base.ViewHolder#setText() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommentItemDelegate.java From ZhihuDaily with Apache License 2.0 | 6 votes |
@Override public void convert(ViewHolder holder, BaseItem baseItem, int position) { Context context = holder.getConvertView().getContext(); StoryContentComment comment = (StoryContentComment) baseItem; if ((boolean) SharedPreferencesUtils.get(App.getContext(), "NO_IMAGE_MODE", false) && !NetWorkUtils.isWifiConnected(App.getContext())) { Glide.with(context) .load(R.drawable.account_avatar) .diskCacheStrategy(DiskCacheStrategy.SOURCE) .transform(new CircleTransform(context)) .into((ImageView) holder.getView(R.id.avatar)); } else { Glide.with(context) .load(comment.getAvatar()) .diskCacheStrategy(DiskCacheStrategy.SOURCE) .transform(new CircleTransform(context)) .into((ImageView) holder.getView(R.id.avatar)); } holder.setText(R.id.author, comment.getAuthor()); holder.setText(R.id.content, comment.getContent()); holder.setText(R.id.likes, Integer.toString(comment.getLikes())); holder.setText(R.id.time, comment.getTime()); }
Example 2
Source File: BaseLiveWraperFragment.java From likequanmintv with Apache License 2.0 | 6 votes |
@Override protected void convertItem(ViewHolder holder, final PlayBean playBean, int position) { holder.setImageUrl(R.id.thumnails,playBean.thumb,new GlideRoundTransform(mActivity,5)); holder.setText(R.id.title,playBean.title); holder.setText(R.id.tv_viewnum,playBean.view); holder.setText(R.id.nickName,playBean.nick); holder.setImageUrl(R.id.ic_head,playBean.avatar,new GlideCircleTransform(mActivity)); holder.getItemView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent =new Intent(mActivity, CommonLiveUI.class); intent.putExtra("playBean",playBean); getActivity().startActivity(intent); getActivity().overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left); } }); }
Example 3
Source File: OtherStoriesItemDelegate.java From ZhihuDaily with Apache License 2.0 | 5 votes |
@Override public void convert(ViewHolder holder, BaseItem baseItem, int position) { mContext = holder.getConvertView().getContext(); final ThemesContentItem item = (ThemesContentItem) baseItem; holder.setText(R.id.title, item.getTitle()); holder.getView(R.id.multiPic).setVisibility(View.GONE); if (item.getImages() != null) { if ((boolean) SharedPreferencesUtils.get(App.getContext(), "NO_IMAGE_MODE", false) && !NetWorkUtils.isWifiConnected(App.getContext())) { Glide.with(mContext) .load(R.drawable.image_small_default) .diskCacheStrategy(DiskCacheStrategy.SOURCE) .into((ImageView) holder.getView(R.id.image)); } else { Glide.with(mContext) .load(item.getImages().get(0)) .diskCacheStrategy(DiskCacheStrategy.SOURCE) .into((ImageView) holder.getView(R.id.image)); } } else { holder.getView(R.id.image).setVisibility(View.GONE); } holder.setOnClickListener(R.id.cardView, new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(mContext, OtherStoryContentActivity.class); intent.putExtra("id", item.getId()); mContext.startActivity(intent); } }); }
Example 4
Source File: StoriesSectionDelegate.java From ZhihuDaily with Apache License 2.0 | 5 votes |
@Override public void convert(ViewHolder holder, BaseItem baseItem, int position) { if (position == 1) { holder.setText(R.id.story_section, "今日热闻"); } else { holder.setText(R.id.story_section, ((StoriesSection) baseItem).getDate()); } }
Example 5
Source File: StoriesItemDelegate.java From ZhihuDaily with Apache License 2.0 | 5 votes |
@Override public void convert(ViewHolder holder, BaseItem baseItem, int position) { final Stories stories = (Stories) baseItem; holder.setText(R.id.title, stories.getTitle()); mContext = holder.getConvertView().getContext(); if ((boolean) SharedPreferencesUtils.get(App.getContext(), "NO_IMAGE_MODE", false) && !NetWorkUtils.isWifiConnected(App.getContext())) { Glide.with(mContext) .load(R.drawable.image_small_default) .centerCrop() .diskCacheStrategy(DiskCacheStrategy.SOURCE) .into((ImageView) holder.getView(R.id.image)); } else { Glide.with(mContext) .load(stories.getImages().get(0)) .centerCrop() .diskCacheStrategy(DiskCacheStrategy.SOURCE) .into((ImageView) holder.getView(R.id.image)); } if (!stories.isMultiPic()) { holder.getView(R.id.multiPic).setVisibility(View.INVISIBLE); } holder.setOnClickListener(R.id.cardView, new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(mContext, StoryContentActivity.class); intent.putExtra("id", stories.getId()); mContext.startActivity(intent); } }); }
Example 6
Source File: CommentSectionDelegate.java From ZhihuDaily with Apache License 2.0 | 5 votes |
@Override public void convert(ViewHolder holder, BaseItem baseItem, int position) { CommentSection commentSection = (CommentSection) baseItem; holder.setText(R.id.comment_num, commentSection.getTitle()); if (commentSection.getType() == CommentSection.LONG_COMMENT) { holder.getView(R.id.comment_item_img).setVisibility(View.GONE); } }
Example 7
Source File: LoveLiveListFragment.java From likequanmintv with Apache License 2.0 | 5 votes |
@Override protected void convertItem(ViewHolder holder, final PlayBean playBean, int position) { holder.setImageUrl(R.id.thumnails,playBean.thumb,new GlideRoundTransform(mActivity,5)); holder.setText(R.id.tv_viewnum,playBean.view); holder.setText(R.id.intro,playBean.title); holder.getItemView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent =new Intent(mActivity, VerFullLiveUI.class); intent.putExtra("playBean",playBean); getActivity().startActivity(intent); getActivity().overridePendingTransition(R.anim.anim_slide_in_right,R.anim.anim_slide_out_left); } }); }
Example 8
Source File: ColumnFragmentListAdapter.java From likequanmintv with Apache License 2.0 | 5 votes |
@Override protected void convert(ViewHolder holder, final ItemColumn itemColumn, int position) { // holder.setText(R.id.name,itemColumn.name); holder.setImageUrl(R.id.thumnails,itemColumn.image,new GlideRoundTransform(mContext,1.5f)); holder.getItemView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(mActivity, ColumnListActivity.class); intent.putExtra("itemColumn",itemColumn); mActivity.startActivity(intent); } }); }
Example 9
Source File: MsgSendItemDelagate.java From baseAdapter with Apache License 2.0 | 5 votes |
@Override public void convert(ViewHolder holder, ChatMessage chatMessage, int position) { holder.setText(R.id.chat_send_content, chatMessage.getContent()); holder.setText(R.id.chat_send_name, chatMessage.getName()); holder.setImageResource(R.id.chat_send_icon, chatMessage.getIcon()); }
Example 10
Source File: MsgComingItemDelagate.java From baseAdapter with Apache License 2.0 | 5 votes |
@Override public void convert(ViewHolder holder, ChatMessage chatMessage, int position) { holder.setText(R.id.chat_from_content, chatMessage.getContent()); holder.setText(R.id.chat_from_name, chatMessage.getName()); holder.setImageResource(R.id.chat_from_icon, chatMessage.getIcon()); }
Example 11
Source File: ThemeItemDelegate.java From ZhihuDaily with Apache License 2.0 | 4 votes |
@Override public void convert(ViewHolder holder, BaseItem baseItem, int position) { ThemesOther themesItem = (ThemesOther) baseItem; holder.setText(R.id.theme_title, themesItem.getName()); }