public static Extents DetailContentMargin = new Extents(64, 64, 8, 8);
public static float windowHeightRatio = 540f / 1080;
- public static float windowWidthRation = 960f / 1920;
+ public static float windowWidthRatio = 960f / 1920;
}
}
MinSize = new Size2D(704, 436);
}
+ public CustomBorder(Size2D screenSize)
+ {
+ ResizePolicy = Window.BorderResizePolicyType.Free;
+ float minWidthRatio = 704.0f / 1920;
+ float minHeightRatio = 436.0f / 1080;
+ int minWidth = (int)(screenSize.Width * minWidthRatio);
+ int minHeight = (int)(screenSize.Height * minHeightRatio);
+ MinSize = new Size2D(minWidth, minHeight);
+ }
private void OnThemeChanged(object sender, ThemeChangedEventArgs e)
{
if (e.IsPlatformThemeChanged)
using Tizen.NUI;
using Notifications.Common;
using Notifications.Core;
+using Tizen.System;
namespace Notifications
{
private Window window;
private ViewManager viewManager;
- public Program() : base(AppConstants.DefaultWindowSize, AppConstants.DefaultWindowPosition, ThemeOptions.PlatformThemeEnabled, new CustomBorder())
+ public Program(Size2D windowSize, Position2D windowPosition, CustomBorder appBorder) : base(windowSize, windowPosition, ThemeOptions.PlatformThemeEnabled, appBorder)
{
}
static void Main(string[] args)
{
- var app = new Program();
+ int positionX, positionY;
+ int width, height;
+
+ _ = Information.TryGetValue("http://tizen.org/feature/screen.width", out int screenWidth);
+ _ = Information.TryGetValue("http://tizen.org/feature/screen.height", out int screenHeight);
+
+ Tizen.Log.Debug(AppConstants.LogTag, "screen width : " + screenWidth);
+ Tizen.Log.Debug(AppConstants.LogTag, "screen height : " + screenHeight);
+
+ Size2D displaySize = new Size2D(screenWidth, screenHeight);
+
+ width = (int)(displaySize.Width * AppConstants.windowWidthRatio);
+ height = (int)(displaySize.Height * AppConstants.windowHeightRatio);
+
+ positionX = (displaySize.Width - width) / 2;
+ positionY = (displaySize.Height - height) / 2;
+
+
+ CustomBorder appBorder = new CustomBorder(displaySize);
+ var app = new Program(new Size2D(width, height), new Position2D(positionX, positionY), appBorder);
+
app.Run(args);
}
}
int positionX, positionY;
int width, height;
- width = (int)(DeviceInfo.DisplayWidth * AppConstants.windowWidthRation);
+ width = (int)(DeviceInfo.DisplayWidth * AppConstants.windowWidthRatio);
height = (int)(DeviceInfo.DisplayHeight * AppConstants.windowHeightRatio);
positionX = ((DeviceInfo.IsPortrait ? DeviceInfo.DisplayHeight : DeviceInfo.DisplayWidth) - width) / 2;