Remove MarginalView.
authorPiotr Czaja/Advanced Frameworks (PLT) /SRPOL/Engineer/Samsung Electronics <p.czaja@samsung.com>
Thu, 10 Mar 2022 12:58:45 +0000 (13:58 +0100)
committerPiotr Czaja <p.czaja@samsung.com>
Thu, 5 May 2022 12:30:08 +0000 (14:30 +0200)
Change-Id: I27ee355dd983eaf87a3e0f10fb452fc2a6a67c7b

Oobe/Oobe/ScalableUI/MarginalView.cs [deleted file]
Oobe/Oobe/Views/MainView.cs

diff --git a/Oobe/Oobe/ScalableUI/MarginalView.cs b/Oobe/Oobe/ScalableUI/MarginalView.cs
deleted file mode 100644 (file)
index 335e8d2..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-
-namespace ScalableUI
-{
-    public class MarginalView : View
-    {
-        private static Size MinBreakpointSize { get; } = new Size(1024, 720);
-        private static Size MaxBreakpointSize { get; } = new Size(4096, 2160);
-
-        private static Size WindowSize => Window.Instance.WindowSize;
-
-        private static bool IsLandscape => WindowSize.Width > WindowSize.Height;
-
-        private static List<float> GetBreakpoints(float min, float max, float margin)
-        {
-            var breakpoints = new List<float>();
-            float lastBreakpoint = min;
-
-            while (lastBreakpoint < max)
-            {
-                breakpoints.Add(lastBreakpoint);
-                lastBreakpoint = lastBreakpoint * (1 + margin);
-            }
-
-            return breakpoints;
-        }
-
-        private static Size GetSize(float margin)
-        {
-            float min = IsLandscape ? MinBreakpointSize.Width : MinBreakpointSize.Height;
-            float max = IsLandscape ? MaxBreakpointSize.Width : MaxBreakpointSize.Height;
-            var breakpoints = GetBreakpoints(min, max, margin);
-
-            float limit = WindowSize.Width;
-            float breakpoint = breakpoints.Where(x => x <= limit).Last();
-
-            LogToDebug(breakpoints, limit, breakpoint, margin);
-
-            // MarginalLayout controls only width margins, height always equals window size.
-            return new Size(breakpoint, WindowSize.Height);
-        }
-
-        private static void LogToDebug(IEnumerable<float> breakpoints, float limit, float breakpoint, float margin)
-        {
-            var breakpoints__ = breakpoints.Select(x => Convert.ToInt32(x).ToString());
-            double effectiveMarginPixels = limit - breakpoint;
-            double effectiveMarginPercent = Math.Round(effectiveMarginPixels / limit, 2);
-            Tizen.Log.Debug(nameof(ScalableUI), $"Window size {WindowSize.Width} x {WindowSize.Height} px");
-            Tizen.Log.Debug(nameof(ScalableUI), $"Horizontal breakpoints [{string.Join(",", breakpoints__)}] px, Selected {breakpoint} px is below {WindowSize.Width} px");
-            Tizen.Log.Debug(nameof(ScalableUI), $"MaxMargin = {margin}, effective margin = {effectiveMarginPercent} ({effectiveMarginPixels} px)");
-        }
-
-        private float maxMargin;
-        public float MaxMargin
-        {
-            get => maxMargin;
-            set
-            {
-                maxMargin = value;
-
-                Size = GetSize(maxMargin);
-
-                PositionUsesPivotPoint = true;
-                ParentOrigin = Tizen.NUI.ParentOrigin.Center;
-                PivotPoint = Tizen.NUI.PivotPoint.Center;
-            }
-        }
-    }
-}
index 0a779fa5b74828fe1f0fb8fb87c14504e7b8234b..35c25838066ec94ee626dc3e2e22a02dc965b740 100644 (file)
@@ -25,10 +25,9 @@ namespace Oobe.Views
     /// <summary>
     /// Implementation of OOBE GUI Guideline for IoT Headed
     /// </summary>
-    public class MainView : ScalableUI.MarginalView
+    public class MainView : View
     {
         private const int TransitionTime = 750;
-        private readonly Extents stackMargin = new Extents(48, 48, 48, 48);
         private ScalableUI.OrientationalView orientational;
         private Pagination pagination;
         private bool firstPushed = false;
@@ -36,8 +35,11 @@ namespace Oobe.Views
         public MainView(Window win)
             : base()
         {
-            MaxMargin = 0.25f;
-            //Padding = stackMargin;
+            Size = Window.Instance.Size;
+
+            PositionUsesPivotPoint = true;
+            ParentOrigin = Tizen.NUI.ParentOrigin.Center;
+            PivotPoint = Tizen.NUI.PivotPoint.Center;
 
             Tizen.Log.Debug("oobe", $"this.Size: {this.Size.Width} {this.Size.Height}");