import { useEffect } from 'react'; import { StyleSheet, View } from 'react-native'; import { widthPercentageToDP as wp } from 'react-native-responsive-screen'; import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated'; import Svg, { Path, Rect } from 'react-native-svg'; const BatterySvg = () => ( ); const RippleEffectBatteryIcon = () => { const scaleValue = useSharedValue(1); const opacityValue = useSharedValue(1); const textScaleValue = useSharedValue(0.4); const animatedCircle = useAnimatedStyle(() => { return { transform: [{ scale: scaleValue.value }], opacity: opacityValue.value }; }); const startRippleAnimation = () => { scaleValue.value = withRepeat(withTiming(3, { duration: 2000 }), -1); opacityValue.value = withRepeat(withTiming(0, { duration: 2000 }), -1); textScaleValue.value = withRepeat( withTiming(1, { duration: 10000 }), -1 ); }; useEffect(() => { startRippleAnimation(); }, []); return ( ); }; export default RippleEffectBatteryIcon; const styles = StyleSheet.create({ innerCircle: { width: '100%', height: '100%', borderRadius: 200, backgroundColor: '#025c72', justifyContent: 'center' }, innerText: { fontSize: 14, alignSelf: 'center', fontWeight: 'bold', position: 'absolute', top: wp(10) } });