using Tizen.NUI;
-using Tizen.System;
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()