react-native-security-suite 0.9.6 → 0.9.7

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.
@@ -2,6 +2,7 @@ package com.securitysuite;
2
2
 
3
3
  import android.app.Activity;
4
4
  import android.graphics.Color;
5
+ import android.view.View;
5
6
  import android.view.Window;
6
7
  import android.view.WindowManager;
7
8
  import android.widget.FrameLayout;
@@ -33,12 +34,9 @@ public class SecureView extends FrameLayout {
33
34
  super.onAttachedToWindow();
34
35
  final Activity activity = reactContext.getCurrentActivity();
35
36
  if (activity != null) {
36
- activity.runOnUiThread(new Runnable() {
37
- @Override
38
- public void run() {
39
- Window window = activity.getWindow();
40
- window.addFlags(WindowManager.LayoutParams.FLAG_SECURE);
41
- }
37
+ activity.runOnUiThread(() -> {
38
+ Window window = activity.getWindow();
39
+ window.addFlags(WindowManager.LayoutParams.FLAG_SECURE);
42
40
  });
43
41
  }
44
42
  }
@@ -48,16 +46,18 @@ public class SecureView extends FrameLayout {
48
46
  super.onDetachedFromWindow();
49
47
  final Activity activity = reactContext.getCurrentActivity();
50
48
  if (activity != null) {
51
- activity.runOnUiThread(new Runnable() {
52
- @Override
53
- public void run() {
54
- Window window = activity.getWindow();
55
- window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
56
- }
49
+ activity.runOnUiThread(() -> {
50
+ Window window = activity.getWindow();
51
+ window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
57
52
  });
58
53
  }
59
54
  }
60
55
 
56
+ @Override
57
+ public void addView(View child, int index) {
58
+ super.addView(child, index);
59
+ }
60
+
61
61
  private final Runnable measureAndLayout = () -> {
62
62
  measure(
63
63
  MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),
@@ -59,6 +59,17 @@ public class SecureViewManager extends ViewGroupManager<SecureView> {
59
59
  }
60
60
  }
61
61
 
62
+ @Override
63
+ public boolean needsCustomLayoutForChildren() {
64
+ return true;
65
+ }
66
+
67
+ @Override
68
+ public void onAfterUpdateTransaction(@NonNull SecureView view) {
69
+ super.onAfterUpdateTransaction(view);
70
+ view.requestLayout();
71
+ }
72
+
62
73
  public void createFragment(FrameLayout root, int reactNativeViewId) {
63
74
  ViewGroup parentView = (ViewGroup) root.findViewById(reactNativeViewId);
64
75
  if (parentView == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-security-suite",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Security solution for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",