forked from mirrors/linphone-iphone
Fix scrollBadge and markAsRead in chat conversation
This commit is contained in:
parent
54fb56d93c
commit
6cb4ea55f6
2 changed files with 8 additions and 0 deletions
|
|
@ -380,6 +380,13 @@ static const int BASIC_EVENT_LIST=15;
|
|||
[_chatRoomDelegate tableViewIsScrolling];
|
||||
}
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (scrollView.contentOffset.y >= (scrollView.contentSize.height - scrollView.frame.size.height)) {
|
||||
if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive)
|
||||
[ChatConversationView markAsRead:_chatRoom];
|
||||
}
|
||||
}
|
||||
|
||||
static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f;
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
|
|
|||
|
|
@ -1451,6 +1451,7 @@ void on_chat_room_chat_message_received(LinphoneChatRoom *cr, const LinphoneEven
|
|||
if (isDisplayingBottomOfTable) {
|
||||
[view.tableController scrollToBottom:TRUE];
|
||||
} else {
|
||||
[[view.tableController scrollBadge] setHidden:FALSE];
|
||||
int unread_msg = linphone_chat_room_get_unread_messages_count(cr);
|
||||
[[view.tableController scrollBadge] setText:[NSString stringWithFormat:@"%d", unread_msg]];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue