mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Clear highlighted event when view gone
This commit is contained in:
parent
42185a2ec2
commit
9eef855e7c
1 changed files with 24 additions and 18 deletions
|
@ -658,6 +658,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
|||
[self cancelEventSelection];
|
||||
}
|
||||
}
|
||||
[self cancelEventHighlight];
|
||||
|
||||
// Hide preview header to restore navigation bar settings
|
||||
[self showPreviewHeader:NO];
|
||||
|
@ -4526,24 +4527,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
|||
[super scrollViewWillBeginDragging:scrollView];
|
||||
}
|
||||
|
||||
// if data source is highlighting an event, dismiss the highlight when user dragges the table view
|
||||
if (customizedRoomDataSource.highlightedEventId)
|
||||
{
|
||||
NSInteger row = [self.roomDataSource indexOfCellDataWithEventId:customizedRoomDataSource.highlightedEventId];
|
||||
if (row == NSNotFound)
|
||||
{
|
||||
customizedRoomDataSource.highlightedEventId = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0];
|
||||
if ([[self.bubblesTableView indexPathsForVisibleRows] containsObject:indexPath])
|
||||
{
|
||||
customizedRoomDataSource.highlightedEventId = nil;
|
||||
[self.bubblesTableView reloadRowsAtIndexPaths:@[indexPath]
|
||||
withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
}
|
||||
}
|
||||
[self cancelEventHighlight];
|
||||
}
|
||||
|
||||
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
|
||||
|
@ -6452,6 +6436,28 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)cancelEventHighlight
|
||||
{
|
||||
// if data source is highlighting an event, dismiss the highlight when user dragges the table view
|
||||
if (customizedRoomDataSource.highlightedEventId)
|
||||
{
|
||||
NSInteger row = [self.roomDataSource indexOfCellDataWithEventId:customizedRoomDataSource.highlightedEventId];
|
||||
if (row == NSNotFound)
|
||||
{
|
||||
customizedRoomDataSource.highlightedEventId = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0];
|
||||
if ([[self.bubblesTableView indexPathsForVisibleRows] containsObject:indexPath])
|
||||
{
|
||||
customizedRoomDataSource.highlightedEventId = nil;
|
||||
[self.bubblesTableView reloadRowsAtIndexPaths:@[indexPath]
|
||||
withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateThreadListBarButtonBadgeWith:(MXThreadingService *)service
|
||||
{
|
||||
if (!threadListBarButtonItem || !service)
|
||||
|
|
Loading…
Reference in a new issue