shakebug-react-native 2.4.8 → 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.
@@ -34,8 +34,13 @@ public class DrawingView extends View {
34
34
  if (bitmap != null) {
35
35
  bitmap.recycle();
36
36
  }
37
- bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
38
- canvas = new Canvas(bitmap);
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
- h = 0;
354
+ int evaluatedHeight = 0;
355
355
  ScrollView scrollView = (ScrollView) view;
356
356
  for (int i = 0; i < scrollView.getChildCount(); i++) {
357
- h += scrollView.getChildAt(i).getHeight();
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.8",
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
@@ -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 memory = await DeviceInfo.getTotalMemory() - await DeviceInfo.getUsedMemory()
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 memory = await DeviceInfo.getTotalMemory() - await DeviceInfo.getUsedMemory()
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;
@@ -285,12 +285,11 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
285
285
  }
286
286
 
287
287
  return (
288
- <SafeAreaView style={{ flex: 1, backgroundColor: ThemeColor }}>
288
+ <SafeAreaView style={{ flex: 1, backgroundColor: ThemeColor, paddingTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0 }}>
289
289
  <StatusBar backgroundColor={ThemeColor} hidden={false} barStyle="dark-content" />
290
290
  <View style={{
291
291
  flex: 1,
292
292
  backgroundColor: "#fff",
293
- paddingTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0,
294
293
  paddingBottom: Platform.OS === 'android' ? 48 : 0 // Standard bottom navigation bar height
295
294
  }}>
296
295
  <KeyboardAvoidingWrapper>
@@ -427,7 +426,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
427
426
  </TouchableOpacity>
428
427
  </View>
429
428
 
430
- <View style={{ alignItems: 'flex-end', marginHorizontal: 15, marginTop: '1%' }}>
429
+ <View style={{ alignItems: 'flex-end', marginHorizontal: 15, marginTop: '0.5%' }}>
431
430
  <Text style={{ fontSize: 12, color: "gray", fontWeight: '300' }}>© <Text>ShakeBug v{global.sdk_version}</Text></Text>
432
431
  </View>
433
432
 
@@ -310,13 +310,12 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
310
310
  // backgroundColor: "#181818"
311
311
 
312
312
  return (
313
- <SafeAreaView style={{ flex: 1, backgroundColor: ThemeColor }}>
313
+ <SafeAreaView style={{ flex: 1, backgroundColor: ThemeColor, paddingTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0 }}>
314
314
  <StatusBar backgroundColor={ThemeColor} barStyle="dark-content" />
315
315
 
316
316
  <View style={{
317
317
  flex: 1,
318
318
  backgroundColor: "#e4fdfd",
319
- paddingTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0,
320
319
  paddingBottom: Platform.OS === 'android' ? 48 : 0 // Standard bottom navigation bar height
321
320
  }}>
322
321
 
@@ -63,7 +63,7 @@ global.isScreeenShotTaken = false;
63
63
  global.restrictedViews = [];
64
64
  global.currentScreen = ""
65
65
  global.isShakebugSDKOpen = false;
66
- global.sdk_version = "2.4.8";
66
+ global.sdk_version = "2.4.9";
67
67
  global.app_lunch_count = 0;
68
68
  global.POPUP_LAUNCH_THRESHOLD = 3;
69
69
  global.POPUP_COOLDOWN_DAYS = 2;
@@ -101,33 +101,25 @@ const NavigationContainer = ({ screens, setFocusedScreen }) => {
101
101
  );
102
102
  }
103
103
 
104
- const currentScreen =
105
- navigationState[navigationState.length - 1];
106
-
107
-
108
- const ScreenComponent = screens[currentScreen.name];
109
-
110
-
111
- if (!ScreenComponent) {
112
- return (
113
- <View
114
- style={{
115
- flex: 1,
116
- justifyContent: 'center',
117
- alignItems: 'center',
118
- backgroundColor: 'red',
119
- }}
120
- >
121
- <Text style={{ color: 'white', fontSize: 20 }}>
122
- Screen Not Found: {currentScreen.name}
123
- </Text>
124
- </View>
125
- );
126
- }
127
-
128
104
  return (
129
105
  <View style={{ flex: 1, backgroundColor: 'white' }}>
130
- <ScreenComponent {...(currentScreen.params || {})} />
106
+ {navigationState.map((screen, index) => {
107
+ const ScreenComponent = screens[screen.name];
108
+ if (!ScreenComponent) return null;
109
+
110
+ const isFocused = index === navigationState.length - 1;
111
+ return (
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>
121
+ );
122
+ })}
131
123
  </View>
132
124
  );
133
125
  };