@@ -5,8 +5,14 @@ import {
55} from '@react-navigation/native' ;
66import { createNativeStackNavigator } from '@react-navigation/native-stack' ;
77import { createStackNavigator } from '@react-navigation/stack' ;
8-
98import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' ;
9+ import Animated , {
10+ Easing ,
11+ useAnimatedStyle ,
12+ useSharedValue ,
13+ withRepeat ,
14+ withTiming ,
15+ } from 'react-native-reanimated' ;
1016
1117// Import the Sentry React Native SDK
1218import * as Sentry from '@sentry/react-native' ;
@@ -22,7 +28,7 @@ import { Provider } from 'react-redux';
2228import { store } from './reduxApp' ;
2329import { GestureHandlerRootView } from 'react-native-gesture-handler' ;
2430import GesturesTracingScreen from './Screens/GesturesTracingScreen' ;
25- import { Platform , StyleSheet } from 'react-native' ;
31+ import { Platform , StyleSheet , View } from 'react-native' ;
2632import { HttpClient } from '@sentry/integrations' ;
2733import Ionicons from 'react-native-vector-icons/Ionicons' ;
2834import PlaygroundScreen from './Screens/PlaygroundScreen' ;
@@ -227,14 +233,59 @@ function BottomTabs() {
227233 } }
228234 />
229235 </ Tab . Navigator >
236+ < RunningIndicator />
230237 </ NavigationContainer >
231238 ) ;
232239}
233240
241+ function RunningIndicator ( ) {
242+ if ( Platform . OS !== 'android' && Platform . OS !== 'ios' ) {
243+ return null ;
244+ }
245+
246+ return < RotatingBox /> ;
247+ }
248+
249+ function RotatingBox ( ) {
250+ const sv = useSharedValue < number > ( 0 ) ;
251+
252+ React . useEffect ( ( ) => {
253+ sv . value = withRepeat (
254+ withTiming ( 360 , {
255+ duration : 1_000_000 ,
256+ easing : Easing . linear ,
257+ } ) ,
258+ - 1 ,
259+ ) ;
260+ // eslint-disable-next-line react-hooks/exhaustive-deps
261+ } , [ ] ) ;
262+
263+ const animatedStyle = useAnimatedStyle ( ( ) => ( {
264+ transform : [ { rotate : `${ sv . value * 360 } deg` } ] ,
265+ } ) ) ;
266+
267+ return (
268+ < View style = { styles . container } >
269+ < Animated . View style = { [ styles . box , animatedStyle ] } />
270+ </ View >
271+ ) ;
272+ }
273+
234274const styles = StyleSheet . create ( {
235275 wrapper : {
236276 flex : 1 ,
237277 } ,
278+ container : {
279+ position : 'absolute' ,
280+ left : 30 ,
281+ top : 30 ,
282+ } ,
283+ box : {
284+ height : 50 ,
285+ width : 50 ,
286+ backgroundColor : '#b58df1' ,
287+ borderRadius : 5 ,
288+ } ,
238289} ) ;
239290
240291export default Sentry . wrap ( BottomTabs ) ;
0 commit comments