Ejemplo n.º 1
0
        public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
        {
            ListItem msg = messages[indexPath.Row];

            if (msg.getType() == 1)
            {
                List <ChatAttachment> AttachList = new List <ChatAttachment>();

                GeneralItem GeneralItem = (GeneralItem)msg;

                var item = GeneralItem.getChatMessagearray();
                AttachList = (item.ChatMessageId != 0) ? Repositories.ChatAttachmentRepository.GetChatAttachList(item.ChatMessageId) : new List <ChatAttachment>();
                if (AttachList.Count > 0)
                {
                    return(ChatBubbleWithAttachmentCell.GetHeight(tableView, item.MessageText, "10:11 PM").Height);
                }
                else
                {
                    return(ChatBubbleCell.GetHeight(tableView, item.MessageText, "10:11 PM").Height);
                }
            }
            else
            {
                return(32);
            }// return ChatBubbleCell.GetSizeForText(tableView, messages[indexPath.Row].Text).Height + ChatBubbleCell.BubblePadding.Height;
             //Message msg = messages[indexPath.Row];
             //return CalculateHeightFor(msg, tableView);
        }
Ejemplo n.º 2
0
        public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
        {
            ListItem msg = messages[indexPath.Row];

            if (msg.getType() == 1)
            {
                List <GroupAttachment> AttachList = new List <GroupAttachment>();

                GeneralGroupItem GeneralItem = (GeneralGroupItem)msg;
                var item = GeneralItem.getChatMessagearray();

                AttachList = (item.MessageId != 0) ? Repositories.GroupRepository.GetGroupMessageAttachList(item.MessageId) : new List <GroupAttachment>();
                Boolean isMe = item.SenderUserId == Common.CommonHelper.GetUserId();
                if (!isMe)
                {
                    if (AttachList.Count > 0)
                    {
                        return(GroupChatBubbleWithAttachmentCell.GetHeight(tableView, item.MessageText, "10:11 PM").Height);
                    }
                    else
                    {
                        return(GroupChatBubbleCell.GetHeight(tableView, item.MessageText, "10:11 PM").Height);
                    }
                }
                else
                {
                    if (AttachList.Count > 0)
                    {
                        return(ChatBubbleWithAttachmentCell.GetHeight(tableView, item.MessageText, "10:11 PM").Height);
                    }
                    else
                    {
                        return(ChatBubbleCell.GetHeight(tableView, item.MessageText, "10:11 PM").Height);
                    }
                }
            }
            else
            {
                return(32);
            }
        }