use of com.rideread.rideread.widget.VideoTextureView in project ride-read-android by Ride-Read.
the class AttentionListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final TimeLine timeline = (TimeLine) getItem(position);
ViewHolder viewHolder = null;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = inflate.inflate(resId, null);
viewHolder.text = (TextView) convertView.findViewById(R.id.timeline_text);
viewHolder.gridView = (NineGridImageView) convertView.findViewById(R.id.timeline_imgs);
viewHolder.videoTextureView = (VideoTextureView) convertView.findViewById(R.id.timeline_videotextureview);
viewHolder.iv_play = (ImageView) convertView.findViewById(R.id.iv_play);
viewHolder.author = (TextView) convertView.findViewById(R.id.timeline_nickname);
viewHolder.commentnum = (TextView) convertView.findViewById(R.id.timeline_comment_num);
viewHolder.zannum = (TextView) convertView.findViewById(R.id.timeline_like_num);
viewHolder.diasance = (TextView) convertView.findViewById(R.id.timeline_distance);
viewHolder.location = (TextView) convertView.findViewById(R.id.timeline_destinnation);
viewHolder.pushTime = (TextView) convertView.findViewById(R.id.timeline_time);
viewHolder.timeline_head = (ImageView) convertView.findViewById(R.id.timeline_head);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.timeline_head.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, SelfTimelineActivity.class);
intent.putExtra("userName", timeline.getAuthor());
context.startActivity(intent);
}
});
if (timeline.isHasText()) {
viewHolder.text.setText(timeline.getText());
viewHolder.text.setVisibility(View.VISIBLE);
} else {
viewHolder.text.setVisibility(View.GONE);
}
if (timeline.isHasImg()) {
viewHolder.gridView.setAdapter(adapter);
viewHolder.gridView.setImagesData(timeline.getImgs());
viewHolder.gridView.setVisibility(View.VISIBLE);
} else {
viewHolder.gridView.setVisibility(View.GONE);
}
if (timeline.isHasVideo()) {
Log.e("lllllll", "hhh");
viewHolder.videoTextureView.setVisibility(View.VISIBLE);
viewHolder.iv_play.setVisibility(View.VISIBLE);
viewHolder.videoTextureView.setIvTip(viewHolder.iv_play);
setOnClickListener(viewHolder);
} else {
viewHolder.videoTextureView.setVisibility(View.GONE);
viewHolder.iv_play.setVisibility(View.GONE);
}
viewHolder.author.setText(timeline.getAuthor());
viewHolder.pushTime.setText(timeline.getPushTime());
viewHolder.commentnum.setText(timeline.getCommentnum());
viewHolder.zannum.setText(timeline.getZanNum());
viewHolder.diasance.setText("距离我" + timeline.getDistance());
viewHolder.location.setText(timeline.getLocation());
return convertView;
}
Aggregations