react-native APIs
- View
- StyleSheet
- Text
- Platform
- TouchableOpacity
- ScrollView
- Image
- ViewStyle
- Dimensions
- StatusBar
- TextInput
- FlatList
- SafeAreaView
- TextStyle
- ActivityIndicator
- Alert
- StyleProp
- Animated
- Linking
- TouchableWithoutFeedback
- Button
- NativeModules
- KeyboardAvoidingView
- TextInputProps
- ViewProps
- Keyboard
- Easing
- ImageBackground
- TextProps
- LayoutChangeEvent
- NativeSyntheticEvent
- NativeEventEmitter
- Switch
- AppRegistry
- ImageStyle
- ImageSourcePropType
- TouchableOpacityProps
- Modal
- AppState
- RefreshControl
- TouchableHighlight
- BackHandler
- useWindowDimensions
- GestureResponderEvent
- AppStateStatus
- PixelRatio
- useColorScheme
- SectionList
- Pressable
- AsyncStorage
- UIManager
- I18nManager
- ImageProps
- LogBox
- FlatListProps
- LayoutRectangle
- findNodeHandle
- EmitterSubscription
- requireNativeComponent
- PermissionsAndroid
- InteractionManager
- ScrollViewProps
- TextInputFocusEventData
- Share
- ColorSchemeName
- ScaledSize
- Clipboard
- Insets
- NativeScrollEvent
- ListRenderItem
- LayoutAnimation
- TouchableNativeFeedback
- PanResponder
- SectionListData
- ListRenderItemInfo
- AccessibilityRole
- AccessibilityInfo
- ImageURISource
- ViewToken
- SectionListProps
- DeviceEventEmitter
- KeyboardEvent
- ActionSheetIOS
- processColor
- YellowBox
- DevSettings
- Slider
- ViewabilityConfig
- AccessibilityState
- EventSubscription
- Permission
- TextInputSelectionChangeEventData
- EasingFunction
- TouchableHighlightProps
- TextInputSubmitEditingEventData
- TextInputChangeEventData
- Appearance
- KeyboardTypeOptions
- AccessibilityEvent
- NativeScrollPoint
- ActionSheetIOSOptions
- HostComponent
- PlatformOSType
- ITheme
- IThemeColors
- IThemeFonts
- IThemeLayout
- IThemeUtils
- ViewPropTypes
- SectionListRenderItem
- NativeAppEventEmitter
- Picker
- VirtualizedList
- SectionListRenderItemInfo
- TextInputKeyPressEventData
- ShareAction
- ImageErrorEventData
- ProgressViewIOS
- ProgressBarAndroid
- RotateXTransform
- RotateYTransform
- PerpectiveTransform
- RotateTransform
- RotateZTransform
- ScaleTransform
- ScaleXTransform
- ScaleYTransform
- TranslateXTransform
- TranslateYTransform
- SkewXTransform
- SkewYTransform
- TransformsStyle
- NativeModulesStatic
- CheckBox
Other Related APIs
react-native#EasingFunction TypeScript Examples
The following examples show how to use
react-native#EasingFunction.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnimatedCircularProgress.tsx From react-native-jigsaw with MIT License | 5 votes |
AnimatedCircularProgress: React.FC<Props> = ({
duration = 500,
easing = Easing.out(Easing.ease),
fill,
prefill = 0,
useNativeDriver = false,
tintColorSecondary,
onAnimationComplete,
tintColor = "black",
...other
}) => {
const [fillAnimation] = React.useState<Animated.Value>(
new Animated.Value(prefill)
);
const animate = React.useCallback(
(
toVal: number = -1,
dur?: number,
ease?: EasingFunction
): Animated.CompositeAnimation => {
const toValue = toVal >= 0 ? toVal : fill;
const dura = dur || duration;
const eas = ease || easing;
const useNative = useNativeDriver;
const anim = Animated.timing(fillAnimation, {
useNativeDriver: useNative,
toValue,
easing: eas,
duration: dura,
});
anim.start(onAnimationComplete);
return anim;
},
[
duration,
easing,
fill,
useNativeDriver,
fillAnimation,
onAnimationComplete,
]
);
const animateColor = () => {
if (!tintColorSecondary) {
return tintColor;
}
const tintAnimation = fillAnimation.interpolate({
inputRange: [0, 100],
outputRange: [tintColor, tintColorSecondary],
});
return tintAnimation;
};
React.useEffect(() => {
animate();
}, [fill, animate]);
return (
<AnimatedProgress
{...other}
style={other.style as Animated.WithAnimatedValue<StyleProp<ViewStyle>>}
childrenContainerStyle={
other.childrenContainerStyle as Animated.WithAnimatedValue<
StyleProp<ViewStyle>
>
}
fill={fillAnimation}
tintColor={animateColor()}
/>
);
}