add log & Release 1.1.10 90/282690/1 submit/tizen/20221009.125956
authorYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Sun, 9 Oct 2022 11:11:11 +0000 (13:11 +0200)
committerk.stepaniuk <k.stepaniuk@samsung.com>
Sun, 9 Oct 2022 12:45:03 +0000 (14:45 +0200)
fix scale

Change-Id: I9d774a8da34a381fb4264e1e94bc1a9b39a33cb8

Oobe/Oobe.Common/Utils/SpUtils.cs
Oobe/Oobe/OobeApp.cs
packaging/org.tizen.oobe-1.1.10.tpk [moved from packaging/org.tizen.oobe-1.1.9.tpk with 100% similarity]
packaging/org.tizen.oobe.spec

index 8c80030..ce8e5d9 100644 (file)
@@ -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)
         {
index 15b43a7..48ad65b 100644 (file)
@@ -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<string>("scale"));
+                }
+                catch (Exception ex)
+                {
+                    Tizen.Log.Debug("oobe", $"Wrong scale format: {ex.Message}");
+                }
+            }
+
             ProcessManager.Instance.Start();
         }
 
index 2d7fd39..23f47ac 100644 (file)
@@ -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