use of org.wordpress.android.ui.stats.StatsViewHolder in project WordPress-Android by wordpress-mobile.
the class PostsAndPagesAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View rowView = convertView;
// reuse views
if (rowView == null) {
rowView = inflater.inflate(R.layout.stats_list_cell, parent, false);
// configure view holder
StatsViewHolder viewHolder = new StatsViewHolder(rowView);
rowView.setTag(viewHolder);
}
final StatsPostModel currentRowData = list.get(position);
StatsViewHolder holder = (StatsViewHolder) rowView.getTag();
// Entry
holder.setEntryTextOpenDetailsPage(currentRowData);
// Setup the more button
holder.setMoreButtonOpenInReader(currentRowData);
// totals
holder.totalsTextView.setText(FormatUtils.formatDecimal(currentRowData.getTotals()));
// no icon
holder.networkImageView.setVisibility(View.GONE);
return rowView;
}
Aggregations