1. OnRequestResize() api called when requesting a resize
authorjoogab.yun <joogab.yun@samsung.com>
Fri, 15 Apr 2022 07:39:11 +0000 (16:39 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Wed, 20 Apr 2022 08:38:08 +0000 (17:38 +0900)
2. In overlay mode, change the border to opaque.

src/Tizen.NUI/src/public/Window/BorderWindow.cs
src/Tizen.NUI/src/public/Window/DefaultBorder.cs
src/Tizen.NUI/src/public/Window/IBorderInterface.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/BorderWindowTest.cs

index 7ef3963..33505b0 100755 (executable)
@@ -37,6 +37,7 @@ namespace Tizen.NUI
         private bool isInterceptTouch = false;
 
         private Timer overlayTimer;
+        private Color overlayBackgroundColor;
 
         // for border area
         private View rootView = null;
@@ -295,6 +296,8 @@ namespace Tizen.NUI
                     InterceptTouchEvent += OnWinInterceptTouch;
                     if (rootView != null)
                     {
+                        overlayBackgroundColor = new Color(rootView.BackgroundColor);
+                        rootView.BackgroundColor = new Color(1, 1, 1, 0.3f);
                         rootView.Hide();
                     }
                 }
@@ -311,6 +314,7 @@ namespace Tizen.NUI
                     GetBorderWindowBottomLayer().LowerToBottom();
                     if (rootView != null)
                     {
+                        rootView.BackgroundColor = overlayBackgroundColor;
                         rootView.Show();
                     }
                 }
index 4850713..2b9cd25 100755 (executable)
@@ -272,6 +272,7 @@ namespace Tizen.NUI
                 }
                 else if (direction != Window.BorderDirection.None)
                 {
+                    OnRequestResize();
                     BorderWindow.RequestResizeToServer((Window.ResizeDirection)direction);
                 }
             }
@@ -311,14 +312,8 @@ namespace Tizen.NUI
             if (e.Touch.GetState(0) == PointStateType.Down)
             {
               ClearWindowGesture();
-              if (BorderWindow.IsMinimized() == true)
-              {
-                BorderWindow.RequestResizeToServer(Window.ResizeDirection.TopLeft);
-              }
-              else
-              {
-                BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomLeft);
-              }
+              OnRequestResize();
+              BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomLeft);
             }
             return true;
         }
@@ -332,14 +327,8 @@ namespace Tizen.NUI
             if (e.Touch.GetState(0) == PointStateType.Down)
             {
               ClearWindowGesture();
-              if (BorderWindow.IsMinimized() == true)
-              {
-                BorderWindow.RequestResizeToServer(Window.ResizeDirection.TopRight);
-              }
-              else
-              {
-                BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomRight);
-              }
+              OnRequestResize();
+              BorderWindow.RequestResizeToServer(Window.ResizeDirection.BottomRight);
             }
             return true;
         }
@@ -619,6 +608,14 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Called when requesting a resize
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public virtual void OnRequestResize()
+        {
+        }
+
+        /// <summary>
         /// Called when the window is resized.
         /// </summary>
         /// <param name="width">The width of the resized window</param>
index bfd1e58..e2661ff 100755 (executable)
@@ -88,6 +88,12 @@ namespace Tizen.NUI
         public void OnCreated(View rootView);
 
         /// <summary>
+        /// Called when requesting a resize
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void OnRequestResize();
+
+        /// <summary>
         /// Called when the window is resized.
         /// </summary>
         /// <param name="width">The width of the resized window</param>
index 4b757d7..800556d 100755 (executable)
@@ -232,15 +232,6 @@ namespace Tizen.NUI.Samples
     void Initialize()
     {
         win = NUIApplication.GetDefaultWindow();
-
-             List<Window.WindowOrientation> list = new List<Window.WindowOrientation>();
-        list.Add(Window.WindowOrientation.Landscape);
-        list.Add(Window.WindowOrientation.LandscapeInverse);
-        list.Add(Window.WindowOrientation.NoOrientationPreference);
-        list.Add(Window.WindowOrientation.Portrait);
-        list.Add(Window.WindowOrientation.PortraitInverse);
-        win.SetAvailableOrientations(list);
-
         var root = new ImageView()
         {
           WidthResizePolicy = ResizePolicyType.FillToParent,