Initialize CollectionView when scrolling direction changed. (#2961)
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Thu, 29 Apr 2021 12:33:59 +0000 (21:33 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 7 May 2021 05:58:58 +0000 (14:58 +0900)
* [NUI] Initialize CollectionView when scrolling direction changed.

if scrolling direction is changed,
all layout need to be updated and initialized.

* [NUI] remove unnecessary layout calculate call.

src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs

index 671a648..5fd4759 100755 (executable)
@@ -306,15 +306,11 @@ namespace Tizen.NUI.Components
             }
             set
             {
-                base.ScrollingDirection = value;
-
-                if (ScrollingDirection == Direction.Horizontal)
-                {
-                    ContentContainer.SizeWidth = ItemsLayouter.CalculateLayoutOrientationSize();
-                }
-                else
+                if (base.ScrollingDirection != value)
                 {
-                    ContentContainer.SizeHeight = ItemsLayouter.CalculateLayoutOrientationSize();
+                    base.ScrollingDirection = value;
+                    needInitalizeLayouter = true;
+                    Init();
                 }
             }
         }