[NUI] Fix LayoutTransition to be added to Owner View's Window
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 4 Apr 2022 11:25:12 +0000 (20:25 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Wed, 20 Apr 2022 08:38:08 +0000 (17:38 +0900)
Previously, LayoutTransition was added to default Window.

To support multi window environment, the previous codes are not
appropriate.

Now, LayoutTransition is added to Owner View's Window.

src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs
src/Tizen.NUI/src/public/Layouting/LayoutItem.cs

index b449569..420d0f5 100755 (executable)
@@ -110,14 +110,30 @@ namespace Tizen.NUI
 
                     if (LayoutWithTransition)
                     {
+                        var win = Window.Get(Owner);
+
                         if (!childLayout.IsReplaceFlag())
                         {
-                            NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout);
+                            if (win == null)
+                            {
+                                NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout);
+                            }
+                            else
+                            {
+                                win.LayoutController.AddToRemovalStack(childLayout);
+                            }
                         }
 
                         childLayout.ConditionForAnimation = childLayout.ConditionForAnimation | TransitionCondition.Remove;
                         // Add LayoutItem to the transition stack so can animate it out.
-                        NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+                        if (win == null)
+                        {
+                            NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+                        }
+                        else
+                        {
+                            win.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+                        }
                     }
 
                     // Reset condition for animation ready for next transition when required.
index 6efc654..7f9e69a 100755 (executable)
@@ -586,7 +586,15 @@ namespace Tizen.NUI
 
                 if (ownerView?.Layout?.LayoutWithTransition ?? false)
                 {
-                    NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(layoutPositionData);
+                    var win = Window.Get(Owner);
+                    if (win == null)
+                    {
+                        NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(layoutPositionData);
+                    }
+                    else
+                    {
+                        win.LayoutController.AddTransitionDataEntry(layoutPositionData);
+                    }
                 }
                 else
                 {