Revert "make IsGrouped setter internal as only the GroupHeaderTemplate can enable it"
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Mon, 7 Jun 2021 07:38:10 +0000 (16:38 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 8 Jun 2021 05:35:32 +0000 (14:35 +0900)
This reverts commit 9ab325a08818ec3d492f91fe5bd70f4aaee3f614.

src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/Group/CollectionViewGridGroupSample.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/Group/CollectionViewLinearGroupSample.cs

index ade67a4df367bc85e83b58c8d9c7249478125c9c..35d639ef73a30e9b19bedc14945193844b03a1bb 100755 (executable)
@@ -458,21 +458,18 @@ namespace Tizen.NUI.Components
         public bool IsGrouped
         {
             get => isGrouped;
-            internal set
+            set
             {
-                if (isGrouped != value)
+                isGrouped = value;
+                needInitalizeLayouter = true;
+                //Need to re-intialize Internal Item Source.
+                if (InternalItemSource != null)
                 {
-                    isGrouped = value;
-                    //Need to re-intialize Internal Item Source.
-                    if (InternalItemSource != null)
-                    {
-                        InternalItemSource.Dispose();
-                        InternalItemSource = null;
-                    }
-                    if (ItemsSource != null)
-                        InternalItemSource = ItemsSourceFactory.Create(this);
+                    InternalItemSource.Dispose();
+                    InternalItemSource = null;
                 }
-                needInitalizeLayouter = true;
+                if (ItemsSource != null)
+                    InternalItemSource = ItemsSourceFactory.Create(this);
                 Init();
             }
         }
@@ -481,7 +478,7 @@ namespace Tizen.NUI.Components
         ///  DataTemplate of group header.
         /// </summary>
         /// <remarks>Please note that, internal index will be increased by group header.
-        /// GroupHeaderTemplate is essential for groupable view.</remarks>
+        /// GroupHeaderTemplate is essential for groupable view.</remarks>        
         [EditorBrowsable(EditorBrowsableState.Never)]
         public DataTemplate GroupHeaderTemplate
         {
@@ -492,8 +489,16 @@ namespace Tizen.NUI.Components
             set
             {
                 groupHeaderTemplate = value;
-                if (value != null) IsGrouped = true;
-                else IsGrouped = false;
+                needInitalizeLayouter = true;
+                //Need to re-intialize Internal Item Source.
+                if (InternalItemSource != null)
+                {
+                    InternalItemSource.Dispose();
+                    InternalItemSource = null;
+                }
+                if (ItemsSource != null)
+                    InternalItemSource = ItemsSourceFactory.Create(this);
+                Init();
             }
         }
 
index 6ba1272065629c41bc530aa322ee753fe61aafd4..e4bccb62d7ab945bf417d9ebff054cdf200e63b5 100644 (file)
@@ -77,6 +77,7 @@ namespace Tizen.NUI.Samples
                     return group;
                 }),
                 Header = myTitle,
+                IsGrouped = true,
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = LayoutParamPolicies.MatchParent,
index 384dea34da0e0950f1175cdada5318a4dada4413..33ff8cdb2be10700d54436aa64d3f8df4252c3ec 100644 (file)
@@ -80,6 +80,7 @@ namespace Tizen.NUI.Samples
                     return group;
                 }),
                 Header = myTitle,
+                IsGrouped = true,
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = LayoutParamPolicies.MatchParent,