Beispiel #1
0
        public void UpdateCell(Twitt twitt)
        {
            _currentTwitt = twitt;
            SetUserImage();

            TextLabel.Text = twitt.User.Name;
            DetailTextLabel.Text = twitt.Text;

            SetTime(twitt);
        }
Beispiel #2
0
        public void DownloadImageForTwitt(Twitt twitt, Action<UIImage, Twitt> callBack)
        {
            var request = new RestRequest(twitt.User.ProfileImageUrl);

            client.ExecuteAsync(request, response =>
            {
                using (var data = NSData.FromArray(response.RawBytes))
                {
                    callBack(UIImage.LoadFromData(data), twitt);
                }
            });
        }
Beispiel #3
0
 public TweetScreenController(Twitt twitt)
     : base("TweetScreenController", null)
 {
     _twitt = twitt;
     HidesBottomBarWhenPushed = true;
 }
Beispiel #4
0
        private void SetTime(Twitt twitt)
        {
            var diffTime = DateTime.Now - twitt.TimeOfCreating;

            if (diffTime.Days > 0)
            {
                _dateTimeLabel.Text = diffTime.Days + " д";
                return;
            }
            if (diffTime.Hours > 0)
            {
                _dateTimeLabel.Text = diffTime.Hours + " ч";
                return;
            }
            if (diffTime.Minutes > 0)
            {
                _dateTimeLabel.Text = diffTime.Minutes + " м";
                return;
            }
            if (diffTime.Seconds > 0)
            {
                _dateTimeLabel.Text = diffTime.Seconds + " с";
                return;
            }
        }
 private void OnCellSelected(Twitt twitt)
 {
     var tweetController = new TweetScreenController(twitt);
     NavigationController.PushViewController(tweetController, true);
     TableWithTweets.DeselectRow(TableWithTweets.IndexPathForSelectedRow, false);
 }
Beispiel #6
0
 private void OnCellSelected(Twitt twitt)
 {
     if (CellSelected != null)
         CellSelected.Invoke(twitt);
 }