Пример #1
0
        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));
        }
Пример #2
0
 public OnClick(Context context, AccenageInboxMessage message)
 {
     _context = context;
     _message = message;
 }
Пример #3
0
 private void LoadMessage(AccenageInboxMessage message, int position)
 {
     _messages.Add(message);
     _inboxAdapter.NotifyDataSetChanged();
 }