From 6be928efb1dd8089c06cbdbb8a74e5c51f39ef29 Mon Sep 17 00:00:00 2001 From: "Yurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics" Date: Sun, 9 Oct 2022 13:11:11 +0200 Subject: [PATCH] add log & Release 1.1.10 fix scale Change-Id: I9d774a8da34a381fb4264e1e94bc1a9b39a33cb8 --- Oobe/Oobe.Common/Utils/SpUtils.cs | 2 +- Oobe/Oobe/OobeApp.cs | 25 +++++++++++++++++++++ ...en.oobe-1.1.9.tpk => org.tizen.oobe-1.1.10.tpk} | Bin packaging/org.tizen.oobe.spec | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) rename packaging/{org.tizen.oobe-1.1.9.tpk => org.tizen.oobe-1.1.10.tpk} (100%) diff --git a/Oobe/Oobe.Common/Utils/SpUtils.cs b/Oobe/Oobe.Common/Utils/SpUtils.cs index 8c80030..ce8e5d9 100644 --- a/Oobe/Oobe.Common/Utils/SpUtils.cs +++ b/Oobe/Oobe.Common/Utils/SpUtils.cs @@ -21,7 +21,7 @@ namespace Oobe.Common.Utils { public static class SpUtils { - private const float DefaultFactor = 1.48125f; + public static float DefaultFactor = 1.48125f; public static int ToPixels(int sp) { diff --git a/Oobe/Oobe/OobeApp.cs b/Oobe/Oobe/OobeApp.cs index 15b43a7..48ad65b 100644 --- a/Oobe/Oobe/OobeApp.cs +++ b/Oobe/Oobe/OobeApp.cs @@ -20,6 +20,7 @@ using Oobe.Common.Resources; using Oobe.Common.Services; using Oobe.Common.Utils; using Oobe.Managers; +using Tizen.Applications; using Tizen.NUI; namespace Oobe @@ -68,6 +69,15 @@ 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(); } @@ -78,6 +88,21 @@ namespace Oobe 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("scale")); + } + catch (Exception ex) + { + Tizen.Log.Debug("oobe", $"Wrong scale format: {ex.Message}"); + } + } + ProcessManager.Instance.Start(); } diff --git a/packaging/org.tizen.oobe-1.1.9.tpk b/packaging/org.tizen.oobe-1.1.10.tpk similarity index 100% rename from packaging/org.tizen.oobe-1.1.9.tpk rename to packaging/org.tizen.oobe-1.1.10.tpk diff --git a/packaging/org.tizen.oobe.spec b/packaging/org.tizen.oobe.spec index 2d7fd39..23f47ac 100644 --- a/packaging/org.tizen.oobe.spec +++ b/packaging/org.tizen.oobe.spec @@ -1,6 +1,6 @@ Name: org.tizen.oobe Summary: org.tizen.oobe -Version: 1.1.9 +Version: 1.1.10 Release: 1 Group: N/A License: Apache-2.0 -- 2.7.4