use of com.rideread.rideread.bean.TimeLine 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;
}
use of com.rideread.rideread.bean.TimeLine in project ride-read-android by Ride-Read.
the class AttentionFragment method initData.
private void initData() {
lists = new ArrayList<TimeLine>();
List<Integer> imgsL = new ArrayList<Integer>();
for (int i = 0; i < imgs.length; i++) {
imgsL.add(imgs[i]);
}
lists.add(new TimeLine("涨小明", "56", "10km", true, false, false, imgsL, "广州", "", "6分钟前", null, "10"));
lists.add(new TimeLine("涨小明", "56", "10km", false, true, true, null, "广州", "", "6分钟前", "今天风景很美,我先去看看", "10"));
lists.add(new TimeLine("涨小明", "56", "10km", true, true, false, imgsL, "广州", "", "6分钟前", "哈哈,我到这里了,过来看看", "10"));
lists.add(new TimeLine("涨小明", "56", "10km", false, true, true, null, "广州", "", "6分钟前", "不知道说什么,随便写写", "10"));
lists.add(new TimeLine("涨小明", "56", "10km", false, true, false, null, "广州", "", "6分钟前", "今天风景很美,我先去看看", "10"));
lists.add(new TimeLine("涨小明", "56", "10km", true, true, false, imgsL, "广州", "", "6分钟前", "哈哈,我到这里了,过来看看", "10"));
}
use of com.rideread.rideread.bean.TimeLine in project ride-read-android by Ride-Read.
the class AttentionFragment method initView.
private void initView(View mView) {
listview = (ListView) mView.findViewById(R.id.timeline_attention_listview);
View v = LayoutInflater.from(getActivity().getApplicationContext()).inflate(R.layout.timeline_newmsg_headview, null);
listview.addHeaderView(v);
AttentionListAdapter adapter = new AttentionListAdapter(lists, R.layout.timeline_attention_listitem, getContext());
listview.setAdapter(adapter);
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position == 0) {
Toast.makeText(getContext(), "点击了消息提示", Toast.LENGTH_SHORT).show();
} else {
Intent intent = new Intent(AttentionFragment.this.getActivity(), TimelineDetailsActivity.class);
intent.putExtra("timeline", (TimeLine) parent.getAdapter().getItem(position));
startActivity(intent);
}
}
});
}
Aggregations