use of android.support.v7.widget.RecyclerView.ViewHolder in project MaterializeYourApp by antoniolg.
the class RecyclerViewAdapter method onCreateViewHolder.
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_recycler, parent, false);
v.setOnClickListener(this);
return new ViewHolder(v);
}
use of android.support.v7.widget.RecyclerView.ViewHolder in project photo-picker-plus-android by chute.
the class GridAdapter method onCreateViewHolder.
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = null;
LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
itemView = layoutInflater.inflate(R.layout.gc_grid_adapter_item, parent, false);
return new ViewHolder(itemView);
}
use of android.support.v7.widget.RecyclerView.ViewHolder in project GeekNews by codeestX.
the class NodeListAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
if (holder instanceof TopViewHolder) {
TopViewHolder topHolder = ((TopViewHolder) holder);
if (mTopBean == null)
return;
ImageLoader.load(mContext, VtexPresenter.parseImg(mTopBean.getavatar_normal()), topHolder.ivNodeFace);
topHolder.tvNodeContent.setText(mTopBean.getHeader());
topHolder.tvNodesTips.setText(String.format("%d个主题\n%d次收藏", mTopBean.getTopics(), mTopBean.getStars()));
topHolder.tvNodeName.setText(mTopBean.getTitle());
} else {
ViewHolder contentHolder = ((ViewHolder) holder);
NodeListBean bean = mList.get(position - 1);
if (bean == null)
return;
ImageLoader.load(mContext, VtexPresenter.parseImg(bean.getMember().getavatar_normal()), contentHolder.ivTopicFace);
contentHolder.tvTopicName.setText(bean.getMember().getUsername());
contentHolder.tvTopicTips.setText(DateUtil.formatTime2String(bean.getCreated()));
contentHolder.tvTopicComment.setText(String.valueOf(bean.getReplies()));
contentHolder.tvTopicTitle.setText(bean.getTitle());
contentHolder.tvTopicNode.setText(bean.getNode().getTitle());
contentHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(mContext, RepliesActivity.class);
if (holder.getAdapterPosition() - 1 < 0 || mList.get(holder.getAdapterPosition() - 1) == null)
return;
intent.putExtra(Constants.IT_VTEX_TOPIC_ID, mList.get(holder.getAdapterPosition() - 1).getId());
intent.putExtra(Constants.IT_VTEX_REPLIES_TOP, mList.get(holder.getAdapterPosition() - 1));
mContext.startActivity(intent);
}
});
}
}
use of android.support.v7.widget.RecyclerView.ViewHolder in project GeekNews by codeestX.
the class TopicAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
TopicListBean bean = mList.get(position);
ImageLoader.load(mContext, bean.getImgUrl(), holder.ivTopicFace);
holder.tvTopicName.setText(bean.getName());
holder.tvTopicTips.setText(bean.getUpdateTime() + " • 最后回复 " + bean.getLastUser());
holder.tvTopicComment.setText(String.valueOf(bean.getCommentNum()));
holder.tvTopicNode.setText(bean.getNode());
holder.tvTopicTitle.setText(bean.getTitle());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(mContext, RepliesActivity.class);
intent.putExtra(Constants.IT_VTEX_TOPIC_ID, mList.get(holder.getAdapterPosition()).getTopicId());
mContext.startActivity(intent);
}
});
}
use of android.support.v7.widget.RecyclerView.ViewHolder in project UltimateAndroid by cymcsg.
the class SimpleAdapter method onCreateViewHolder.
@Override
public UltimateRecyclerviewViewHolder onCreateViewHolder(ViewGroup parent) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_view_adapter, parent, false);
ViewHolder vh = new ViewHolder(v);
return vh;
}
Aggregations