hybrid-navigation 4.0.4 → 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.
@@ -45,6 +45,7 @@ public class ReactFragment extends HybridFragment implements ReactManager.ReactB
45
45
  reactRootView = null;
46
46
  }
47
47
 
48
+ @SuppressLint("SourceLockedOrientationActivity")
48
49
  @Override
49
50
  public void onStop() {
50
51
  super.onStop();
@@ -69,10 +70,20 @@ public class ReactFragment extends HybridFragment implements ReactManager.ReactB
69
70
  }
70
71
 
71
72
  if (forceScreenLandscape()) {
72
- requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
73
+ if (!isRequestedOrientationLandscape()) {
74
+ requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
75
+ }
73
76
  }
74
77
  }
75
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
+
76
87
  @Override
77
88
  public void onPause() {
78
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.4",
4
+ "version": "4.0.6",
5
5
  "main": "./dist/index",
6
6
  "module": "./dist/index",
7
7
  "types": "./dist/index.d.ts",