From a1f43db8cc3d99384d91b6cd8a048bd14609e404 Mon Sep 17 00:00:00 2001 From: Pip <92968130+codepip55@users.noreply.github.com> Date: Mon, 26 Feb 2024 10:46:04 +0100 Subject: [PATCH] Add separate statements for landscape option, fixes #2039 --- .../plugins/screenorientation/ScreenOrientation.java | 1 + screen-orientation/ios/Plugin/ScreenOrientation.swift | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/screen-orientation/android/src/main/java/com/capacitorjs/plugins/screenorientation/ScreenOrientation.java b/screen-orientation/android/src/main/java/com/capacitorjs/plugins/screenorientation/ScreenOrientation.java index 220db7077..5ab13215f 100644 --- a/screen-orientation/android/src/main/java/com/capacitorjs/plugins/screenorientation/ScreenOrientation.java +++ b/screen-orientation/android/src/main/java/com/capacitorjs/plugins/screenorientation/ScreenOrientation.java @@ -60,6 +60,7 @@ private int fromOrientationTypeToEnum(String orientationType) { case "any": return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; case "landscape": + return ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE; case "landscape-primary": return ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; case "landscape-secondary": diff --git a/screen-orientation/ios/Plugin/ScreenOrientation.swift b/screen-orientation/ios/Plugin/ScreenOrientation.swift index 149aa88d7..ba4f4e5de 100644 --- a/screen-orientation/ios/Plugin/ScreenOrientation.swift +++ b/screen-orientation/ios/Plugin/ScreenOrientation.swift @@ -84,7 +84,9 @@ public class ScreenOrientation: NSObject { switch orientationType { case "any": return UIInterfaceOrientationMask.all - case "landscape", "landscape-primary": + case "landscape": + return UIInterfaceOrientationMask.landscape + case "landscape-primary": return UIInterfaceOrientationMask.landscapeLeft case "landscape-secondary": return UIInterfaceOrientationMask.landscapeRight