diff --git a/Examples/UIExplorer/js/NativeAnimationsExample.js b/Examples/UIExplorer/js/NativeAnimationsExample.js index a45986ee9a84..cbf0b7b394fe 100644 --- a/Examples/UIExplorer/js/NativeAnimationsExample.js +++ b/Examples/UIExplorer/js/NativeAnimationsExample.js @@ -352,12 +352,12 @@ exports.examples = [ }, }, { - title: 'Opacity without interpolation', + title: 'Opacity with delay', render: function() { return ( + config={{ duration: 1000, delay: 1000 }}> {anim => ( *_frames; CGFloat _toValue; CGFloat _fromValue; - NSTimeInterval _delay; NSTimeInterval _animationStartTime; NSTimeInterval _animationCurrentTime; RCTResponseSenderBlock _callback; @@ -46,14 +45,12 @@ - (instancetype)initWithId:(NSNumber *)animationId { if ((self = [super init])) { NSNumber *toValue = [RCTConvert NSNumber:config[@"toValue"]] ?: @1; - NSTimeInterval delay = [RCTConvert double:config[@"delay"]]; NSArray *frames = [RCTConvert NSNumberArray:config[@"frames"]]; _animationId = animationId; _toValue = toValue.floatValue; _fromValue = valueNode.value; _valueNode = valueNode; - _delay = delay; _frames = [frames copy]; _callback = [callback copy]; } @@ -93,16 +90,9 @@ - (void)stepAnimation } NSTimeInterval currentTime = CACurrentMediaTime(); - NSTimeInterval stepInterval = currentTime - _animationCurrentTime; _animationCurrentTime = currentTime; NSTimeInterval currentDuration = _animationCurrentTime - _animationStartTime; - if (_delay > 0) { - // Decrement delay - _delay -= stepInterval; - return; - } - // Determine how many frames have passed since last update. // Get index of frames that surround the current interval NSUInteger startIndex = floor(currentDuration / SINGLE_FRAME_INTERVAL);