public void Bind(AccenageInboxMessage message) { _message = message; _titleTextView.Text = _message.Title; _dateTextView.Text = _message.Date.ToShortDateString() + ", " + _message.Date.ToShortTimeString(); if (_message.Archived) { _coloredIndicatorView.SetBackgroundColor(Color.Red); } else { _coloredIndicatorView.SetBackgroundColor(_message.Read ? Color.Transparent : Color.SkyBlue); } if (!TextUtils.IsEmpty(_message.IconUrl)) { _imageView.SetBackgroundColor(Color.Transparent); Picasso.With(Context).Load(_message.IconUrl).Into(_imageView); } else { _imageView.SetImageDrawable(null); _imageView.SetBackgroundColor(Color.DarkGray); } SetOnClickListener(new OnClick(Context, _message)); }
public OnClick(Context context, AccenageInboxMessage message) { _context = context; _message = message; }
private void LoadMessage(AccenageInboxMessage message, int position) { _messages.Add(message); _inboxAdapter.NotifyDataSetChanged(); }