|
|
@ -2,15 +2,16 @@
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#import "FLAnimatedImage.h"
|
|
|
|
|
|
|
|
#import "FullImageViewController.h"
|
|
|
|
#import "FullImageViewController.h"
|
|
|
|
#import "UIUtil.h"
|
|
|
|
#import "AttachmentSharing.h"
|
|
|
|
#import "UIView+OWS.h"
|
|
|
|
#import "FLAnimatedImage.h"
|
|
|
|
#import "TSPhotoAdapter.h"
|
|
|
|
#import "NSData+Image.h"
|
|
|
|
#import "TSMessageAdapter.h"
|
|
|
|
|
|
|
|
#import "TSAnimatedAdapter.h"
|
|
|
|
#import "TSAnimatedAdapter.h"
|
|
|
|
|
|
|
|
#import "TSMessageAdapter.h"
|
|
|
|
|
|
|
|
#import "TSPhotoAdapter.h"
|
|
|
|
#import "UIColor+OWS.h"
|
|
|
|
#import "UIColor+OWS.h"
|
|
|
|
#import "AttachmentSharing.h"
|
|
|
|
#import "UIUtil.h"
|
|
|
|
|
|
|
|
#import "UIView+OWS.h"
|
|
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
|
@ -168,14 +169,18 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
|
|
- (void)initializeImageView {
|
|
|
|
- (void)initializeImageView {
|
|
|
|
if (self.isAnimated) {
|
|
|
|
if (self.isAnimated) {
|
|
|
|
// Present the animated image using Flipboard/FLAnimatedImage
|
|
|
|
if ([self.fileData isValidImage]) {
|
|
|
|
FLAnimatedImage *animatedGif = [FLAnimatedImage animatedImageWithGIFData:self.fileData];
|
|
|
|
// Present the animated image using Flipboard/FLAnimatedImage
|
|
|
|
FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];
|
|
|
|
FLAnimatedImage *animatedGif = [FLAnimatedImage animatedImageWithGIFData:self.fileData];
|
|
|
|
imageView.animatedImage = animatedGif;
|
|
|
|
FLAnimatedImageView *imageView = [[FLAnimatedImageView alloc] init];
|
|
|
|
imageView.frame = self.originRect;
|
|
|
|
imageView.animatedImage = animatedGif;
|
|
|
|
imageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
imageView.frame = self.originRect;
|
|
|
|
imageView.clipsToBounds = YES;
|
|
|
|
imageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
self.imageView = imageView;
|
|
|
|
imageView.clipsToBounds = YES;
|
|
|
|
|
|
|
|
self.imageView = imageView;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
self.imageView = [[UIImageView alloc] initWithFrame:self.originRect];
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// Present the static image using standard UIImageView
|
|
|
|
// Present the static image using standard UIImageView
|
|
|
|
self.imageView = [[UIImageView alloc] initWithFrame:self.originRect];
|
|
|
|
self.imageView = [[UIImageView alloc] initWithFrame:self.originRect];
|
|
|
|