mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 10:32:46 +02:00
* Fixed a glitch in media viewer when dismissing a GIF: the WebView which shows the animation would show in the background while the transition interaction occurred * adding the changelog entry Signed-off-by: Milton Moura <miltonmoura@gmail.com>
This commit is contained in:
@@ -701,7 +701,7 @@
|
||||
width = minSize;
|
||||
height = minSize;
|
||||
}
|
||||
|
||||
|
||||
WKWebView *animatedGifViewer = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
|
||||
animatedGifViewer.center = cell.customView.center;
|
||||
animatedGifViewer.opaque = NO;
|
||||
@@ -1379,6 +1379,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MXKDestinationAttachmentAnimatorDelegate
|
||||
|
||||
- (BOOL)prepareSubviewsForTransition:(BOOL)isStartInteraction
|
||||
{
|
||||
MXKMediaCollectionViewCell *cell = (MXKMediaCollectionViewCell *)[self.attachmentsCollection.visibleCells firstObject];
|
||||
MXKAttachment *attachment = attachments[currentVisibleItemIndex];
|
||||
NSString *mimeType = attachment.contentInfo[@"mimetype"];
|
||||
|
||||
// Check attachment type for GIFs - this is required because of the extra WKWebView
|
||||
if (attachment.type == MXKAttachmentTypeImage && attachment.contentURL && [mimeType isEqualToString:@"image/gif"])
|
||||
{
|
||||
UIView *customView = cell.customView;
|
||||
for (UIView *v in customView.subviews)
|
||||
{
|
||||
if ([v isKindOfClass:[WKWebView class]])
|
||||
{
|
||||
v.hidden = isStartInteraction;
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (UIImageView *)finalImageView
|
||||
{
|
||||
MXKMediaCollectionViewCell *cell = (MXKMediaCollectionViewCell *)[self.attachmentsCollection.visibleCells firstObject];
|
||||
|
||||
Reference in New Issue
Block a user