mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Merge pull request #6936 from vector-im/alfogrillo/improve_link_tappability
Improve external links interaction UX (PSG-819)
This commit is contained in:
commit
57ea73a5d7
3 changed files with 18 additions and 9 deletions
|
@ -4593,6 +4593,9 @@ static CGSize kThreadListBarButtonItemImageSize;
|
|||
// Do nothing for dummy links
|
||||
shouldDoAction = NO;
|
||||
break;
|
||||
case RoomMessageURLTypeHttp:
|
||||
shouldDoAction = YES;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
MXEvent *tappedEvent = userInfo[kMXKRoomBubbleCellEventKey];
|
||||
|
@ -4618,6 +4621,9 @@ static CGSize kThreadListBarButtonItemImageSize;
|
|||
break;
|
||||
case UITextItemInteractionPresentActions:
|
||||
{
|
||||
if (roomMessageURLType == RoomMessageURLTypeHttp) {
|
||||
shouldDoAction = YES;
|
||||
} else {
|
||||
// Retrieve the tapped event
|
||||
MXEvent *tappedEvent = userInfo[kMXKRoomBubbleCellEventKey];
|
||||
|
||||
|
@ -4629,6 +4635,7 @@ static CGSize kThreadListBarButtonItemImageSize;
|
|||
|
||||
shouldDoAction = NO;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case UITextItemInteractionPreview:
|
||||
// Force touch on link, let MXKRoomBubbleTableViewCell UITextView use default peek and pop behavior.
|
||||
|
|
|
@ -237,6 +237,7 @@ static BOOL _disableLongPressGestureOnEvent;
|
|||
[tapGesture setDelegate:self];
|
||||
[self.messageTextView addGestureRecognizer:tapGesture];
|
||||
self.messageTextView.userInteractionEnabled = YES;
|
||||
self.messageTextView.clipsToBounds = NO;
|
||||
|
||||
// Recognise and make tappable phone numbers, address, etc.
|
||||
self.messageTextView.dataDetectorTypes = UIDataDetectorTypeAll;
|
||||
|
|
1
changelog.d/pr-6936.change
Normal file
1
changelog.d/pr-6936.change
Normal file
|
@ -0,0 +1 @@
|
|||
Improves external links interaction UX.
|
Loading…
Reference in a new issue