make IsGrouped setter internal as only the GroupHeaderTemplate can enable it
authorEverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Thu, 3 Jun 2021 07:44:18 +0000 (16:44 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 8 Jun 2021 05:35:32 +0000 (14:35 +0900)
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 35d639ef73a30e9b19bedc14945193844b03a1bb..ade67a4df367bc85e83b58c8d9c7249478125c9c 100755 (executable)
@@ -458,18 +458,21 @@ namespace Tizen.NUI.Components
         public bool IsGrouped
         {
             get => isGrouped;
-            set
+            internal set
             {
-                isGrouped = value;
-                needInitalizeLayouter = true;
-                //Need to re-intialize Internal Item Source.
-                if (InternalItemSource != null)
+                if (isGrouped != value)
                 {
-                    InternalItemSource.Dispose();
-                    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);
                 }
-                if (ItemsSource != null)
-                    InternalItemSource = ItemsSourceFactory.Create(this);
+                needInitalizeLayouter = true;
                 Init();
             }
         }
@@ -478,7 +481,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
         {
@@ -489,16 +492,8 @@ namespace Tizen.NUI.Components
             set
             {
                 groupHeaderTemplate = value;
-                needInitalizeLayouter = true;
-                //Need to re-intialize Internal Item Source.
-                if (InternalItemSource != null)
-                {
-                    InternalItemSource.Dispose();
-                    InternalItemSource = null;
-                }
-                if (ItemsSource != null)
-                    InternalItemSource = ItemsSourceFactory.Create(this);
-                Init();
+                if (value != null) IsGrouped = true;
+                else IsGrouped = false;
             }
         }
 
index e4bccb62d7ab945bf417d9ebff054cdf200e63b5..6ba1272065629c41bc530aa322ee753fe61aafd4 100644 (file)
@@ -77,7 +77,6 @@ namespace Tizen.NUI.Samples
                     return group;
                 }),
                 Header = myTitle,
-                IsGrouped = true,
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = LayoutParamPolicies.MatchParent,
index 33ff8cdb2be10700d54436aa64d3f8df4252c3ec..384dea34da0e0950f1175cdada5318a4dada4413 100644 (file)
@@ -80,7 +80,6 @@ namespace Tizen.NUI.Samples
                     return group;
                 }),
                 Header = myTitle,
-                IsGrouped = true,
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = LayoutParamPolicies.MatchParent,