Android Programming Tutorials

(Romina) #1
Your Friends Seem Remote

}

wrapper.populateFrom(timeline.get(position));

return(row);
}
}

class TimelineEntryWrapper {
private TextView friend=null;
private TextView createdAt=null;
private TextView status=null;
private View row=null;

TimelineEntryWrapper(View row) {
this.row=row;
}

void populateFrom(TimelineEntry s) {
getFriend().setText(s.friend);
getCreatedAt().setText(s.createdAt);
getStatus().setText(s.status);
}

TextView getFriend() {
if (friend==null) {
friend=(TextView)row.findViewById(R.id.friend);
}

return(friend);
}

TextView getCreatedAt() {
if (createdAt==null) {
createdAt=(TextView)row.findViewById(R.id.created_at);
}

return(createdAt);
}

TextView getStatus() {
if (status==null) {
status=(TextView)row.findViewById(R.id.status);
}

return(status);
}
}
}

And here is an implementation of PostMonitor after making this tutorial's


modifications:


214
Free download pdf