Ver código fonte

Add sensorLandscape orientation option for Android to allow landscape and reverseLandscape. (#3895)

adam-aerobotics 6 anos atrás
pai
commit
0adbd3f087

+ 2
- 0
lib/android/app/src/main/java/com/reactnativenavigation/parse/OrientationOptions.java Ver arquivo

@@ -44,6 +44,8 @@ public class OrientationOptions {
44 44
                 return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode;
45 45
             case Portrait:
46 46
                 return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode;
47
+            case SensorLandscape:
48
+                return Orientation.SensorLandscape.orientationCode;
47 49
             default:
48 50
             case Default:
49 51
                 return Orientation.Default.orientationCode;

+ 2
- 1
lib/android/app/src/main/java/com/reactnativenavigation/parse/params/Orientation.java Ver arquivo

@@ -7,7 +7,8 @@ public enum Orientation {
7 7
     Portrait("portrait", ActivityInfo.SCREEN_ORIENTATION_PORTRAIT),
8 8
     Landscape("landscape", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE),
9 9
     Default("default", ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED),
10
-    PortraitLandscape("sensor", ActivityInfo.SCREEN_ORIENTATION_USER);
10
+    PortraitLandscape("sensor", ActivityInfo.SCREEN_ORIENTATION_USER),
11
+    SensorLandscape("sensorLandscape", ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
11 12
 
12 13
     public String name;
13 14
     public int orientationCode;