Browse Source

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

adam-aerobotics 6 years ago
parent
commit
0adbd3f087

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

44
                 return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode;
44
                 return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode;
45
             case Portrait:
45
             case Portrait:
46
                 return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode;
46
                 return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode;
47
+            case SensorLandscape:
48
+                return Orientation.SensorLandscape.orientationCode;
47
             default:
49
             default:
48
             case Default:
50
             case Default:
49
                 return Orientation.Default.orientationCode;
51
                 return Orientation.Default.orientationCode;

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

7
     Portrait("portrait", ActivityInfo.SCREEN_ORIENTATION_PORTRAIT),
7
     Portrait("portrait", ActivityInfo.SCREEN_ORIENTATION_PORTRAIT),
8
     Landscape("landscape", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE),
8
     Landscape("landscape", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE),
9
     Default("default", ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED),
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
     public String name;
13
     public String name;
13
     public int orientationCode;
14
     public int orientationCode;