package foundation.e.mail.fragment;


import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.ImageView;

import foundation.e.mail.R;
import foundation.e.mail.RoundedQuickContactBadge;

public class MessageViewHolder implements View.OnClickListener {
    private final MessageListFragment fragment;
    public TextView subject;
    public TextView preview;
    public TextView from;
    public ImageView replyStatusImageView;
    public ImageView attachmentImageView;
    public TextView time;
    public TextView date;
    public ImageView starImageView;
    public TextView threadCount;
    public CheckBox selected;
    public int position = -1;
    public RoundedQuickContactBadge contactBadge;

    public MessageViewHolder(MessageListFragment fragment)
    {
        this.fragment = fragment;
    }

    @Override
    public void onClick(View view) {
        if (position != -1) {
            switch (view.getId()) {
                case R.id.selected_checkbox:
                    fragment.toggleMessageSelectWithAdapterPosition(position);
                    break;
            }
        }
    }
}
