|
1 | 1 | import React, {useState} from 'react'; |
2 | | -import {InteractionManager} from 'react-native'; |
3 | 2 | import {Easing, interpolate, interpolateColor, runOnJS, useAnimatedStyle, useSharedValue, withDelay, withSequence, withTiming} from 'react-native-reanimated'; |
4 | 3 | import useScreenWrapperTransitionStatus from '@hooks/useScreenWrapperTransitionStatus'; |
5 | 4 | import useTheme from '@hooks/useTheme'; |
@@ -95,27 +94,25 @@ export default function useAnimatedHighlightStyle({ |
95 | 94 | return; |
96 | 95 | } |
97 | 96 | setStartHighlight(false); |
98 | | - InteractionManager.runAfterInteractions(() => { |
99 | | - runOnJS(() => { |
100 | | - nonRepeatableProgress.set( |
101 | | - withDelay( |
102 | | - itemEnterDelay, |
103 | | - withTiming(1, {duration: itemEnterDuration, easing: Easing.inOut(Easing.ease)}, (finished) => { |
104 | | - if (!finished) { |
105 | | - return; |
106 | | - } |
107 | | - |
108 | | - repeatableProgress.set( |
109 | | - withSequence( |
110 | | - withDelay(highlightStartDelay, withTiming(1, {duration: highlightStartDuration, easing: Easing.inOut(Easing.ease)})), |
111 | | - withDelay(highlightEndDelay, withTiming(0, {duration: highlightEndDuration, easing: Easing.inOut(Easing.ease)})), |
112 | | - ), |
113 | | - ); |
114 | | - }), |
115 | | - ), |
116 | | - ); |
117 | | - })(); |
118 | | - }); |
| 97 | + runOnJS(() => { |
| 98 | + nonRepeatableProgress.set( |
| 99 | + withDelay( |
| 100 | + itemEnterDelay, |
| 101 | + withTiming(1, {duration: itemEnterDuration, easing: Easing.inOut(Easing.ease)}, (finished) => { |
| 102 | + if (!finished) { |
| 103 | + return; |
| 104 | + } |
| 105 | + |
| 106 | + repeatableProgress.set( |
| 107 | + withSequence( |
| 108 | + withDelay(highlightStartDelay, withTiming(1, {duration: highlightStartDuration, easing: Easing.inOut(Easing.ease)})), |
| 109 | + withDelay(highlightEndDelay, withTiming(0, {duration: highlightEndDuration, easing: Easing.inOut(Easing.ease)})), |
| 110 | + ), |
| 111 | + ); |
| 112 | + }), |
| 113 | + ), |
| 114 | + ); |
| 115 | + })(); |
119 | 116 | }, [ |
120 | 117 | didScreenTransitionEnd, |
121 | 118 | startHighlight, |
|
0 commit comments