hybrid-navigation 4.0.5 → 4.0.6

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.
@@ -50,9 +50,6 @@ public class ReactFragment extends HybridFragment implements ReactManager.ReactB
50
50
  public void onStop() {
51
51
  super.onStop();
52
52
  if (FragmentHelper.isRemoving(this) && forceScreenLandscape()) {
53
- if (requireActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
54
- requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
55
- }
56
53
  unmountReactView();
57
54
  }
58
55
  }
@@ -73,10 +70,20 @@ public class ReactFragment extends HybridFragment implements ReactManager.ReactB
73
70
  }
74
71
 
75
72
  if (forceScreenLandscape()) {
76
- requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
73
+ if (!isRequestedOrientationLandscape()) {
74
+ requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
75
+ }
77
76
  }
78
77
  }
79
78
 
79
+ private boolean isRequestedOrientationLandscape() {
80
+ int requestedOrientation = requireActivity().getRequestedOrientation();
81
+ return requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE ||
82
+ requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE ||
83
+ requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE ||
84
+ requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE;
85
+ }
86
+
80
87
  @Override
81
88
  public void onPause() {
82
89
  super.onPause();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "4.0.5",
4
+ "version": "4.0.6",
5
5
  "main": "./dist/index",
6
6
  "module": "./dist/index",
7
7
  "types": "./dist/index.d.ts",