{
public static class SpUtils
{
- private const float DefaultFactor = 1.48125f;
+ public static float DefaultFactor = 1.48125f;
public static int ToPixels(int sp)
{
using Oobe.Common.Services;
using Oobe.Common.Utils;
using Oobe.Managers;
+using Tizen.Applications;
using Tizen.NUI;
namespace Oobe
Reset();
}
+ if (e.ReceivedAppControl.ExtraData.TryGet("scale", out string scale))
+ {
+ if (!string.IsNullOrEmpty(scale))
+ {
+ Preference.Set("scale", scale);
+ Tizen.Log.Debug("oobe", $"Set scale: {scale}");
+ }
+ }
+
Start();
}
Window.Instance.Type = WindowType.Notification;
Window.Instance.SetNotificationLevel(NotificationLevel.High);
+ SpUtils.DefaultFactor = (Window.Instance.Dpi.Width / 161) / 0.9f;
+ Tizen.Log.Debug("oobe", $"DefaultScaleFactor: {SpUtils.DefaultFactor}");
+
+ if (Preference.Contains("scale"))
+ {
+ try
+ {
+ SpUtils.DefaultFactor = float.Parse(Preference.Get<string>("scale"));
+ }
+ catch (Exception ex)
+ {
+ Tizen.Log.Debug("oobe", $"Wrong scale format: {ex.Message}");
+ }
+ }
+
ProcessManager.Instance.Start();
}