Changing System Screen-width,height to UIFW window-width,height. 99/281399/1 accepted/tizen/unified/20220919.021615
authorshivamv <shivam.v2@samsung.com>
Fri, 16 Sep 2022 09:46:11 +0000 (15:16 +0530)
committershivamv <shivam.v2@samsung.com>
Fri, 16 Sep 2022 09:46:11 +0000 (15:16 +0530)
Change-Id: I3be38e0f800b83d0f584182ff4ba2445f9c43a23
Signed-off-by: shivamv <shivam.v2@samsung.com>
TrayApplication/Common/DeviceInfo.cs
TrayApplication/TrayApplication.cs
packaging/org.tizen.TrayApplication-1.0.0.tpk

index 7874a1bcbf698b72bb8e51e60feb59ecfacef304..683107908adb96bbb3a87dd03b43e5154a1285a3 100755 (executable)
@@ -1,5 +1,4 @@
 using Tizen.NUI;
-using Tizen.System;
 
 namespace TrayApplication.Common
 {
@@ -8,21 +7,24 @@ namespace TrayApplication.Common
         private static int width;
         private static int height;
         private static Window.WindowOrientation orientation;
-        private const string WidthKey = "tizen.org/feature/screen.width";
-        private const string HeightKey = "tizen.org/feature/screen.height";
 
         static DeviceInfo()
         {
-            bool isWidthAvailable = Information.TryGetValue(WidthKey, out width);
-            bool isHeightAvailable = Information.TryGetValue(HeightKey, out height);
-            if (isHeightAvailable == false || isWidthAvailable == false)
-            {
-                width = 1280;
-                height = 720;
-                Tizen.Log.Debug(Resources.LogTag, "Width and height are not available , setting default size as 1280 x 720");
-            }
+            width = Window.Instance.Size.Width;
+            height = Window.Instance.Size.Height;
+            IsPortrait = width < height;
             orientation = Window.Instance.GetCurrentOrientation();
-            IsPortrait = orientation == Window.WindowOrientation.Portrait || orientation == Window.WindowOrientation.PortraitInverse;
+            if(orientation == Window.WindowOrientation.Portrait || orientation == Window.WindowOrientation.PortraitInverse && IsPortrait == false)\r
+            {\r
+                if (IsPortrait == false)\r
+                {\r
+                    ToggleOrientation();\r
+                }\r
+            }
+            else if(IsPortrait == true)\r
+            {\r
+                ToggleOrientation();\r
+            }
         }
 
         public static void UpdateDeviceInfo()
index c8ecd44e83dc43b79fd23c8a77debb4e6ca85acc..bc8aa587e85029251167d93b5fca8383d6855c20 100755 (executable)
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Text;
 using Tizen.NUI;
 using Tizen.NUI.WindowSystem.Shell;
 using TrayApplication.Views;
index b5e5b19e90f2410b8042dd756725bd106a0bdba3..bd385fe99fb334730cf1fbfdff7a08026510398a 100755 (executable)
Binary files a/packaging/org.tizen.TrayApplication-1.0.0.tpk and b/packaging/org.tizen.TrayApplication-1.0.0.tpk differ