Explore typing notifications inspired by web

- prevent timeline from going up and down by keeping the space allocated for the typing notification
This commit is contained in:
Gil Eluard
2021-03-29 22:26:03 +02:00
parent be14710fde
commit fd7d69c39d
3 changed files with 19 additions and 4 deletions
+15 -2
View File
@@ -4109,9 +4109,22 @@ NSNotificationName const RoomCallTileTappedNotification = @"RoomCallTileTappedNo
if (needsUpdate)
{
BOOL needsReload = roomDataSource.currentTypingUsers == nil;
roomDataSource.currentTypingUsers = typingUsers;
[self.bubblesTableView reloadData];
if (self.isScrollToBottomHidden)
if (needsReload)
{
[self.bubblesTableView reloadData];
}
else
{
NSInteger count = [self.roomDataSource tableView:self.bubblesTableView numberOfRowsInSection:0];
NSIndexPath *lastIndexPath = [NSIndexPath indexPathForRow:count - 1 inSection:0];
[self.bubblesTableView reloadRowsAtIndexPaths:@[lastIndexPath] withRowAnimation:UITableViewRowAnimationFade];
}
if (self.isScrollToBottomHidden
&& !self.bubblesTableView.isDragging
&& !self.bubblesTableView.isDecelerating)
{
NSInteger count = [self.roomDataSource tableView:self.bubblesTableView numberOfRowsInSection:0];
if (count)