Add available orientations.
authorPiotr Czaja <p.czaja@samsung.com>
Wed, 11 Oct 2023 12:41:08 +0000 (14:41 +0200)
committerPiotr Czaja/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <p.czaja@samsung.com>
Wed, 11 Oct 2023 12:56:06 +0000 (14:56 +0200)
Change-Id: Ia6a496737c26c179e8e80dadbd95e0c0a8a04944

SettingView/SettingView.cs

index 67c36db778014e44a9ae3bd6b0c2d860afc03c05..6b09583c5c3c172b83bf91e5333981966767a521 100644 (file)
@@ -85,10 +85,23 @@ namespace SettingView
                     appCustomBorder.BorderWindow.Maximize(false);
                 }
             };
+            GetDefaultWindow().OrientationChanged += OnWindowOrientationChangedEvent;
+
+            GetDefaultWindow().AddAvailableOrientation(Window.WindowOrientation.Portrait);
+            GetDefaultWindow().AddAvailableOrientation(Window.WindowOrientation.Landscape);
+            GetDefaultWindow().AddAvailableOrientation(Window.WindowOrientation.PortraitInverse);
+            GetDefaultWindow().AddAvailableOrientation(Window.WindowOrientation.LandscapeInverse);
+
 
             LogScalableInfo();
         }
 
+        private void OnWindowOrientationChangedEvent(object sender, WindowOrientationChangedEventArgs e)
+        {
+            Window.WindowOrientation orientation = e.WindowOrientation;
+            Logger.Debug($"OnWindowOrientationChangedEvent() called!, orientation:{orientation}");
+        }
+
         private void LogScalableInfo()
         {
             var scalable = new string[]
@@ -112,6 +125,7 @@ namespace SettingView
         {
             Tizen.System.SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
             GadgetManager.Instance.CustomizationChanged -= CustomizationChanged;
+            GetDefaultWindow().OrientationChanged -= OnWindowOrientationChangedEvent;
             base.OnTerminate();
         }