RoomVC: ContextualMenu: Plug reactions menu

This commit is contained in:
manuroe
2019-05-17 12:10:32 +02:00
parent cc8862b6f1
commit 2401c7a129
4 changed files with 87 additions and 1 deletions
+17
View File
@@ -5076,6 +5076,18 @@
completion:^{
[self contextualMenuAnimationCompletionAfterBeingShown:YES];
}];
if ([cell isKindOfClass:MXKRoomBubbleTableViewCell.class])
{
// Note: For the moment, we use the frame of the cell instead of the component
// From UI perpective, that means the menu will be around a paragraph instead of a message
// This is not bad as the paragraph is kept visible to provide more context to the user
// TO FIX: if paragraph is bigger than the screen, the menu is displayed in the middle
CGRect frame = ((MXKRoomBubbleTableViewCell*)cell).frame;
frame = [self.bubblesTableView convertRect:frame toView:[self.bubblesTableView superview]];
[self.roomContextualMenuPresenter showReactionsMenuForEvent:event.eventId inRoom:event.roomId session:self.mainSession aroundFrame:frame];
}
}
- (void)hideContextualMenuAnimated:(BOOL)animated
@@ -5124,5 +5136,10 @@
[self hideContextualMenuAnimated:YES];
}
- (void)roomContextualMenuViewControllerDidReaction:(RoomContextualMenuViewController *)viewController
{
[self hideContextualMenuAnimated:YES];
}
@end