From: shivamv Date: Fri, 16 Sep 2022 09:46:11 +0000 (+0530) Subject: Changing System Screen-width,height to UIFW window-width,height. X-Git-Tag: accepted/tizen/unified/20220919.021615^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78925072bc6e92db573dda86c4f7b0ccf0c68b6b;p=profile%2Fiot%2Fapps%2Fdotnet%2Ftray.git Changing System Screen-width,height to UIFW window-width,height. Change-Id: I3be38e0f800b83d0f584182ff4ba2445f9c43a23 Signed-off-by: shivamv --- diff --git a/TrayApplication/Common/DeviceInfo.cs b/TrayApplication/Common/DeviceInfo.cs index 7874a1b..6831079 100755 --- a/TrayApplication/Common/DeviceInfo.cs +++ b/TrayApplication/Common/DeviceInfo.cs @@ -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) + { + if (IsPortrait == false) + { + ToggleOrientation(); + } + } + else if(IsPortrait == true) + { + ToggleOrientation(); + } } public static void UpdateDeviceInfo() diff --git a/TrayApplication/TrayApplication.cs b/TrayApplication/TrayApplication.cs index c8ecd44..bc8aa58 100755 --- a/TrayApplication/TrayApplication.cs +++ b/TrayApplication/TrayApplication.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using Tizen.NUI; using Tizen.NUI.WindowSystem.Shell; using TrayApplication.Views; diff --git a/packaging/org.tizen.TrayApplication-1.0.0.tpk b/packaging/org.tizen.TrayApplication-1.0.0.tpk index b5e5b19..bd385fe 100755 Binary files a/packaging/org.tizen.TrayApplication-1.0.0.tpk and b/packaging/org.tizen.TrayApplication-1.0.0.tpk differ