Add support for GIFs

Summary:
Changelog: [internal]

Add support or GIFs in Fabric. This reuses Paper's `RCTUIImageViewAnimated`.

Reviewed By: fkgozali

Differential Revision: D27115321

fbshipit-source-id: c512e395b5c71701b25abf745be74b51b21df5b2
This commit is contained in:
Samuel Susla
2021-03-17 14:22:40 -07:00
committed by Facebook GitHub Bot
parent 4b3c8e76b2
commit 145110b8d4
2 changed files with 3 additions and 2 deletions
@@ -6,6 +6,7 @@
*/
#import <React/RCTImageResponseDelegate.h>
#import <React/RCTUIImageViewAnimated.h>
#import <React/RCTViewComponentView.h>
NS_ASSUME_NONNULL_BEGIN
@@ -15,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface RCTImageComponentView : RCTViewComponentView <RCTImageResponseDelegate> {
@protected
UIImageView *_imageView;
RCTUIImageViewAnimated *_imageView;
}
@end
@@ -30,7 +30,7 @@ using namespace facebook::react;
static auto const defaultProps = std::make_shared<ImageProps const>();
_props = defaultProps;
_imageView = [[UIImageView alloc] initWithFrame:self.bounds];
_imageView = [RCTUIImageViewAnimated new];
_imageView.clipsToBounds = YES;
_imageView.contentMode = RCTContentModeFromImageResizeMode(defaultProps->resizeMode);
_imageView.layer.minificationFilter = kCAFilterTrilinear;