예제 #1
0
            public void ReloadUI(QuestionListRow row, UITableView tableView)
            {
                var post = row._post;

                _text.Text    = post.TitleDecoded;
                _details.Text = BclEx.OffsetFromNow(post.creation_date) + " by";
                _author.SetData(row._controller, post.owner);
                _details2.Text = string.Format("{0}\uD83D\uDC4D  {1}\u2606  {2}\uD83D\uDC40  {3} answers  {4} comments", post.score, post.favorite_count, GetViewCount(post.view_count), post.answer_count, post.comments != null ? post.comments.Count : 0);

                if (post.tags != null)
                {
                    if (row.RichTags)
                    {
                        RichTags(post.tags, row);
                    }
                    else
                    {
                        PlainTags(post.tags);
                    }
                }

                float titleHeight = row.GetHeightTitle(tableView);

                _text.Frame         = new RectangleF(6, 0, tableView.Frame.Width - 24, titleHeight);
                _details.Frame      = new RectangleF(6, titleHeight, _details.StringSize(_details.Text, _details.Font).Width, 20);
                _author.Frame       = new RectangleF(_details.Frame.X + _details.Frame.Width + 4, titleHeight, _author.StringSize(_author.Text, _author.Font).Width, 20);
                _details2.Frame     = new RectangleF(6, 20 + titleHeight, tableView.Frame.Width - 24, 20);
                _richDetails2.Frame = new RectangleF(6, 40 + titleHeight, tableView.Frame.Width - 24, 20);
                _tags.Frame         = new RectangleF(6, 40 + titleHeight, tableView.Frame.Width - 24, 20);
            }
예제 #2
0
            public void ReloadUI(AnswerListRow row, UITableView tableView)
            {
                var post = row._post;

                _text.Text = row._body;

                _details.Text = BclEx.OffsetFromNow(post.creation_date) + " by";
                _author.SetData(row._controller, post.owner);
                _details2.Text = string.Format("{0}\uD83D\uDC4D  {1} comments", post.score, post.comments != null ? post.comments.Count : 0);

                float titleHeight = row.GetHeightTitle(tableView);

                _text.Frame     = new RectangleF(6, 0, tableView.Frame.Width - 24, titleHeight);
                _details.Frame  = new RectangleF(6, titleHeight, _details.StringSize(_details.Text, _details.Font).Width, 20);
                _author.Frame   = new RectangleF(_details.Frame.X + _details.Frame.Width + 4, titleHeight, _author.StringSize(_author.Text, _author.Font).Width, 20);
                _details2.Frame = new RectangleF(6, 20 + titleHeight, tableView.Frame.Width - 24, 20);

                if (post.is_accepted)
                {
                    _tick.Frame = new RectangleF(_details2.StringSize(_details2.Text, _details2.Font).Width + 10, _details2.Frame.Y, 20, 20);
                }
                else
                {
                    _tick.Frame = RectangleF.Empty;
                }

                if (row._isDetails)
                {
                    _text.Frame = RectangleF.Empty;
                }
            }
예제 #3
0
            public void ReloadUI(CommentListRow row, UITableView tableView)
            {
                var comment = row._comment;

                _text.Text     = row._body;
                _details.Text  = BclEx.OffsetFromNow(comment.creation_date) + " by";
                _details2.Text = string.Format("{0}\uD83D\uDC4D", comment.score);
                _author.SetData(row._controller, comment.owner);

                float titleHeight = row.GetHeightTitle(tableView);

                _text.Frame     = new RectangleF(6, 0, tableView.Frame.Width - 24, titleHeight);
                _details.Frame  = new RectangleF(6, titleHeight, _details.StringSize(_details.Text, _details.Font).Width, 20);
                _author.Frame   = new RectangleF(_details.Frame.X + _details.Frame.Width + 4, titleHeight, _author.StringSize(_author.Text, _author.Font).Width, 20);
                _details2.Frame = new RectangleF(6, 20 + titleHeight, tableView.Frame.Width - 24, 20);
            }