Skip to content

Commit

Permalink
Add support for GIFs
Browse files Browse the repository at this point in the history
Summary:
Changelog: [internal]

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

Reviewed By: fkgozali

Differential Revision: D27115321

fbshipit-source-id: c512e395b5c71701b25abf745be74b51b21df5b2
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Mar 17, 2021
1 parent 4b3c8e7 commit 145110b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#import <React/RCTImageResponseDelegate.h>
#import <React/RCTUIImageViewAnimated.h>
#import <React/RCTViewComponentView.h>

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -15,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface RCTImageComponentView : RCTViewComponentView <RCTImageResponseDelegate> {
@protected
UIImageView *_imageView;
RCTUIImageViewAnimated *_imageView;
}

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ - (instancetype)initWithFrame:(CGRect)frame
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;
Expand Down

0 comments on commit 145110b

Please sign in to comment.