return (textLabel.LineCount - 1) * textLabel.SizeHeight / textLabel.LineCount;
}
}
+
+ public static float GetScaleFactor()
+ {
+ var size = IsPortrait ? Window.Instance.Size.Width : Window.Instance.Size.Height;
+ switch (size)
+ {
+ case 720:
+ return 0.6f;
+ case 1080:
+ return 0.9f;
+ default:
+ {
+ if (size > 1080)
+ {
+ return 0.9f;
+ }
+ else if (size < 1080 && size > 720)
+ {
+ return 0.6f;
+ }
+ else
+ {
+ return 0.4f;
+ }
+ }
+ }
+ }
}
}
private void SetBackground()
{
var visualMap = new NPatchVisual();
- visualMap.URL = GetBackgroundUrl();
+ visualMap.URL = NUIApplication.Current.DirectoryInfo.Resource + $"page/{fhdBackgroundFile}";
ViewBackground = visualMap.OutputVisualMap;
}
- private string GetBackgroundUrl()
- {
- string filename = hdBackgroundFile;
- int biggerEdge = Math.Max(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Height);
- if (biggerEdge > 3000)
- {
- filename = fhdBackgroundFile;
- }
- else if (biggerEdge < 1500)
- {
- filename = uhdBackgroundFile;
- }
-
- string bgUrl = NUIApplication.Current.DirectoryInfo.Resource + $"page/{filename}";
- return bgUrl;
- }
-
private void SetTheme(string name)
{
ThemeManager.ApplyTheme(new Theme(NUIApplication.Current.DirectoryInfo.Resource + $"theme/{name}Theme.xaml"));
private void ConfigureSize()
{
var userScale = TextUtils.GetFontSizeScale(SystemSettings.FontSize);
- float h2 = (48 * userScale) + (ScreenSizeUtils.IsPortrait ? 72 : 63);
- float h1 = (48 * userScale) + 55;
- int bounding_height = (int)((ScreenSizeUtils.IsPortrait ? 1616 : 760) - h2 - h1);
-
- Bounding.Size = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? new Size2D(824, bounding_height) : new Size2D(1664, bounding_height));
Footnote.SizeWidth = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? 680 : 1520);
Linear.CellPadding = SpUtils.ToPixels(new Size2D(20, 20));
AgreeCheckBox.Size2D = SpUtils.ToPixels(new Size2D((int)(userScale * 24), (int)(userScale * 24)));
Window.Instance.Type = WindowType.Notification;
Window.Instance.SetNotificationLevel(NotificationLevel.High);
- var size = ScreenSizeUtils.IsPortrait ? Window.Instance.Size.Width : Window.Instance.Size.Height;
- var scale = size >= 1080 ? 0.9f : 0.6f;
- SpUtils.DefaultFactor = (Window.Instance.Dpi.Width / 160) / scale;
- Tizen.Log.Debug("oobe", $"DefaultScaleFactor: {SpUtils.DefaultFactor}");
+ SetupScaleFactor();
+
+ ProcessManager.Instance.Start();
+ }
+
+ private void SetupScaleFactor()
+ {
+ SpUtils.DefaultFactor = (float)SpTypeConverter.Instance.ConvertToPixel(1) / ScreenSizeUtils.GetScaleFactor();
if (Preference.Contains("scale"))
{
}
}
- ProcessManager.Instance.Start();
+ Tizen.Log.Debug("oobe", $"DefaultScaleFactor: {SpUtils.DefaultFactor}");
}
private void Start()
public OrientationalView()
{
- Size2D = Window.Instance.Size;
PositionUsesPivotPoint = true;
ParentOrigin = Tizen.NUI.ParentOrigin.Center;
PivotPoint = Tizen.NUI.PivotPoint.Center;
public MainView(Window win)
: base()
{
- Size = Window.Instance.Size;
-
+ WidthSpecification = LayoutParamPolicies.MatchParent;
+ HeightSpecification = LayoutParamPolicies.MatchParent;
PositionUsesPivotPoint = true;
ParentOrigin = Tizen.NUI.ParentOrigin.Center;
PivotPoint = Tizen.NUI.PivotPoint.Center;
- Tizen.Log.Debug("oobe", $"this.Size: {this.Size.Width} {this.Size.Height}");
+ Layout = new LinearLayout
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ };
+
+ var marginSize = (ScreenSizeUtils.IsPortrait ? win.WindowSize.Height : win.WindowSize.Width) * 0.08f;
orientational = new ScalableUI.OrientationalView
{
- Size = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? new Size2D(952, 1792) : new Size2D(1792, 952)),
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
Position2D = new Position2D(0, 0),
ScrollDuration = TransitionTime,
+ Margin = SpUtils.ToPixels(new Extents(0, (ushort)marginSize, 0, (ushort)marginSize)),
};
Add(orientational);