shakebug-react-native 2.4.7 → 2.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/shakebug/DrawingView.java +8 -3
- package/android/src/main/java/com/shakebug/RecordScreenModule.java +1 -2
- package/android/src/main/java/com/shakebug/ViewShot.java +5 -2
- package/package.json +1 -1
- package/shakebug-react-native-2.4.8.tgz +0 -0
- package/src/APIs/AddIssue.js +11 -1
- package/src/Componanats/CustomAlert.js +2 -6
- package/src/Componanats/ErrorHandler.js +10 -1
- package/src/Componanats/NavigationContext.js +8 -11
- package/src/Componanats/ShakeFunction.js +3 -2
- package/src/Screens/AddDetailsScreen.js +44 -45
- package/src/Screens/FirstScreen.js +248 -249
- package/src/Screens/Shakebug.js +62 -35
- package/src/index.tsx +15 -18
|
@@ -34,8 +34,13 @@ public class DrawingView extends View {
|
|
|
34
34
|
if (bitmap != null) {
|
|
35
35
|
bitmap.recycle();
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
if (w > 0 && h > 0) {
|
|
38
|
+
bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
|
|
39
|
+
canvas = new Canvas(bitmap);
|
|
40
|
+
} else {
|
|
41
|
+
bitmap = null;
|
|
42
|
+
canvas = null;
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
@Override
|
|
@@ -81,7 +86,7 @@ public class DrawingView extends View {
|
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
public void clearCanvas() {
|
|
84
|
-
if (canvas != null) {
|
|
89
|
+
if (canvas != null && bitmap != null && bitmap.getWidth() > 0 && bitmap.getHeight() > 0) {
|
|
85
90
|
bitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
|
86
91
|
canvas = new Canvas(bitmap);
|
|
87
92
|
invalidate();
|
|
@@ -51,6 +51,7 @@ public class RecordScreenModule extends ReactContextBaseJavaModule implements HB
|
|
|
51
51
|
|
|
52
52
|
public RecordScreenModule(ReactApplicationContext reactContext) {
|
|
53
53
|
super(reactContext);
|
|
54
|
+
reactContext.addActivityEventListener(mActivityEventListener);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
@NonNull
|
|
@@ -90,7 +91,6 @@ public class RecordScreenModule extends ReactContextBaseJavaModule implements HB
|
|
|
90
91
|
|
|
91
92
|
@ReactMethod
|
|
92
93
|
public void setup(ReadableMap readableMap) {
|
|
93
|
-
new Application().onCreate();
|
|
94
94
|
screenWidth = readableMap.hasKey("width") ? (int) Math.ceil(readableMap.getDouble("width")) : 0;
|
|
95
95
|
screenHeight = readableMap.hasKey("height") ? (int) Math.ceil(readableMap.getDouble("height")) : 0;
|
|
96
96
|
mic = readableMap.hasKey("mic") && readableMap.getBoolean("mic");
|
|
@@ -117,7 +117,6 @@ public class RecordScreenModule extends ReactContextBaseJavaModule implements HB
|
|
|
117
117
|
hbRecorder.setVideoEncoder("DEFAULT");
|
|
118
118
|
}
|
|
119
119
|
hbRecorder.isAudioEnabled(mic);
|
|
120
|
-
getReactApplicationContext().addActivityEventListener(mActivityEventListener);
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
private void startRecordingScreen() {
|
|
@@ -351,10 +351,13 @@ public class ViewShot implements UIBlock {
|
|
|
351
351
|
|
|
352
352
|
// evaluate real height
|
|
353
353
|
if (snapshotContentContainer) {
|
|
354
|
-
|
|
354
|
+
int evaluatedHeight = 0;
|
|
355
355
|
ScrollView scrollView = (ScrollView) view;
|
|
356
356
|
for (int i = 0; i < scrollView.getChildCount(); i++) {
|
|
357
|
-
|
|
357
|
+
evaluatedHeight += scrollView.getChildAt(i).getHeight();
|
|
358
|
+
}
|
|
359
|
+
if (evaluatedHeight > 0) {
|
|
360
|
+
h = evaluatedHeight;
|
|
358
361
|
}
|
|
359
362
|
}
|
|
360
363
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shakebug-react-native",
|
|
3
3
|
"title": "shakebug-react-native",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.9",
|
|
5
5
|
"description": "Shakebug allows users to report the bug from your mobile phone for your application. Here users just need to shake their mobile and all the data regarding bugs & crashes can be seen by developers through their log in panel easily",
|
|
6
6
|
"main": "src/index.tsx",
|
|
7
7
|
"types": "src/index.tsx",
|
|
Binary file
|
package/src/APIs/AddIssue.js
CHANGED
|
@@ -27,7 +27,17 @@ async function AddIssueApi(session_id, application_id, path, isVideo, desc, emai
|
|
|
27
27
|
let bugtypes = "bug";
|
|
28
28
|
let created = new Date().toLocaleString();
|
|
29
29
|
let appversion = DeviceInfo.getVersion();
|
|
30
|
-
let
|
|
30
|
+
let totalMemory = await DeviceInfo.getTotalMemory();
|
|
31
|
+
let usedMemory = await DeviceInfo.getUsedMemory();
|
|
32
|
+
let memoryInBytes = totalMemory - usedMemory;
|
|
33
|
+
|
|
34
|
+
let memory = "";
|
|
35
|
+
if (memoryInBytes >= 1024 * 1024 * 1024) {
|
|
36
|
+
memory = (memoryInBytes / (1024 * 1024 * 1024)).toFixed(2) + " GB";
|
|
37
|
+
} else {
|
|
38
|
+
memory = Math.round(memoryInBytes / (1024 * 1024)) + " MB";
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
let osversion = await DeviceInfo.getSystemVersion()
|
|
32
42
|
const type = isVideo ? 'video/mp4' : 'image/jpg';
|
|
33
43
|
const name = isVideo ? 'video.mp4' : 'photo.jpg';
|
|
@@ -7,10 +7,9 @@ const CustomeAlert = ({color, isVisible, OnPrees, text}) => {
|
|
|
7
7
|
<Modal
|
|
8
8
|
transparent={true}
|
|
9
9
|
visible={isVisible}
|
|
10
|
+
animationType="fade"
|
|
10
11
|
>
|
|
11
12
|
<View style={styles.background}>
|
|
12
|
-
<View style={styles.overlay} />
|
|
13
|
-
|
|
14
13
|
<View
|
|
15
14
|
style={[
|
|
16
15
|
styles.container, {
|
|
@@ -52,10 +51,7 @@ const styles = StyleSheet.create({
|
|
|
52
51
|
flex: 1,
|
|
53
52
|
justifyContent: 'center',
|
|
54
53
|
alignItems: 'center',
|
|
55
|
-
|
|
56
|
-
overlay: {
|
|
57
|
-
...StyleSheet.absoluteFillObject,
|
|
58
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)', // Slightly transparent overlay
|
|
54
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
59
55
|
},
|
|
60
56
|
container: {
|
|
61
57
|
width: '80%',
|
|
@@ -12,7 +12,16 @@ const AddCrashApi = async (desc) => {
|
|
|
12
12
|
let model = await DeviceInfo.getModel();
|
|
13
13
|
let created = new Date().toLocaleString();
|
|
14
14
|
let appversion = DeviceInfo.getVersion();
|
|
15
|
-
let
|
|
15
|
+
let totalMemory = await DeviceInfo.getTotalMemory();
|
|
16
|
+
let usedMemory = await DeviceInfo.getUsedMemory();
|
|
17
|
+
let memoryInBytes = totalMemory - usedMemory;
|
|
18
|
+
|
|
19
|
+
let memory = "";
|
|
20
|
+
if (memoryInBytes >= 1024 * 1024 * 1024) {
|
|
21
|
+
memory = (memoryInBytes / (1024 * 1024 * 1024)).toFixed(2) + " GB";
|
|
22
|
+
} else {
|
|
23
|
+
memory = Math.round(memoryInBytes / (1024 * 1024)) + " MB";
|
|
24
|
+
}
|
|
16
25
|
let osversion = await DeviceInfo.getSystemVersion()
|
|
17
26
|
|
|
18
27
|
let i = 0;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// NavigationContext.js
|
|
2
2
|
import React, { createContext, useContext, useState } from 'react';
|
|
3
|
-
import { useFocusEffect } from '@react-navigation/native';
|
|
4
3
|
|
|
5
4
|
const NavigationContext = createContext();
|
|
6
5
|
|
|
@@ -23,16 +22,14 @@ export const NavigationProvider = ({ children }) => {
|
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [navigationState])
|
|
35
|
-
);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (navigationState && navigationState.length > 0) {
|
|
27
|
+
setFocusedScreen(navigationState[navigationState.length - 1].name);
|
|
28
|
+
}
|
|
29
|
+
return () => {
|
|
30
|
+
setFocusedScreen('');
|
|
31
|
+
};
|
|
32
|
+
}, [navigationState]);
|
|
36
33
|
|
|
37
34
|
return (
|
|
38
35
|
<NavigationContext.Provider value={{ navigationState, navigate, goBack, focusedScreen, goToScreenAtIndex}}>
|
|
@@ -316,6 +316,7 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
316
316
|
subscription.unsubscribe();
|
|
317
317
|
global.IsBackground = false
|
|
318
318
|
global.isShakebugSDKOpen = true
|
|
319
|
+
// navigate('TestScreen');
|
|
319
320
|
navigate("FirstScreen", { img: `${ImgUrl}`, themeColor: `${themeColor}`, SDKScreenTitle: `${SDKScreenTitle}` })
|
|
320
321
|
}
|
|
321
322
|
else {
|
|
@@ -492,8 +493,8 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
492
493
|
return (
|
|
493
494
|
<View
|
|
494
495
|
style={{
|
|
495
|
-
|
|
496
|
-
|
|
496
|
+
width: '100%',
|
|
497
|
+
height: '100%'
|
|
497
498
|
}}
|
|
498
499
|
>
|
|
499
500
|
|
|
@@ -285,11 +285,15 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
return (
|
|
288
|
-
<SafeAreaView style={{
|
|
289
|
-
<StatusBar backgroundColor={ThemeColor} hidden={false} />
|
|
290
|
-
<
|
|
291
|
-
|
|
292
|
-
|
|
288
|
+
<SafeAreaView style={{ flex: 1, backgroundColor: ThemeColor, paddingTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0 }}>
|
|
289
|
+
<StatusBar backgroundColor={ThemeColor} hidden={false} barStyle="dark-content" />
|
|
290
|
+
<View style={{
|
|
291
|
+
flex: 1,
|
|
292
|
+
backgroundColor: "#fff",
|
|
293
|
+
paddingBottom: Platform.OS === 'android' ? 48 : 0 // Standard bottom navigation bar height
|
|
294
|
+
}}>
|
|
295
|
+
<KeyboardAvoidingWrapper>
|
|
296
|
+
<>
|
|
293
297
|
<View style={{ height: '6%', padding: 5, paddingHorizontal: 15, backgroundColor: ThemeColor, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
294
298
|
<TouchableOpacity
|
|
295
299
|
style={{
|
|
@@ -393,7 +397,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
393
397
|
</View>
|
|
394
398
|
<Text style={{ fontSize: 12, color: 'red', fontWeight: '500', marginRight: '6%', textAlign: 'right' }}>{EmailBorder == "red" ? Localization[global.ShakebugLanguage].EmailError : ""}</Text>
|
|
395
399
|
|
|
396
|
-
<TouchableOpacity activeOpacity={1} onPress={Keyboard.dismiss} style={{ height: Platform.OS == 'ios' ? Dimensions.get('window').height * 0.50 : '
|
|
400
|
+
<TouchableOpacity activeOpacity={1} onPress={Keyboard.dismiss} style={{ height: Platform.OS == 'ios' ? Dimensions.get('window').height * 0.50 : '50%', width: '100%', marginTop: '0%', justifyContent: 'center', alignItems: 'center' }}>
|
|
397
401
|
{type == "img" ?
|
|
398
402
|
path != "" && <Image source={{ uri: path }} resizeMode='contain' style={{ width: '100%', height: '100%' }} />
|
|
399
403
|
:
|
|
@@ -401,7 +405,8 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
401
405
|
{poster != "" && <VideoPlayer videoUri={path} img={poster} themeColor={ThemeColor} goToScreenAtIndex={goToScreenAtIndex} goBack={goBack} SDKScreenTitle={SDKScreenTitle} UpdateStatusBar={UpdateStatusBar} />}
|
|
402
406
|
</View>}
|
|
403
407
|
</TouchableOpacity>
|
|
404
|
-
|
|
408
|
+
|
|
409
|
+
<View style={{ marginTop: '2%', width: '100%'}}>
|
|
405
410
|
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginHorizontal: 20 }}>
|
|
406
411
|
<TouchableOpacity onPress={() => openImagePicker()}>
|
|
407
412
|
<Text style={{ fontSize: 16, color: ThemeColor, fontWeight: '300' }}>{Localization[global.ShakebugLanguage].ReplaceImage}</Text>
|
|
@@ -421,51 +426,45 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
421
426
|
</TouchableOpacity>
|
|
422
427
|
</View>
|
|
423
428
|
|
|
424
|
-
<View style={{ alignItems: 'flex-end', marginHorizontal: 15, marginTop: '
|
|
429
|
+
<View style={{ alignItems: 'flex-end', marginHorizontal: 15, marginTop: '0.5%' }}>
|
|
425
430
|
<Text style={{ fontSize: 12, color: "gray", fontWeight: '300' }}>© <Text>ShakeBug v{global.sdk_version}</Text></Text>
|
|
426
431
|
</View>
|
|
427
432
|
|
|
428
433
|
</View>
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}}
|
|
446
|
-
/>
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
{isLoading &&
|
|
450
|
-
<View
|
|
451
|
-
style={{
|
|
452
|
-
...StyleSheet.absoluteFillObject,
|
|
453
|
-
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
<CustomeAlert
|
|
437
|
+
isVisible={isErrorInAPI || isBugReported}
|
|
438
|
+
text={apiMessage}
|
|
439
|
+
color={themeColor}
|
|
440
|
+
OnPrees={() => {
|
|
441
|
+
if (isBugReported) {
|
|
442
|
+
global.isScreenShotDetected = false;
|
|
443
|
+
setIsScreenShot(false)
|
|
444
|
+
setIsRecordingStart(false)
|
|
445
|
+
goToScreenAtIndex(0)
|
|
446
|
+
}
|
|
447
|
+
setIsBugReported(false)
|
|
448
|
+
setErrorInAPI(false)
|
|
449
|
+
setIsLoading(false)
|
|
454
450
|
}}
|
|
455
451
|
/>
|
|
456
|
-
}
|
|
457
452
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
453
|
+
|
|
454
|
+
{isLoading &&
|
|
455
|
+
<View
|
|
456
|
+
style={{
|
|
457
|
+
...StyleSheet.absoluteFillObject,
|
|
458
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
459
|
+
}}
|
|
460
|
+
/>
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
{isLoading &&
|
|
464
|
+
<ActivityIndicator size={'large'} color={themeColor} collapsable={true} style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, elevation: 2 }} />}
|
|
465
|
+
</>
|
|
466
|
+
</KeyboardAvoidingWrapper>
|
|
467
|
+
</View>
|
|
469
468
|
|
|
470
469
|
</SafeAreaView>
|
|
471
470
|
)
|
|
@@ -43,7 +43,7 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
|
|
|
43
43
|
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
StatusBar.setHidden(false, 'slide');
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
global.isScreenShotDetected = true;
|
|
48
48
|
const backAction = () => {
|
|
49
49
|
global.isTrigger = false
|
|
@@ -60,6 +60,7 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
|
|
|
60
60
|
const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);
|
|
61
61
|
|
|
62
62
|
return () => backHandler.remove(); // Clean up the event listener on unmount
|
|
63
|
+
|
|
63
64
|
}, []);
|
|
64
65
|
|
|
65
66
|
const { RNCameraPermission } = NativeModules
|
|
@@ -132,8 +133,8 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
});
|
|
135
|
-
};
|
|
136
136
|
|
|
137
|
+
};
|
|
137
138
|
|
|
138
139
|
// For update image while change from Add details screen
|
|
139
140
|
const updateImage = (data) => {
|
|
@@ -142,7 +143,6 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
|
|
|
142
143
|
setImage(data)
|
|
143
144
|
}
|
|
144
145
|
|
|
145
|
-
|
|
146
146
|
useEffect(() => {
|
|
147
147
|
global.IsBackground = 'false'
|
|
148
148
|
Keyboard.addListener('keyboardDidShow', () => {
|
|
@@ -273,8 +273,8 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
|
|
|
273
273
|
}
|
|
274
274
|
]
|
|
275
275
|
)
|
|
276
|
-
}
|
|
277
276
|
|
|
277
|
+
}
|
|
278
278
|
|
|
279
279
|
const pan = useRef(new Animated.ValueXY()).current;
|
|
280
280
|
|
|
@@ -304,272 +304,271 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
|
|
|
304
304
|
pan.setValue({ x: 0, y: 0 });
|
|
305
305
|
}
|
|
306
306
|
})
|
|
307
|
+
|
|
307
308
|
).current;
|
|
308
309
|
|
|
309
310
|
// backgroundColor: "#181818"
|
|
310
311
|
|
|
311
312
|
return (
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
global.isScreenShotDetected = false
|
|
331
|
-
global.isShakebugSDKOpen = false
|
|
332
|
-
}}
|
|
333
|
-
>
|
|
334
|
-
<Image source={require('../Assets/images/close.png')} resizeMode='contain' style={{ width: 35, height: 35 }} />
|
|
335
|
-
</TouchableOpacity>
|
|
336
|
-
<Text style={{ width: '80%', height: '80%', fontSize: 18, fontWeight: '300', color: 'white', textAlign: 'center' }}>
|
|
337
|
-
{title}
|
|
338
|
-
</Text>
|
|
339
|
-
<TouchableOpacity
|
|
340
|
-
style={{
|
|
341
|
-
width: '10%',
|
|
342
|
-
alignItems: 'center'
|
|
343
|
-
}}
|
|
344
|
-
onPress={async () => {
|
|
345
|
-
const ImgUrl = await ref.current.capture()
|
|
346
|
-
if (ImgUrl != undefined || ImgUrl != null) {
|
|
313
|
+
<SafeAreaView style={{ flex: 1, backgroundColor: ThemeColor, paddingTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0 }}>
|
|
314
|
+
<StatusBar backgroundColor={ThemeColor} barStyle="dark-content" />
|
|
315
|
+
|
|
316
|
+
<View style={{
|
|
317
|
+
flex: 1,
|
|
318
|
+
backgroundColor: "#e4fdfd",
|
|
319
|
+
paddingBottom: Platform.OS === 'android' ? 48 : 0 // Standard bottom navigation bar height
|
|
320
|
+
}}>
|
|
321
|
+
|
|
322
|
+
<View style={{ height: '6%', padding: 5, paddingHorizontal: 15, backgroundColor: ThemeColor, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
323
|
+
<TouchableOpacity
|
|
324
|
+
style={{
|
|
325
|
+
width: '10%',
|
|
326
|
+
alignItems: 'center'
|
|
327
|
+
}}
|
|
328
|
+
onPress={() => {
|
|
329
|
+
global.isTrigger = false
|
|
330
|
+
global.isShakebugOpen = false
|
|
347
331
|
global.IsBackground = 'true'
|
|
348
|
-
|
|
349
|
-
|
|
332
|
+
global.isScreeenShotTaken = false
|
|
333
|
+
setIsScreenShot(false)
|
|
334
|
+
setIsRecordingStart(false)
|
|
335
|
+
goToScreenAtIndex(0)
|
|
336
|
+
global.isScreenShotDetected = false
|
|
337
|
+
global.isShakebugSDKOpen = false
|
|
338
|
+
}}
|
|
339
|
+
>
|
|
340
|
+
<Image source={require('../Assets/images/close.png')} resizeMode='contain' style={{ width: 35, height: 35 }} />
|
|
341
|
+
</TouchableOpacity>
|
|
342
|
+
<Text style={{ width: '80%', height: '80%', fontSize: 18, fontWeight: '300', color: 'white', textAlign: 'center' }}>
|
|
343
|
+
{title}
|
|
344
|
+
</Text>
|
|
345
|
+
<TouchableOpacity
|
|
346
|
+
style={{
|
|
347
|
+
width: '10%',
|
|
348
|
+
alignItems: 'center'
|
|
349
|
+
}}
|
|
350
|
+
onPress={async () => {
|
|
351
|
+
const ImgUrl = await ref.current.capture()
|
|
352
|
+
if (ImgUrl != undefined || ImgUrl != null) {
|
|
353
|
+
global.IsBackground = 'true'
|
|
354
|
+
navigate("AddDetailsScreen", { media: `${ImgUrl}`, updateParent: updateImage, mediaType: 'img', themeColor: ThemeColor, SDKScreenTitle: `${SDKScreenTitle}` })
|
|
355
|
+
}
|
|
350
356
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
357
|
+
}}
|
|
358
|
+
>
|
|
359
|
+
<Image source={require('../Assets/images/next.png')} resizeMode='contain' style={{ width: 25, height: 25 }} />
|
|
360
|
+
</TouchableOpacity>
|
|
361
|
+
</View>
|
|
362
|
+
<View style={{ position: 'relative', height: Platform.OS == 'android' ? '78%' : '79%', backgroundColor: '#e4fdfd', width: '100%', alignItems: 'center', paddingTop: 8 }}>
|
|
363
|
+
<ShakebugCapture ref={ref} options={{ format: "png", quality: 1 }} collapsable={false} style={{ width: Platform.OS == 'android' ? "77%" : '73%', height: '100%' }}>
|
|
364
|
+
|
|
365
|
+
{text.trim().length > 0 ?
|
|
366
|
+
<Animated.View
|
|
367
|
+
style={[
|
|
368
|
+
styles.card,
|
|
369
|
+
{
|
|
370
|
+
transform: pan.getTranslateTransform(),
|
|
371
|
+
opacity: 1,
|
|
372
|
+
borderWidth: isShow ? 1 : 0
|
|
373
|
+
},
|
|
374
|
+
]}
|
|
369
375
|
|
|
370
|
-
>
|
|
371
|
-
<TouchableOpacity
|
|
372
|
-
style={{
|
|
373
|
-
width: '100%',
|
|
374
|
-
height: '100%'
|
|
375
|
-
}}
|
|
376
|
-
activeOpacity={1}
|
|
377
|
-
onPress={() => setIsShow(!isShow)}
|
|
378
376
|
>
|
|
379
|
-
<
|
|
380
|
-
onLongPress={() => {
|
|
381
|
-
setIsShow(!isShow)
|
|
382
|
-
}}
|
|
383
|
-
{...panResponder.panHandlers}
|
|
377
|
+
<TouchableOpacity
|
|
384
378
|
style={{
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
379
|
+
width: '100%',
|
|
380
|
+
height: '100%'
|
|
381
|
+
}}
|
|
382
|
+
activeOpacity={1}
|
|
383
|
+
onPress={() => setIsShow(!isShow)}
|
|
384
|
+
>
|
|
385
|
+
<Text
|
|
386
|
+
onLongPress={() => {
|
|
387
|
+
setIsShow(!isShow)
|
|
388
|
+
}}
|
|
389
|
+
{...panResponder.panHandlers}
|
|
390
|
+
style={{
|
|
391
|
+
fontSize: 20,
|
|
392
|
+
fontWeight: 'bold',
|
|
393
|
+
backgroundColor: 'white',
|
|
394
|
+
borderRadius: 8,
|
|
395
|
+
padding: 5,
|
|
396
|
+
color: selectd == 1 ? "black" : selectd == 2 ? 'red' : selectd == 3 ? 'green' : selectd == 4 ? '#1dd3e3' : selectd == 5 ? "yellow" : 'black',
|
|
397
|
+
}}>{text}</Text>
|
|
398
|
+
</TouchableOpacity>
|
|
399
|
+
|
|
400
|
+
{isShow ? <TouchableOpacity
|
|
401
|
+
activeOpacity={1}
|
|
402
|
+
onPress={() => setText("")}
|
|
403
|
+
style={{ position: 'absolute', top: '-25%', left: '-15%', width: 20, height: 20, zIndex: 1 }}>
|
|
404
|
+
<Image source={require("../Assets/images/RemoveTextView.png")} style={{ width: '100%', height: '100%' }} resizeMode='contain' />
|
|
405
|
+
</TouchableOpacity> : null}
|
|
406
|
+
</Animated.View>
|
|
407
|
+
: null}
|
|
408
|
+
<ImageBackground
|
|
409
|
+
source={image ? { uri: image } : undefined}
|
|
410
|
+
style={{
|
|
411
|
+
alignItems: 'center',
|
|
412
|
+
width: "100%",
|
|
413
|
+
height: "100%"
|
|
414
|
+
}}
|
|
415
|
+
resizeMode='contain'
|
|
416
|
+
>
|
|
417
|
+
|
|
418
|
+
<RNDrawingView
|
|
419
|
+
ref={canvasRef}
|
|
420
|
+
style={{ width: '100%', height: '100%' }}
|
|
421
|
+
color={selectd == 1 ? "black" : selectd == 2 ? 'red' : selectd == 3 ? 'green' : selectd == 4 ? '#1dd3e3' : selectd == 5 ? "yellow" : 'black'}
|
|
422
|
+
strokeWidth={Platform.OS == 'android' ? 5 : 3}
|
|
423
|
+
/>
|
|
424
|
+
|
|
425
|
+
</ImageBackground>
|
|
426
|
+
</ShakebugCapture>
|
|
427
|
+
|
|
428
|
+
</View>
|
|
429
|
+
<View style={{ margin: 10, marginHorizontal: 20, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', height: '5%', backgroundColor: "#e4fdfd" }}>
|
|
430
|
+
<TouchableOpacity
|
|
431
|
+
style={{ backgroundColor: ThemeColor, padding: 8, width: '45%', alignItems: 'center' }}
|
|
432
|
+
onPress={() => {
|
|
433
|
+
global.IsBackground = 'false'
|
|
434
|
+
if (global.AllowVideo == false) {
|
|
435
|
+
setIsAlertText(`You have reached your max video limitation. \n\n Used Videos: ${global.used_video} \nAllowed Videos: ${global.total_video}\n\nPlease visit https://www.shakebug.com website and upgrade your plan.`)
|
|
436
|
+
setIsAlert(true)
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
DeviceInfo.isEmulator()
|
|
440
|
+
.then(res => {
|
|
441
|
+
if (res != true || Platform.OS != 'ios') {
|
|
442
|
+
RecordVideo()
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
setIsAlertText("Only real device is supported for recording video")
|
|
446
|
+
setIsAlert(true)
|
|
447
|
+
}
|
|
448
|
+
})
|
|
449
|
+
}
|
|
450
|
+
}}
|
|
451
|
+
>
|
|
452
|
+
<Text style={{ color: 'white' }}>{Localization[global.ShakebugLanguage].RecordVideo}</Text>
|
|
453
|
+
</TouchableOpacity>
|
|
454
|
+
<TouchableOpacity
|
|
455
|
+
style={{ backgroundColor: ThemeColor, padding: 8, width: '45%', alignItems: 'center' }}
|
|
456
|
+
onPress={() => {
|
|
457
|
+
if (global.AllowVideo == false) {
|
|
458
|
+
setIsAlertText(`You have reached your max video limitation. \n\n Used Videos: ${global.used_video} \nAllowed Videos: ${global.total_video}\n\nPlease visit https://www.shakebug.com website and upgrade your plan.`)
|
|
459
|
+
setIsAlert(true)
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
openVideoPicker()
|
|
463
|
+
}
|
|
408
464
|
}}
|
|
409
|
-
resizeMode='contain'
|
|
410
465
|
>
|
|
466
|
+
<Text style={{ color: 'white' }}>{Localization[global.ShakebugLanguage].ChooseVideo}</Text>
|
|
467
|
+
</TouchableOpacity>
|
|
468
|
+
</View>
|
|
411
469
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
470
|
+
<View style={{ width: "100%", flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 15, height: Platform.OS == 'ios' ? '7%' : '8.5%', paddingVertical: 12, backgroundColor: "#181818" }}>
|
|
471
|
+
<TouchableOpacity
|
|
472
|
+
onPress={() => {
|
|
473
|
+
setIsDraw(true)
|
|
474
|
+
setSelected(1)
|
|
475
|
+
}}
|
|
476
|
+
>
|
|
477
|
+
<Image source={selectd == 1 ? require('../Assets/images/borderdBlack.png') : require('../Assets/images/black.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
478
|
+
</TouchableOpacity>
|
|
479
|
+
<TouchableOpacity
|
|
480
|
+
onPress={() => setSelected(2)}
|
|
481
|
+
>
|
|
482
|
+
<Image source={selectd == 2 ? require('../Assets/images/borderdRed.png') : require('../Assets/images/red.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
483
|
+
</TouchableOpacity>
|
|
484
|
+
<TouchableOpacity
|
|
485
|
+
onPress={() => setSelected(3)}
|
|
486
|
+
>
|
|
487
|
+
<Image source={selectd == 3 ? require('../Assets/images/borderdGreen.png') : require('../Assets/images/green.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
488
|
+
</TouchableOpacity>
|
|
489
|
+
<TouchableOpacity
|
|
490
|
+
onPress={() => setSelected(4)}
|
|
491
|
+
>
|
|
492
|
+
<Image source={selectd == 4 ? require('../Assets/images/borderdBlue.png') : require('../Assets/images/blue.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
493
|
+
</TouchableOpacity>
|
|
494
|
+
<TouchableOpacity
|
|
495
|
+
onPress={() => setSelected(5)}
|
|
496
|
+
>
|
|
497
|
+
<Image source={selectd == 5 ? require('../Assets/images/borderdYellow.png') : require('../Assets/images/yellow.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
498
|
+
</TouchableOpacity>
|
|
499
|
+
<TouchableOpacity
|
|
500
|
+
onPress={() => setAddTextView(true)}
|
|
501
|
+
>
|
|
502
|
+
<Image source={require('../Assets/images/text_icon.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
503
|
+
</TouchableOpacity>
|
|
418
504
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
setIsAlertText(`You have reached your max video limitation. \n\n Used Videos: ${global.used_video} \nAllowed Videos: ${global.total_video}\n\nPlease visit https://www.shakebug.com website and upgrade your plan.`)
|
|
430
|
-
setIsAlert(true)
|
|
431
|
-
}
|
|
432
|
-
else {
|
|
433
|
-
DeviceInfo.isEmulator()
|
|
434
|
-
.then(res => {
|
|
435
|
-
if (res != true || Platform.OS != 'ios') {
|
|
436
|
-
RecordVideo()
|
|
437
|
-
}
|
|
438
|
-
else {
|
|
439
|
-
setIsAlertText("Only real device is supported for recording video")
|
|
440
|
-
setIsAlert(true)
|
|
441
|
-
}
|
|
442
|
-
})
|
|
443
|
-
}
|
|
444
|
-
}}
|
|
445
|
-
>
|
|
446
|
-
<Text style={{ color: 'white' }}>{Localization[global.ShakebugLanguage].RecordVideo}</Text>
|
|
447
|
-
</TouchableOpacity>
|
|
448
|
-
<TouchableOpacity
|
|
449
|
-
style={{ backgroundColor: ThemeColor, padding: 8, width: '45%', alignItems: 'center' }}
|
|
450
|
-
onPress={() => {
|
|
451
|
-
if (global.AllowVideo == false) {
|
|
452
|
-
setIsAlertText(`You have reached your max video limitation. \n\n Used Videos: ${global.used_video} \nAllowed Videos: ${global.total_video}\n\nPlease visit https://www.shakebug.com website and upgrade your plan.`)
|
|
453
|
-
setIsAlert(true)
|
|
454
|
-
}
|
|
455
|
-
else {
|
|
456
|
-
openVideoPicker()
|
|
457
|
-
}
|
|
458
|
-
}}
|
|
459
|
-
>
|
|
460
|
-
<Text style={{ color: 'white' }}>{Localization[global.ShakebugLanguage].ChooseVideo}</Text>
|
|
461
|
-
</TouchableOpacity>
|
|
462
|
-
</View>
|
|
463
|
-
|
|
464
|
-
<View style={{ width: "100%", flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 15, height: Platform.OS == 'ios' ? '7%' : '8.5%', paddingVertical: 12, backgroundColor: "#181818" }}>
|
|
465
|
-
<TouchableOpacity
|
|
466
|
-
onPress={() => {
|
|
467
|
-
setIsDraw(true)
|
|
468
|
-
setSelected(1)
|
|
469
|
-
}}
|
|
470
|
-
>
|
|
471
|
-
<Image source={selectd == 1 ? require('../Assets/images/borderdBlack.png') : require('../Assets/images/black.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
472
|
-
</TouchableOpacity>
|
|
473
|
-
<TouchableOpacity
|
|
474
|
-
onPress={() => setSelected(2)}
|
|
475
|
-
>
|
|
476
|
-
<Image source={selectd == 2 ? require('../Assets/images/borderdRed.png') : require('../Assets/images/red.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
477
|
-
</TouchableOpacity>
|
|
478
|
-
<TouchableOpacity
|
|
479
|
-
onPress={() => setSelected(3)}
|
|
480
|
-
>
|
|
481
|
-
<Image source={selectd == 3 ? require('../Assets/images/borderdGreen.png') : require('../Assets/images/green.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
482
|
-
</TouchableOpacity>
|
|
483
|
-
<TouchableOpacity
|
|
484
|
-
onPress={() => setSelected(4)}
|
|
485
|
-
>
|
|
486
|
-
<Image source={selectd == 4 ? require('../Assets/images/borderdBlue.png') : require('../Assets/images/blue.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
487
|
-
</TouchableOpacity>
|
|
488
|
-
<TouchableOpacity
|
|
489
|
-
onPress={() => setSelected(5)}
|
|
490
|
-
>
|
|
491
|
-
<Image source={selectd == 5 ? require('../Assets/images/borderdYellow.png') : require('../Assets/images/yellow.png')} resizeMode='contain' style={{ width: 40, height: 40 }} />
|
|
492
|
-
</TouchableOpacity>
|
|
493
|
-
<TouchableOpacity
|
|
494
|
-
onPress={() => setAddTextView(true)}
|
|
505
|
+
<TouchableOpacity style={{ backgroundColor: ThemeColor, padding: 5 }} onPress={() => ClearCanvas(canvasRef)}>
|
|
506
|
+
<Image source={require('../Assets/images/clear.png')} resizeMode='contain' style={{ width: 30, height: 30 }} />
|
|
507
|
+
</TouchableOpacity>
|
|
508
|
+
</View>
|
|
509
|
+
</View >
|
|
510
|
+
|
|
511
|
+
{addTextView ? (<View style={{ flex: 1, position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, backgroundColor: 'black', opacity: 0.93, alignItems: 'center' }}>
|
|
512
|
+
<KeyboardAvoidingView
|
|
513
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
514
|
+
style={styles.container}
|
|
495
515
|
>
|
|
496
|
-
<
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
516
|
+
<View style={styles.innerContainer}>
|
|
517
|
+
<TextInput
|
|
518
|
+
style={{
|
|
519
|
+
width: '90%',
|
|
520
|
+
alignSelf: 'center',
|
|
521
|
+
height: '70%',
|
|
522
|
+
paddingHorizontal: 10,
|
|
523
|
+
textAlign: 'center',
|
|
524
|
+
textAlignVertical: 'center',
|
|
525
|
+
marginTop: 30,
|
|
526
|
+
fontSize: 18,
|
|
527
|
+
color: selectd == 1 ? "white" : selectd == 2 ? 'red' : selectd == 3 ? 'green' : selectd == 4 ? '#1dd3e3' : selectd == 5 ? "yellow" : 'black'
|
|
528
|
+
}}
|
|
529
|
+
autoFocus
|
|
530
|
+
multiline
|
|
531
|
+
placeholder="Type here..."
|
|
532
|
+
placeholderTextColor="#b2b2b2"
|
|
533
|
+
cursorColor={selectd == 1 ? "white" : selectd == 2 ? 'red' : selectd == 3 ? 'green' : selectd == 4 ? '#1dd3e3' : selectd == 5 ? "yellow" : 'black'}
|
|
534
|
+
value={text}
|
|
535
|
+
onChangeText={(e) => setText(e)}
|
|
536
|
+
/>
|
|
537
|
+
</View>
|
|
538
|
+
<TouchableOpacity
|
|
539
|
+
style={keyboardOpen ? styles.buttonShifted : styles.button}
|
|
540
|
+
onPress={() => {
|
|
541
|
+
setIsShow(false)
|
|
542
|
+
setAddTextView(false)
|
|
522
543
|
}}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
onPress={() => {
|
|
535
|
-
setIsShow(false)
|
|
536
|
-
setAddTextView(false)
|
|
544
|
+
>
|
|
545
|
+
<Text style={{ color: 'white' }}>{Localization[global.ShakebugLanguage].Done}</Text>
|
|
546
|
+
</TouchableOpacity>
|
|
547
|
+
</KeyboardAvoidingView>
|
|
548
|
+
</View>) : null}
|
|
549
|
+
|
|
550
|
+
{isLoading &&
|
|
551
|
+
<View
|
|
552
|
+
style={{
|
|
553
|
+
...StyleSheet.absoluteFillObject,
|
|
554
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
537
555
|
}}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}}
|
|
549
|
-
/>
|
|
550
|
-
|
|
551
|
-
{isLoading &&
|
|
552
|
-
<View
|
|
553
|
-
style={{
|
|
554
|
-
...StyleSheet.absoluteFillObject,
|
|
555
|
-
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
556
|
+
/>
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
<CustomeAlert
|
|
560
|
+
isVisible={isAlert}
|
|
561
|
+
text={isAlertText}
|
|
562
|
+
color={themeColor}
|
|
563
|
+
OnPrees={() => {
|
|
564
|
+
setIsAlert(false)
|
|
565
|
+
setIsAlertText("")
|
|
556
566
|
}}
|
|
557
567
|
/>
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
<CustomeAlert
|
|
561
|
-
isVisible={isAlert}
|
|
562
|
-
text={isAlertText}
|
|
563
|
-
color={themeColor}
|
|
564
|
-
OnPrees={() => {
|
|
565
|
-
setIsAlert(false)
|
|
566
|
-
setIsAlertText("")
|
|
567
|
-
}}
|
|
568
|
-
/>
|
|
569
568
|
|
|
570
|
-
|
|
569
|
+
{isLoading && <ActivityIndicator size={'large'} color={themeColor} collapsable={true} style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, elevation: 2 }} />}
|
|
571
570
|
|
|
572
|
-
|
|
571
|
+
</SafeAreaView>
|
|
573
572
|
)
|
|
574
573
|
}
|
|
575
574
|
|
package/src/Screens/Shakebug.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Platform,
|
|
4
|
+
Alert,
|
|
5
|
+
AppState,
|
|
6
|
+
NativeModules,
|
|
7
|
+
View,
|
|
8
|
+
Text,
|
|
9
|
+
StyleSheet,
|
|
10
|
+
Animated,
|
|
11
|
+
Dimensions,
|
|
12
|
+
Modal,
|
|
13
|
+
} from 'react-native';
|
|
3
14
|
import ShakeFunction from '../Componanats/ShakeFunction';
|
|
4
15
|
import FirstScreen from './FirstScreen';
|
|
5
16
|
import AddDetailsScreen from './AddDetailsScreen';
|
|
6
17
|
import TrimVideoScreen from './TrimVideoScreen'
|
|
7
18
|
import DeviceInfo from '../../DeviceInfo';
|
|
8
19
|
import { useEffect, useState } from 'react';
|
|
9
|
-
import { useFocusEffect } from '@react-navigation/native';
|
|
10
20
|
import GetLocation from '../../GetLocation'
|
|
11
21
|
import NetInfo from '../../NetInfo/src'
|
|
12
22
|
import { SessionStartApi } from '../APIs/StartSession';
|
|
@@ -53,7 +63,7 @@ global.isScreeenShotTaken = false;
|
|
|
53
63
|
global.restrictedViews = [];
|
|
54
64
|
global.currentScreen = ""
|
|
55
65
|
global.isShakebugSDKOpen = false;
|
|
56
|
-
global.sdk_version = "2.4.
|
|
66
|
+
global.sdk_version = "2.4.9";
|
|
57
67
|
global.app_lunch_count = 0;
|
|
58
68
|
global.POPUP_LAUNCH_THRESHOLD = 3;
|
|
59
69
|
global.POPUP_COOLDOWN_DAYS = 2;
|
|
@@ -71,49 +81,66 @@ const ShakebugContext = React.createContext();
|
|
|
71
81
|
|
|
72
82
|
// For navigation in register screen
|
|
73
83
|
const NavigationContainer = ({ screens, setFocusedScreen }) => {
|
|
74
|
-
|
|
75
84
|
const { navigationState } = useNavigation();
|
|
76
|
-
const animation = React.useRef(new Animated.Value(0)).current;
|
|
77
|
-
const { width } = Dimensions.get('window');
|
|
78
85
|
|
|
79
|
-
useFocusEffect(
|
|
80
|
-
React.useCallback(() => {
|
|
81
|
-
if (navigationState && navigationState.length > 0) {
|
|
82
|
-
setFocusedScreen(navigationState[navigationState.length - 1].name);
|
|
83
|
-
}
|
|
84
|
-
return () => {
|
|
85
|
-
setFocusedScreen('');
|
|
86
|
-
};
|
|
87
|
-
}, [navigationState, setFocusedScreen])
|
|
88
|
-
);
|
|
89
86
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
if (!navigationState || navigationState.length === 0) {
|
|
88
|
+
return (
|
|
89
|
+
<View
|
|
90
|
+
style={{
|
|
91
|
+
flex: 1,
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
backgroundColor: 'red',
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
<Text style={{ color: 'white', fontSize: 20 }}>
|
|
98
|
+
Navigation State Empty
|
|
99
|
+
</Text>
|
|
100
|
+
</View>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
97
103
|
|
|
98
104
|
return (
|
|
99
|
-
<View style={
|
|
105
|
+
<View style={{ flex: 1, backgroundColor: 'white' }}>
|
|
100
106
|
{navigationState.map((screen, index) => {
|
|
101
107
|
const ScreenComponent = screens[screen.name];
|
|
102
|
-
|
|
103
|
-
inputRange: [index - 1, index, index + 1],
|
|
104
|
-
outputRange: [width, 0, -width],
|
|
105
|
-
});
|
|
108
|
+
if (!ScreenComponent) return null;
|
|
106
109
|
|
|
110
|
+
const isFocused = index === navigationState.length - 1;
|
|
107
111
|
return (
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
<View
|
|
113
|
+
key={index}
|
|
114
|
+
style={[
|
|
115
|
+
StyleSheet.absoluteFillObject,
|
|
116
|
+
{ display: isFocused ? 'flex' : 'none', width: '100%', height: '100%' }
|
|
117
|
+
]}
|
|
118
|
+
>
|
|
119
|
+
<ScreenComponent {...(screen.params || {})} />
|
|
120
|
+
</View>
|
|
111
121
|
);
|
|
112
122
|
})}
|
|
113
123
|
</View>
|
|
114
124
|
);
|
|
115
125
|
};
|
|
116
126
|
|
|
127
|
+
const TestScreen = () => {
|
|
128
|
+
return (
|
|
129
|
+
<View
|
|
130
|
+
style={{
|
|
131
|
+
flex: 1,
|
|
132
|
+
backgroundColor: 'yellow',
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
alignItems: 'center',
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
<Text style={{ fontSize: 30, color: 'black' }}>
|
|
138
|
+
TEST SCREEN
|
|
139
|
+
</Text>
|
|
140
|
+
</View>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
117
144
|
// For shakeFunctionscreen with childern as props
|
|
118
145
|
const ShakeScreen = () => {
|
|
119
146
|
const {
|
|
@@ -468,7 +495,7 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
468
495
|
setAllowCrashFlag(global.allowCrashReport);
|
|
469
496
|
setAllowEventFlag(global.allowEvent);
|
|
470
497
|
setAllowReviewFlag(global.allowReview);
|
|
471
|
-
setAllowSessionFlag(global.allowSession);
|
|
498
|
+
setAllowSessionFlag(global.allowSession); log.debug("------------------------------------------------------------------------------------------");
|
|
472
499
|
log.info('API response:', message);
|
|
473
500
|
log.debug("------------------------------------------------------------------------------------------");
|
|
474
501
|
if (global.allowSession) { StartSession(); }
|
|
@@ -541,8 +568,7 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
541
568
|
}}>
|
|
542
569
|
<View
|
|
543
570
|
style={{
|
|
544
|
-
|
|
545
|
-
height: '100%',
|
|
571
|
+
flex: 1
|
|
546
572
|
}}
|
|
547
573
|
>
|
|
548
574
|
<GlobalStateProvider>
|
|
@@ -553,7 +579,8 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
553
579
|
TutorialScreen: TutorialScreen,
|
|
554
580
|
FirstScreen: FirstScreen,
|
|
555
581
|
TrimVideoScreen: TrimVideoScreen,
|
|
556
|
-
AddDetailsScreen: AddDetailsScreen
|
|
582
|
+
AddDetailsScreen: AddDetailsScreen,
|
|
583
|
+
TestScreen: TestScreen,
|
|
557
584
|
}}
|
|
558
585
|
setFocusedScreen={setFocusedScreen}
|
|
559
586
|
/>
|
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Shakebug, { AddEvent } from '../src/Screens/Shakebug';
|
|
3
|
-
import { NavigationContainer, findFocusedRoute } from '@react-navigation/native';
|
|
4
3
|
import { getLocales } from '../GetLocals/src';
|
|
5
4
|
import { NativeModules, Text, View, findNodeHandle } from 'react-native';
|
|
6
5
|
import { useGlobalState } from './Componanats/GlobalStateContext'
|
|
@@ -14,7 +13,7 @@ let LocalLanguage = LanguageCodes.indexOf(getLocales()[0].languageCode)
|
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
// Define the props interface for ShakebugView
|
|
17
|
-
interface ShakebugViewProps {
|
|
16
|
+
export interface ShakebugViewProps {
|
|
18
17
|
children?: React.ReactNode;
|
|
19
18
|
Android_appkey?: string;
|
|
20
19
|
iOS_appkey?: string;
|
|
@@ -47,22 +46,20 @@ const ShakebugView: React.FC<ShakebugViewProps> = ({
|
|
|
47
46
|
}) => {
|
|
48
47
|
|
|
49
48
|
return (
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/>
|
|
65
|
-
</NavigationContainer>
|
|
49
|
+
<Shakebug
|
|
50
|
+
children={children}
|
|
51
|
+
Android_appkey={Android_appkey}
|
|
52
|
+
iOS_appkey={iOS_appkey}
|
|
53
|
+
showTutorialScreenFirstTime={showTutorialScreenFirstTime}
|
|
54
|
+
ShakebugThemeColor={ShakebugThemeColor}
|
|
55
|
+
changeSDKScreenTitle={changeSDKScreenTitle}
|
|
56
|
+
allowToReportBugByScreenCapture={allowToReportBugByScreenCapture}
|
|
57
|
+
allowToReportBugByShakingMobile={allowToReportBugByShakingMobile}
|
|
58
|
+
allowCrashReport={__DEV__ ? false : allowCrashReport}
|
|
59
|
+
makeLogEnabled={makeLogEnabled}
|
|
60
|
+
ShakebugLanguage={Languages.includes(ShakebugLanguage) ? ShakebugLanguage : LocalLanguage != -1 ? Languages[LocalLanguage] : "ENGLISH"}
|
|
61
|
+
setShakebugSDKEndPointURL={setShakebugSDKEndPointURL}
|
|
62
|
+
/>
|
|
66
63
|
);
|
|
67
64
|
};
|
|
68
65
|
|