Search in sources :

Example 1 with StatsViewHolder

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;
}
Also used : StatsPostModel(org.wordpress.android.ui.stats.models.StatsPostModel) StatsViewHolder(org.wordpress.android.ui.stats.StatsViewHolder) View(android.view.View)

Aggregations

View (android.view.View)1 StatsViewHolder (org.wordpress.android.ui.stats.StatsViewHolder)1 StatsPostModel (org.wordpress.android.ui.stats.models.StatsPostModel)1