[NUI] refactoring collectionView and Layouters for extended class (#5123)
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Wed, 29 Mar 2023 05:25:55 +0000 (14:25 +0900)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Wed, 29 Mar 2023 05:40:29 +0000 (14:40 +0900)
* [NUI] refactoring collectionView and Layouters for extended class

to create customized collectionView and Layouters,
some properties must be extendable.
this change includes properties access modifier
which is internal or private to protected.

* [NUI] publize reyclerviewitem properties

* [NUI] fix item source getter more efficiently.

* [NUI] refactoring getter.

* [NUI] add GroupItems

* [NUI] fix build error

* [NUI] fix build error

* [NUI] change property overridable.

src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/ItemsLayouter.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs
src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs

index d032345..4a566cb 100755 (executable)
@@ -287,8 +287,8 @@ namespace Tizen.NUI.Components
 
                 if (itemsSource == null)
                 {
-                    InternalItemSource?.Dispose();
-                    InternalItemSource = null;
+                    InternalSource?.Dispose();
+                    InternalSource = null;
                     itemsLayouter?.Clear();
                     ClearCache();
                     return;
@@ -298,8 +298,8 @@ namespace Tizen.NUI.Components
                     newNotifyCollectionChanged.CollectionChanged += CollectionChanged;
                 }
 
-                InternalItemSource?.Dispose();
-                InternalItemSource = ItemsSourceFactory.Create(this);
+                InternalSource?.Dispose();
+                InternalSource = ItemsSourceFactory.Create(this);
 
                 if (itemsLayouter == null) return;
 
@@ -536,9 +536,9 @@ namespace Tizen.NUI.Components
                     ContentContainer.Add(value);
                 }
                 header = value;
-                if (InternalItemSource != null)
+                if (InternalSource != null)
                 {
-                    InternalItemSource.HasHeader = (value != null);
+                    InternalSource.HasHeader = (value != null);
                 }
                 needInitalizeLayouter = true;
                 ReinitializeLayout();
@@ -574,15 +574,15 @@ namespace Tizen.NUI.Components
                 }
                 if (value != null)
                 {
-                    value.Index = InternalItemSource?.Count ?? 0;
+                    value.Index = InternalSource?.Count ?? 0;
                     value.ParentItemsView = this;
                     value.IsFooter = true;
                     ContentContainer.Add(value);
                 }
                 footer = value;
-                if (InternalItemSource != null)
+                if (InternalSource != null)
                 {
-                    InternalItemSource.HasFooter = (value != null);
+                    InternalSource.HasFooter = (value != null);
                 }
                 needInitalizeLayouter = true;
                 ReinitializeLayout();
@@ -613,14 +613,14 @@ namespace Tizen.NUI.Components
                 isGrouped = value;
                 needInitalizeLayouter = true;
                 //Need to re-intialize Internal Item Source.
-                if (InternalItemSource != null)
+                if (InternalSource != null)
                 {
-                    InternalItemSource.Dispose();
-                    InternalItemSource = null;
+                    InternalSource.Dispose();
+                    InternalSource = null;
                 }
                 if (ItemsSource != null)
                 {
-                    InternalItemSource = ItemsSourceFactory.Create(this);
+                    InternalSource = ItemsSourceFactory.Create(this);
                 }
 
                 ReinitializeLayout();
@@ -657,15 +657,15 @@ namespace Tizen.NUI.Components
                 needInitalizeLayouter = true;
 
                 //Need to re-intialize Internal Item Source.
-                if (InternalItemSource != null)
+                if (InternalSource != null)
                 {
-                    InternalItemSource.Dispose();
-                    InternalItemSource = null;
+                    InternalSource.Dispose();
+                    InternalSource = null;
                 }
 
                 if (ItemsSource != null)
                 {
-                    InternalItemSource = ItemsSourceFactory.Create(this);
+                    InternalSource = ItemsSourceFactory.Create(this);
                 }
 
                 ReinitializeLayout();
@@ -701,15 +701,15 @@ namespace Tizen.NUI.Components
                 needInitalizeLayouter = true;
 
                 //Need to re-intialize Internal Item Source.
-                if (InternalItemSource != null)
+                if (InternalSource != null)
                 {
-                    InternalItemSource.Dispose();
-                    InternalItemSource = null;
+                    InternalSource.Dispose();
+                    InternalSource = null;
                 }
 
                 if (ItemsSource != null)
                 {
-                    InternalItemSource = ItemsSourceFactory.Create(this);
+                    InternalSource = ItemsSourceFactory.Create(this);
                 }
 
                 ReinitializeLayout();
@@ -719,15 +719,15 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Internal encapsulated items data source.
         /// </summary>
-        internal new IGroupableItemSource InternalItemSource
+        internal new IGroupableItemSource InternalSource
         {
             get
             {
-                return (base.InternalItemSource as IGroupableItemSource);
+                return (base.InternalSource as IGroupableItemSource);
             }
             set
             {
-                base.InternalItemSource = value;
+                base.InternalSource = value;
             }
         }
 
@@ -808,7 +808,7 @@ namespace Tizen.NUI.Components
                 throw new Exception("Item Layouter must exist.");
             }
 
-            if ((InternalItemSource == null) || needInitalizeLayouter)
+            if ((InternalSource == null) || needInitalizeLayouter)
             {
                 delayedScrollTo = true;
                 delayedScrollToParam = (position, animate);
@@ -842,16 +842,16 @@ namespace Tizen.NUI.Components
                 throw new Exception("Item Layouter must exist.");
             }
 
-            if ((InternalItemSource == null) || needInitalizeLayouter)
+            if ((InternalSource == null) || needInitalizeLayouter)
             {
                 delayedIndexScrollTo = true;
                 delayedIndexScrollToParam = (index, animate, align);
                 return;
             }
 
-            if (index < 0 || index >= InternalItemSource.Count)
+            if (index < 0 || index >= InternalSource.Count)
             {
-                throw new Exception("index is out of boundary. index should be a value between (0, " + InternalItemSource.Count.ToString() + ").");
+                throw new Exception("index is out of boundary. index should be a value between (0, " + InternalSource.Count.ToString() + ").");
             }
 
             float scrollPos, curPos, curSize, curItemSize;
@@ -873,7 +873,7 @@ namespace Tizen.NUI.Components
                 curItemSize = height;
             }
 
-            //Console.WriteLine("[NUI] ScrollTo [{0}:{1}], curPos{2}, itemPos{3}, curSize{4}, itemSize{5}", InternalItemSource.GetPosition(item), align, curPos, scrollPos, curSize, curItemSize);
+            //Console.WriteLine("[NUI] ScrollTo [{0}:{1}], curPos{2}, itemPos{3}, curSize{4}, itemSize{5}", InternalSource.GetPosition(item), align, curPos, scrollPos, curSize, curItemSize);
             switch (align)
             {
                 case ItemScrollTo.Start:
@@ -974,9 +974,9 @@ namespace Tizen.NUI.Components
             return true;
         }
 
-        // Realize and Decorate the item.
-
-        internal override RecyclerViewItem RealizeItem(int index)
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal override RecyclerViewItem RealizeItem(int index)
         {
             RecyclerViewItem item;
             if (index == 0 && Header != null)
@@ -985,7 +985,7 @@ namespace Tizen.NUI.Components
                 return Header;
             }
 
-            if (index == InternalItemSource.Count - 1 && Footer != null)
+            if (index == InternalSource.Count - 1 && Footer != null)
             {
                 Footer.Show();
                 return Footer;
@@ -993,12 +993,12 @@ namespace Tizen.NUI.Components
 
             if (isGrouped)
             {
-                var context = InternalItemSource.GetItem(index);
-                if (InternalItemSource.IsGroupHeader(index))
+                var context = InternalSource.GetItem(index);
+                if (InternalSource.IsGroupHeader(index))
                 {
                     item = RealizeGroupHeader(index, context);
                 }
-                else if (InternalItemSource.IsGroupFooter(index))
+                else if (InternalSource.IsGroupFooter(index))
                 {
 
                     //group selection?
@@ -1011,7 +1011,7 @@ namespace Tizen.NUI.Components
                     {
                         throw new Exception("Item realize failed by Null content return.");
                     }
-                    item.ParentGroup = InternalItemSource.GetGroupParent(index);
+                    item.ParentGroup = InternalSource.GetGroupParent(index);
                 }
             }
             else
@@ -1045,8 +1045,9 @@ namespace Tizen.NUI.Components
             return item;
         }
 
-        // Unrealize and caching the item.
-        internal override void UnrealizeItem(RecyclerViewItem item, bool recycle = true)
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal override void UnrealizeItem(RecyclerViewItem item, bool recycle = true)
         {
             if (item == null)
             {
@@ -1064,7 +1065,7 @@ namespace Tizen.NUI.Components
                 return;
             }
 
-            if (item.isGroupHeader || item.isGroupFooter)
+            if (item.IsGroupHeader || item.IsGroupFooter)
             {
                 item.Index = -1;
                 item.ParentItemsView = null;
@@ -1217,10 +1218,10 @@ namespace Tizen.NUI.Components
                     selectedItems.Clear();
                     selectedItems = null;
                 }
-                if (InternalItemSource != null)
+                if (InternalSource != null)
                 {
-                    InternalItemSource.Dispose();
-                    InternalItemSource = null;
+                    InternalSource.Dispose();
+                    InternalSource = null;
                 }
             }
 
@@ -1333,13 +1334,13 @@ namespace Tizen.NUI.Components
 
             if (needInitalizeLayouter)
             {
-                if (InternalItemSource == null)
+                if (InternalSource == null)
                 {
                     return;
                 }
 
-                InternalItemSource.HasHeader = (header != null);
-                InternalItemSource.HasFooter = (footer != null);
+                InternalSource.HasHeader = (header != null);
+                InternalSource.HasFooter = (footer != null);
 
                 itemsLayouter.Clear();
                 ClearCache();
@@ -1384,11 +1385,11 @@ namespace Tizen.NUI.Components
                 return false;
             }
 
-            if (item.isGroupHeader)
+            if (item.IsGroupHeader)
             {
                 recycleGroupHeaderCache.Add(item);
             }
-            else if (item.isGroupFooter)
+            else if (item.IsGroupFooter)
             {
                 recycleGroupFooterCache.Add(item);
             }
@@ -1441,8 +1442,8 @@ namespace Tizen.NUI.Components
                 }
 
                 groupHeader.Template = templ;
-                groupHeader.isGroupHeader = true;
-                groupHeader.isGroupFooter = false;
+                groupHeader.IsGroupHeader = true;
+                groupHeader.IsGroupFooter = false;
                 ContentContainer.Add(groupHeader);
             }
 
@@ -1474,8 +1475,8 @@ namespace Tizen.NUI.Components
                 }
 
                 groupFooter.Template = templ;
-                groupFooter.isGroupHeader = false;
-                groupFooter.isGroupFooter = true;
+                groupFooter.IsGroupHeader = false;
+                groupFooter.IsGroupFooter = true;
                 ContentContainer.Add(groupFooter);
             }
 
index e655306..dc48d10 100755 (executable)
@@ -25,8 +25,6 @@ namespace Tizen.NUI.Components
     {
         internal RecyclerView ParentItemsView = null;
         internal object ParentGroup = null;
-        internal bool isGroupHeader;
-        internal bool isGroupFooter;
         private bool styleApplied = false;
 
         /// <summary>
index a31686e..43f080e 100755 (executable)
@@ -208,9 +208,37 @@ namespace Tizen.NUI.Components
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool IsRealized { get; internal set; }
-        internal bool IsHeader { get; set; }
-        internal bool IsFooter { get; set; }
-        internal bool IsPressed { get; set; } = false;
+
+        /// <summary>
+        /// State of Pressed.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsPressed { get; set; } = false;
+
+        /// <summary>
+        /// Boolean flag to check this item is header.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsHeader { get; set; }
+
+        /// <summary>
+        /// Boolean flag to check this item is footer.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsFooter { get; set; }
+
+        /// <summary>
+        /// Boolean flag to check this item is group header.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsGroupHeader { get; set; }
+
+        /// <summary>
+        /// Boolean flag to check this item is group footer.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsGroupFooter { get; set; }
+
 
         /// <summary>
         /// Called after a key event is received by the view that has had its focus set.
index 2c4d0a4..11881d8 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI.Components
     /// <since_tizen> 9 </since_tizen>
     public class GridLayouter : ItemsLayouter
     {
-        private CollectionView colView;
+        private CollectionView collectionView;
         private (float Width, float Height) sizeCandidate;
         private int spanSize = 1;
         private float align = 0.5f;
@@ -46,6 +46,28 @@ namespace Tizen.NUI.Components
         private Timer requestLayoutTimer = null;
         private bool isSourceEmpty;
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected new IGroupableItemSource Source => collectionView?.InternalSource;
+
+        /// <summary>
+        /// Span Size
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected int SpanSize => spanSize;
+
+        /// <summary>
+        /// Size Candidate
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected (float Width, float Height) SizeCandidate => sizeCandidate;
+
+        /// <summary>
+        /// Visible ViewItem.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override List<GroupInfo> GroupItems => groups;
+
         /// <summary>
         /// Clean up ItemsLayouter.
         /// </summary>
@@ -54,8 +76,8 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 9 </since_tizen>
         public override void Initialize(RecyclerView view)
         {
-            colView = view as CollectionView;
-            if (colView == null)
+            collectionView = view as CollectionView;
+            if (collectionView == null)
             {
                 throw new ArgumentException("GridLayouter only can be applied CollectionView.", nameof(view));
             }
@@ -63,26 +85,25 @@ namespace Tizen.NUI.Components
             // 1. Clean Up
             foreach (RecyclerViewItem item in VisibleItems)
             {
-                colView.UnrealizeItem(item, false);
+                collectionView.UnrealizeItem(item, false);
             }
             VisibleItems.Clear();
             groups.Clear();
-
             FirstVisible = 0;
             LastVisible = 0;
 
-            IsHorizontal = (colView.ScrollingDirection == ScrollableBase.Direction.Horizontal);
+            IsHorizontal = (collectionView.ScrollingDirection == ScrollableBase.Direction.Horizontal);
 
-            RecyclerViewItem header = colView?.Header;
-            RecyclerViewItem footer = colView?.Footer;
+            RecyclerViewItem header = collectionView?.Header;
+            RecyclerViewItem footer = collectionView?.Footer;
             float width, height;
-            int count = colView.InternalItemSource.Count;
+            int count = Source.Count;
             int pureCount = count - (header? 1 : 0) - (footer? 1 : 0);
 
             // 2. Get the header / footer and size deligated item and measure the size.
             if (header != null)
             {
-                MeasureChild(colView, header);
+                MeasureChild(collectionView, header);
 
                 width = header.Layout != null? header.Layout.MeasuredWidth.Size.AsRoundedValue() : 0;
                 height = header.Layout != null? header.Layout.MeasuredHeight.Size.AsRoundedValue() : 0;
@@ -94,12 +115,12 @@ namespace Tizen.NUI.Components
                 headerMargin = new Extents(itemMargin);
                 hasHeader = true;
 
-                colView.UnrealizeItem(header);
+                collectionView.UnrealizeItem(header);
             }
 
             if (footer != null)
             {
-                MeasureChild(colView, footer);
+                MeasureChild(collectionView, footer);
 
                 width = footer.Layout != null? footer.Layout.MeasuredWidth.Size.AsRoundedValue() : 0;
                 height = footer.Layout != null? footer.Layout.MeasuredHeight.Size.AsRoundedValue() : 0;
@@ -112,30 +133,30 @@ namespace Tizen.NUI.Components
                 footer.Index = count - 1;
                 hasFooter = true;
 
-                colView.UnrealizeItem(footer);
+                collectionView.UnrealizeItem(footer);
             }
 
             if (pureCount == 0)
             {
                 isSourceEmpty = true;
-                base.Initialize(colView);
+                base.Initialize(collectionView);
                 return;
             }
             isSourceEmpty = false;
 
             int firstIndex = header? 1 : 0;
 
-            if (colView.IsGrouped)
+            if (collectionView.IsGrouped)
             {
                 isGrouped = true;
 
-                if (colView.GroupHeaderTemplate != null)
+                if (collectionView.GroupHeaderTemplate != null)
                 {
-                    while (!colView.InternalItemSource.IsGroupHeader(firstIndex)) firstIndex++;
+                    while (!Source.IsGroupHeader(firstIndex)) firstIndex++;
                     //must be always true
-                    if (colView.InternalItemSource.IsGroupHeader(firstIndex))
+                    if (Source.IsGroupHeader(firstIndex))
                     {
-                        RecyclerViewItem groupHeader = colView.RealizeItem(firstIndex);
+                        RecyclerViewItem groupHeader = collectionView.RealizeItem(firstIndex);
                         firstIndex++;
 
                         if (groupHeader == null) throw new Exception("[" + firstIndex + "] Group Header failed to realize!");
@@ -148,7 +169,7 @@ namespace Tizen.NUI.Components
                         }
                         else
                         {
-                            MeasureChild(colView, groupHeader);
+                            MeasureChild(collectionView, groupHeader);
 
                             width = groupHeader.Layout.MeasuredWidth.Size.AsRoundedValue();
                             height = groupHeader.Layout.MeasuredHeight.Size.AsRoundedValue();
@@ -160,7 +181,7 @@ namespace Tizen.NUI.Components
                                             width + itemMargin.Start + itemMargin.End:
                                             height + itemMargin.Top + itemMargin.Bottom;
                         groupHeaderMargin = new Extents(itemMargin);
-                        colView.UnrealizeItem(groupHeader);
+                        collectionView.UnrealizeItem(groupHeader);
                     }
                 }
                 else
@@ -168,14 +189,14 @@ namespace Tizen.NUI.Components
                     groupHeaderSize = 0F;
                 }
 
-                if (colView.GroupFooterTemplate != null)
+                if (collectionView.GroupFooterTemplate != null)
                 {
                     int firstFooter = firstIndex;
-                    while (!colView.InternalItemSource.IsGroupFooter(firstFooter)) firstFooter++;
+                    while (!Source.IsGroupFooter(firstFooter)) firstFooter++;
                     //must be always true
-                    if (colView.InternalItemSource.IsGroupFooter(firstFooter))
+                    if (Source.IsGroupFooter(firstFooter))
                     {
-                        RecyclerViewItem groupFooter = colView.RealizeItem(firstFooter);
+                        RecyclerViewItem groupFooter = collectionView.RealizeItem(firstFooter);
 
                         if (groupFooter == null) throw new Exception("[" + firstFooter + "] Group Footer failed to realize!");
                         // Need to Set proper height or width on scroll direction.
@@ -186,7 +207,7 @@ namespace Tizen.NUI.Components
                         }
                         else
                         {
-                            MeasureChild(colView, groupFooter);
+                            MeasureChild(collectionView, groupFooter);
 
                             width = groupFooter.Layout.MeasuredWidth.Size.AsRoundedValue();
                             height = groupFooter.Layout.MeasuredHeight.Size.AsRoundedValue();
@@ -198,7 +219,7 @@ namespace Tizen.NUI.Components
                                             height + itemMargin.Top + itemMargin.Bottom;
                         groupFooterMargin = new Extents(itemMargin);
 
-                        colView.UnrealizeItem(groupFooter);
+                        collectionView.UnrealizeItem(groupFooter);
                     }
                 }
                 else
@@ -210,20 +231,20 @@ namespace Tizen.NUI.Components
 
             bool failed = false;
             //Final Check of FirstIndex
-            if ((colView.InternalItemSource.Count - 1 < firstIndex) ||
-                (colView.InternalItemSource.IsFooter(firstIndex) && (colView.InternalItemSource.Count - 1) == firstIndex))
+            if ((Source.Count - 1 < firstIndex) ||
+                (Source.IsFooter(firstIndex) && (Source.Count - 1) == firstIndex))
             {
                 StepCandidate = 0F;
                 failed = true;
             }
 
             while (!failed &&
-                   (colView.InternalItemSource.IsHeader(firstIndex) ||
-                    colView.InternalItemSource.IsGroupHeader(firstIndex) ||
-                    colView.InternalItemSource.IsGroupFooter(firstIndex)))
+                    Source.IsHeader(firstIndex) ||
+                    Source.IsGroupHeader(firstIndex) ||
+                    Source.IsGroupFooter(firstIndex))
             {
-                if (colView.InternalItemSource.IsFooter(firstIndex)
-                    || ((colView.InternalItemSource.Count - 1) <= firstIndex))
+                if (Source.IsFooter(firstIndex)
+                    || ((Source.Count - 1) <= firstIndex))
                 {
                     StepCandidate = 0F;
                     failed = true;
@@ -236,12 +257,12 @@ namespace Tizen.NUI.Components
             if (!failed)
             {
                 // Get Size Deligate. FIXME if group exist index must be changed.
-                RecyclerViewItem sizeDeligate = colView.RealizeItem(firstIndex);
+                RecyclerViewItem sizeDeligate = collectionView.RealizeItem(firstIndex);
                 if (sizeDeligate == null)
                 {
                     throw new Exception("Cannot create content from DatTemplate.");
                 }
-                sizeDeligate.BindingContext = colView.InternalItemSource.GetItem(firstIndex);
+                sizeDeligate.BindingContext = Source.GetItem(firstIndex);
 
                 // Need to Set proper height or width on scroll direction.
                 if (sizeDeligate.Layout == null)
@@ -251,7 +272,7 @@ namespace Tizen.NUI.Components
                 }
                 else
                 {
-                    MeasureChild(colView, sizeDeligate);
+                    MeasureChild(collectionView, sizeDeligate);
 
                     width = sizeDeligate.Layout.MeasuredWidth.Size.AsRoundedValue();
                     height = sizeDeligate.Layout.MeasuredHeight.Size.AsRoundedValue();
@@ -269,12 +290,12 @@ namespace Tizen.NUI.Components
                 if (width == 0) width = 1;
                 if (height == 0) height = 1;
                 spanSize = IsHorizontal?
-                            Convert.ToInt32(Math.Truncate((double)((colView.Size.Height - Padding.Top - Padding.Bottom) / height))) :
-                            Convert.ToInt32(Math.Truncate((double)((colView.Size.Width - Padding.Start - Padding.End) / width)));
+                            Convert.ToInt32(Math.Truncate((double)((collectionView.Size.Height - Padding.Top - Padding.Bottom) / height))) :
+                            Convert.ToInt32(Math.Truncate((double)((collectionView.Size.Width - Padding.Start - Padding.End) / width)));
 
                 sizeCandidate = (width, height);
 
-                colView.UnrealizeItem(sizeDeligate);
+                collectionView.UnrealizeItem(sizeDeligate);
             }
 
             if (StepCandidate < 1) StepCandidate = 1;
@@ -283,7 +304,7 @@ namespace Tizen.NUI.Components
             if (isGrouped)
             {
                 float Current = 0.0F;
-                IGroupableItemSource source = colView.InternalItemSource;
+                IGroupableItemSource source = Source;
                 GroupInfo currentGroup = null;
                 object currentParent = null;
 
@@ -331,7 +352,7 @@ namespace Tizen.NUI.Components
                             if (currentGroup != null)
                             {
                                 currentGroup.Count++;
-                                int index = i - currentGroup.StartIndex - ((colView.GroupHeaderTemplate != null) ? 1 : 0);
+                                int index = i - currentGroup.StartIndex - ((collectionView.GroupHeaderTemplate != null) ? 1 : 0);
                                 if ((index % spanSize) == 0)
                                 {
                                     currentGroup.GroupSize += StepCandidate;
@@ -355,10 +376,10 @@ namespace Tizen.NUI.Components
                                 ScrollContentSize + Padding.Start + Padding.End:
                                 ScrollContentSize + Padding.Top + Padding.Bottom;
 
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
-            base.Initialize(colView);
+            base.Initialize(collectionView);
             //Console.WriteLine("Init Done, StepCnadidate{0}, spanSize{1}, Scroll{2}", StepCandidate, spanSize, ScrollContentSize);
         }
 
@@ -372,20 +393,20 @@ namespace Tizen.NUI.Components
         {
             // Layouting is only possible after once it intialized.
             if (!IsInitialized) return;
-            int LastIndex = colView.InternalItemSource.Count;
+            int LastIndex = Source.Count;
 
             if (!force && PrevScrollPosition == Math.Abs(scrollPosition)) return;
             PrevScrollPosition = Math.Abs(scrollPosition);
 
             int prevFirstVisible = FirstVisible;
             int prevLastVisible = LastVisible;
-            bool IsHorizontal = (colView.ScrollingDirection == ScrollableBase.Direction.Horizontal);
+            bool IsHorizontal = (collectionView.ScrollingDirection == ScrollableBase.Direction.Horizontal);
 
             (float X, float Y) visibleArea = (PrevScrollPosition,
-                PrevScrollPosition + (IsHorizontal? colView.Size.Width : colView.Size.Height)
+                PrevScrollPosition + (IsHorizontal? collectionView.Size.Width : collectionView.Size.Height)
             );
 
-            //Console.WriteLine("[NUI] itemsView [{0},{1}] [{2},{3}]", colView.Size.Width, colView.Size.Height, colView.ContentContainer.Size.Width, colView.ContentContainer.Size.Height);
+            //Console.WriteLine("[NUI] itemsView [{0},{1}] [{2},{3}]", collectionView.Size.Width, collectionView.Size.Height, collectionView.ContentContainer.Size.Width, collectionView.ContentContainer.Size.Height);
 
             // 1. Set First/Last Visible Item Index.
             (int start, int end) = FindVisibleItems(visibleArea);
@@ -402,7 +423,7 @@ namespace Tizen.NUI.Components
                 {
                     //Console.WriteLine("[NUI] Unrealize{0}!", item.Index);
                     unrealizedItems.Add(item);
-                    colView.UnrealizeItem(item);
+                    collectionView.UnrealizeItem(item);
                 }
             }
             VisibleItems.RemoveAll(unrealizedItems.Contains);
@@ -421,7 +442,7 @@ namespace Tizen.NUI.Components
                 }
                 if (item == null)
                 {
-                    item = colView.RealizeItem(i);
+                    item = collectionView.RealizeItem(i);
                     if (item != null) VisibleItems.Add(item);
                     else throw new Exception("Failed to create RecycerViewItem index of ["+ i + "]");
                 }
@@ -432,15 +453,15 @@ namespace Tizen.NUI.Components
                 item.Position = new Position(x, y);
 
                 //Linear Item need to be resized!
-                if (item.IsHeader || item.IsFooter || item.isGroupHeader || item.isGroupFooter)
+                if (item.IsHeader || item.IsFooter || item.IsGroupHeader || item.IsGroupFooter)
                 {
                     var size = (IsHorizontal? item.SizeWidth: item.SizeHeight);
-                    if (colView.SizingStrategy == ItemSizingStrategy.MeasureFirst)
+                    if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureFirst)
                     {
                         if (item.IsHeader) size = headerSize;
                         else if (item.IsFooter) size = footerSize;
-                        else if (item.isGroupHeader) size = groupHeaderSize;
-                        else if (item.isGroupFooter) size = groupFooterSize;
+                        else if (item.IsGroupHeader) size = groupHeaderSize;
+                        else if (item.IsGroupFooter) size = groupFooterSize;
                     }
                     if (IsHorizontal && item.HeightSpecification == LayoutParamPolicies.MatchParent)
                     {
@@ -517,10 +538,10 @@ namespace Tizen.NUI.Components
         {
             // Insert Single item.
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
             if (isSourceEmpty || StepCandidate <= 1)
             {
-                Initialize(colView);
+                Initialize(collectionView);
             }
 
             // Will be null if not a group.
@@ -584,13 +605,13 @@ namespace Tizen.NUI.Components
                     }
                     else
                     {
-                        if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                        if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                         {
                             // Wrong! Grid Layouter do not support MeasureAll!
                         }
                         else
                         {
-                            int pureCount = groupInfo.Count - 1 - (colView.GroupFooterTemplate == null? 0: 1);
+                            int pureCount = groupInfo.Count - 1 - (collectionView.GroupFooterTemplate == null? 0: 1);
                             if (pureCount % spanSize == 0)
                             {
                                 currentSize = StepCandidate;
@@ -614,11 +635,11 @@ namespace Tizen.NUI.Components
             }
             else
             {
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 {
                     // Wrong! Grid Layouter do not support MeasureAll!
                 }
-                int pureCount = colView.InternalItemSource.Count - (hasHeader? 1: 0) - (hasFooter? 1: 0);
+                int pureCount = Source.Count - (hasHeader? 1: 0) - (hasFooter? 1: 0);
 
                 // Count comes after updated in ungrouped case!
                 if (pureCount % spanSize == 1)
@@ -630,8 +651,8 @@ namespace Tizen.NUI.Components
             // 3. Update Scroll Content Size
             ScrollContentSize += currentSize;
 
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 4. Update Visible Items.
             foreach (RecyclerViewItem item in VisibleItems)
@@ -652,7 +673,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -669,10 +690,10 @@ namespace Tizen.NUI.Components
         {
              // Insert Group
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
             if (isSourceEmpty || StepCandidate <= 1)
             {
-                Initialize(colView);
+                Initialize(collectionView);
             }
 
             float currentSize = StepCandidate;
@@ -731,13 +752,13 @@ namespace Tizen.NUI.Components
                         }
                         else
                         {
-                            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                             {
                                 // Wrong! Grid Layouter do not support MeasureAll!
                             }
                             else
                             {
-                                int index = current - groupStartIndex - ((colView.GroupHeaderTemplate != null)? 1: 0);
+                                int index = current - groupStartIndex - ((collectionView.GroupHeaderTemplate != null)? 1: 0);
                                 if ((index % spanSize) == 0)
                                 {
                                     groupInfo.GroupSize += StepCandidate;
@@ -777,8 +798,8 @@ namespace Tizen.NUI.Components
             }
 
             // 3. Update Scroll Content Size
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 4. Update Visible Items.
             foreach (RecyclerViewItem item in VisibleItems)
@@ -798,7 +819,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -815,7 +836,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Single
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = 0;
@@ -865,13 +886,13 @@ namespace Tizen.NUI.Components
                     groupInfo.Count--;
 
                     // Skip footer case as footer cannot exist alone without header.
-                    if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                    if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                     {
                         // Wrong! Grid Layouter do not support MeasureAll!
                     }
                     else
                     {
-                        int pureCount = groupInfo.Count - 1 - (colView.GroupFooterTemplate == null? 0: 1);
+                        int pureCount = groupInfo.Count - 1 - (collectionView.GroupFooterTemplate == null? 0: 1);
                         if (pureCount % spanSize == 0)
                         {
                                 currentSize = StepCandidate;
@@ -888,11 +909,11 @@ namespace Tizen.NUI.Components
             }
             else
             {
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 {
                     // Wrong! Grid Layouter do not support MeasureAll!
                 }
-                int pureCount = colView.InternalItemSource.Count - (hasHeader? 1: 0) - (hasFooter? 1: 0);
+                int pureCount = Source.Count - (hasHeader? 1: 0) - (hasFooter? 1: 0);
 
                 // Count comes after updated in ungrouped case!
                 if (pureCount % spanSize == 0)
@@ -905,8 +926,8 @@ namespace Tizen.NUI.Components
             ScrollContentSize -= currentSize;
 
             // 3. Update Scroll Content Size
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 4. Update Visible Items.
             RecyclerViewItem targetItem = null;
@@ -915,7 +936,7 @@ namespace Tizen.NUI.Components
                 if (item.Index == startIndex)
                 {
                     targetItem = item;
-                    colView.UnrealizeItem(item);
+                    collectionView.UnrealizeItem(item);
                 }
                 else if (item.Index > startIndex)
                 {
@@ -933,7 +954,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -950,7 +971,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Group
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -981,7 +1002,7 @@ namespace Tizen.NUI.Components
                 // Check item is group parent or not
                 // if group parent, add new gorupinfo
                 currentSize = groupInfo.GroupSize;
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 {
                     // Wrong! Grid Layouter do not support MeasureAll!
                 }
@@ -1004,8 +1025,8 @@ namespace Tizen.NUI.Components
             ScrollContentSize -= currentSize;
 
             // 2. Update Scroll Content Size
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 3. Update Visible Items.
             List<RecyclerViewItem> unrealizedItems = new List<RecyclerViewItem>();
@@ -1015,7 +1036,7 @@ namespace Tizen.NUI.Components
                     && (item.Index < startIndex + count))
                 {
                     unrealizedItems.Add(item);
-                    colView.UnrealizeItem(item);
+                    collectionView.UnrealizeItem(item);
                 }
                 else if (item.Index >= startIndex + count)
                 {
@@ -1034,7 +1055,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -1051,7 +1072,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Single
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1087,8 +1108,8 @@ namespace Tizen.NUI.Components
                 }
             }
 
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // Position Adjust
             float scrollPosition = PrevScrollPosition;
@@ -1100,7 +1121,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -1117,7 +1138,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Groups
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1214,7 +1235,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -1250,7 +1271,7 @@ namespace Tizen.NUI.Components
 
             View nextFocusedView = null;
             int targetSibling = -1;
-            bool IsHorizontal = colView.ScrollingDirection == ScrollableBase.Direction.Horizontal;
+            bool IsHorizontal = collectionView.ScrollingDirection == ScrollableBase.Direction.Horizontal;
 
             switch (direction)
             {
@@ -1279,7 +1300,7 @@ namespace Tizen.NUI.Components
             if (targetSibling > -1 && targetSibling < Container.Children.Count)
             {
                 RecyclerViewItem candidate = Container.Children[targetSibling] as RecyclerViewItem;
-                if (candidate != null && candidate.Index >= 0 && candidate.Index < colView.InternalItemSource.Count)
+                if (candidate != null && candidate.Index >= 0 && candidate.Index < Source.Count)
                 {
                     nextFocusedView = candidate;
                 }
@@ -1291,7 +1312,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override (int start, int end) FindVisibleItems((float X, float Y) visibleArea)
         {
-            int MaxIndex = colView.InternalItemSource.Count - 1 - (hasFooter ? 1 : 0);
+            int MaxIndex = Source.Count - 1 - (hasFooter ? 1 : 0);
             int adds = spanSize * 2;
             int skipGroup = -1;
             (int start, int end) found = (0, 0);
@@ -1422,20 +1443,22 @@ namespace Tizen.NUI.Components
             return found;
         }
 
-        internal override (float X, float Y) GetItemPosition(int index)
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal override (float X, float Y) GetItemPosition(int index)
         {
             float xPos, yPos;
             int spaceStartX = Padding.Start;
             int spaceStartY = Padding.Top;
             int emptyArea = IsHorizontal?
-                            (int)(colView.Size.Height - Padding.Top - Padding.Bottom - (sizeCandidate.Height * spanSize)) :
-                            (int)(colView.Size.Width - Padding.Start - Padding.End - (sizeCandidate.Width * spanSize));
+                            (int)(collectionView.Size.Height - Padding.Top - Padding.Bottom - (sizeCandidate.Height * spanSize)) :
+                            (int)(collectionView.Size.Width - Padding.Start - Padding.End - (sizeCandidate.Width * spanSize));
 
             if (hasHeader && index == 0)
             {
                 return (spaceStartX + headerMargin.Start, spaceStartY + headerMargin.Top);
             }
-            if (hasFooter && index == colView.InternalItemSource.Count - 1)
+            if (hasFooter && index == Source.Count - 1)
             {
                 xPos = IsHorizontal?
                         ScrollContentSize - Padding.End - footerSize + footerMargin.Start:
@@ -1449,7 +1472,7 @@ namespace Tizen.NUI.Components
             GroupInfo myGroup = GetGroupInfo(index);
             if (isGrouped && null != myGroup)
             {
-                if (colView.InternalItemSource.IsGroupHeader(index))
+                if (Source.IsGroupHeader(index))
                 {
                     spaceStartX+= groupHeaderMargin.Start;
                     spaceStartY+= groupHeaderMargin.Top;
@@ -1460,7 +1483,7 @@ namespace Tizen.NUI.Components
                             spaceStartY:
                             myGroup.GroupPosition + groupHeaderMargin.Top;
                 }
-                else if (colView.InternalItemSource.IsGroupFooter(index))
+                else if (Source.IsGroupFooter(index))
                 {
                     spaceStartX+= groupFooterMargin.Start;
                     spaceStartY+= groupFooterMargin.Top;
@@ -1473,7 +1496,7 @@ namespace Tizen.NUI.Components
                 }
                 else
                 {
-                    int pureIndex = index - myGroup.StartIndex - ((colView.GroupHeaderTemplate != null)? 1: 0);
+                    int pureIndex = index - myGroup.StartIndex - ((collectionView.GroupHeaderTemplate != null)? 1: 0);
                     int division = pureIndex / spanSize;
                     int remainder = pureIndex % spanSize;
                     if (division < 0) division = 0;
@@ -1491,7 +1514,7 @@ namespace Tizen.NUI.Components
             }
             else
             {
-                int pureIndex = index - (colView.Header ? 1 : 0);
+                int pureIndex = index - (collectionView.Header ? 1 : 0);
                 // int convert must be truncate value.
                 int division = pureIndex / spanSize;
                 int remainder = pureIndex % spanSize;
@@ -1511,11 +1534,14 @@ namespace Tizen.NUI.Components
             return (xPos, yPos);
         }
 
-        internal override (float Width, float Height) GetItemSize(int index)
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal override (float Width, float Height) GetItemSize(int index)
         {
             return (sizeCandidate.Width - CandidateMargin.Start - CandidateMargin.End,
                     sizeCandidate.Height - CandidateMargin.Top - CandidateMargin.Bottom);
         }
+
         private void DelayedRequestLayout(float scrollPosition , bool force = true)
         {
             if (requestLayoutTimer != null)
@@ -1533,16 +1559,6 @@ namespace Tizen.NUI.Components
             requestLayoutTimer.Start();
         }
 
-        private RecyclerViewItem GetVisibleItem(int index)
-        {
-            foreach (RecyclerViewItem item in VisibleItems)
-            {
-                if (item.Index == index) return item;
-            }
-
-            return null;
-        }
-
         private GroupInfo GetGroupInfo(int index)
         {
             if (Visited != null)
@@ -1584,15 +1600,5 @@ namespace Tizen.NUI.Components
             return null;
         }
         */
-
-        class GroupInfo
-        {
-            public object GroupParent;
-            public int StartIndex;
-            public int Count;
-            public float GroupSize;
-            public float GroupPosition;
-            //Items relative position from the GroupPosition
-        }
     }
 }
index bf16e6a..455d62c 100755 (executable)
@@ -50,11 +50,19 @@ namespace Tizen.NUI.Components
             }
         }
 
+
+        /// <summary>
+        /// Internal item source that organized.
+        /// Check IItemSource and IGrouppedItemSoure also.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected IItemSource Source => ItemsView?.InternalSource;
+
         /// <summary>
         /// Container which contains ViewItems.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected View Container { get; set; }
+        protected View Container =>ItemsView?.ContentContainer;
 
         /// <summary>
         /// Parent ItemsView.
@@ -87,6 +95,12 @@ namespace Tizen.NUI.Components
         protected List<RecyclerViewItem> VisibleItems { get; } = new List<RecyclerViewItem>();
 
         /// <summary>
+        /// Visible ViewItem.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual List<GroupInfo> GroupItems { get; }
+
+        /// <summary>
         /// Flag of layouter initialization.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -124,7 +138,6 @@ namespace Tizen.NUI.Components
         public virtual void Initialize(RecyclerView view)
         {
             ItemsView = view ?? throw new ArgumentNullException(nameof(view));
-            Container = view.ContentContainer;
             PrevScrollPosition = 0.0f;
 
             IsHorizontal = (view.ScrollingDirection == ScrollableBase.Direction.Horizontal);
@@ -166,7 +179,6 @@ namespace Tizen.NUI.Components
             {
                 if (ItemsView != null) Container.Size = ItemsView.Size;
                 Container.Position = new Position(0.0f, 0.0f);
-                Container = null;
             }
             ItemsView = null;
         }
@@ -381,14 +393,80 @@ namespace Tizen.NUI.Components
             }
         }
 
-        internal virtual (float X, float Y) GetItemPosition(int index)
+        /// <summary>
+        /// Get item position.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal virtual (float X, float Y) GetItemPosition(int index)
         {
             return (0, 0);
         }
 
-        internal virtual (float Width, float Height) GetItemSize(int index)
+        /// <summary>
+        /// Get item size.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal virtual (float Width, float Height) GetItemSize(int index)
         {
             return (0, 0);
         }
+
+        /// <summary>
+        /// Get visible item object on index if it is realized.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual RecyclerViewItem GetVisibleItem(int index)
+        {
+
+            foreach (RecyclerViewItem item in VisibleItems)
+            {
+                if (item.Index == index) return item;
+            }
+            return null;
+        }
+
+        /// <summary>
+        /// The data class for group informations.
+        /// inherited class can use this data to managing group items feature.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal class GroupInfo
+        {
+            /// <summary>
+            /// Group parent object.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public object GroupParent;
+
+            /// <summary>
+            /// Group start index.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public int StartIndex;
+
+            /// <summary>
+            /// Group count.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public int Count;
+
+            /// <summary>
+            /// Group size. this value is size of scrollable axis only.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public float GroupSize;
+
+            /// <summary>
+            /// Group position. this value is size of scrollable axis only.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public float GroupPosition;
+
+            /// <summary>
+            /// List of group items position.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public List<float> ItemPosition = new List<float>();
+        }
     }
 }
index 98d3a08..7a5f4fd 100755 (executable)
@@ -29,7 +29,7 @@ namespace Tizen.NUI.Components
         private readonly List<float> ItemPosition = new List<float>();
         private readonly List<float> ItemSize = new List<float>();
         private int ItemSizeChanged = -1;
-        private CollectionView colView;
+        private CollectionView collectionView;
         private bool hasHeader;
         private float headerSize;
         private Extents headerMargin;
@@ -46,6 +46,16 @@ namespace Tizen.NUI.Components
         private Timer requestLayoutTimer = null;
         private bool isSourceEmpty;
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected new IGroupableItemSource Source => collectionView?.InternalSource;
+
+        /// <summary>
+        /// Visible ViewItem.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override List<GroupInfo> GroupItems => groups;
+
         /// <summary>
         /// Clean up ItemsLayouter.
         /// </summary>
@@ -54,27 +64,32 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 9 </since_tizen>
         public override void Initialize(RecyclerView view)
         {
-            colView = view as CollectionView;
-            if (colView == null)
+            collectionView = view as CollectionView;
+            if (collectionView == null)
             {
                 throw new ArgumentException("LinearLayouter only can be applied CollectionView.", nameof(view));
             }
-            // 1. Clean Up
-            Clear();
 
+            // 1. Clean Up
+            foreach (RecyclerViewItem item in VisibleItems)
+            {
+                collectionView.UnrealizeItem(item, false);
+            }
+            VisibleItems.Clear();
+            groups.Clear();
             FirstVisible = 0;
             LastVisible = 0;
 
-            IsHorizontal = (colView.ScrollingDirection == ScrollableBase.Direction.Horizontal);
+            IsHorizontal = (collectionView.ScrollingDirection == ScrollableBase.Direction.Horizontal);
 
-            RecyclerViewItem header = colView?.Header;
-            RecyclerViewItem footer = colView?.Footer;
+            RecyclerViewItem header = collectionView?.Header;
+            RecyclerViewItem footer = collectionView?.Footer;
             float width, height;
-            int count = colView.InternalItemSource.Count;
+            int count = Source.Count;
 
             if (header != null)
             {
-                MeasureChild(colView, header);
+                MeasureChild(collectionView, header);
 
                 width = header.Layout != null? header.Layout.MeasuredWidth.Size.AsRoundedValue() : 0;
                 height = header.Layout != null? header.Layout.MeasuredHeight.Size.AsRoundedValue() : 0;
@@ -86,13 +101,13 @@ namespace Tizen.NUI.Components
                 headerMargin = new Extents(itemMargin);
                 hasHeader = true;
 
-                colView.UnrealizeItem(header);
+                collectionView.UnrealizeItem(header);
             }
             else hasHeader = false;
 
             if (footer != null)
             {
-                MeasureChild(colView, footer);
+                MeasureChild(collectionView, footer);
 
                 width = footer.Layout != null? footer.Layout.MeasuredWidth.Size.AsRoundedValue() : 0;
                 height = footer.Layout != null? footer.Layout.MeasuredHeight.Size.AsRoundedValue() : 0;
@@ -105,7 +120,7 @@ namespace Tizen.NUI.Components
                 footer.Index = count - 1;
                 hasFooter = true;
 
-                colView.UnrealizeItem(footer);
+                collectionView.UnrealizeItem(footer);
             }
             else hasFooter = false;
 
@@ -120,17 +135,17 @@ namespace Tizen.NUI.Components
 
             int firstIndex = hasHeader? 1 : 0;
 
-            if (colView.IsGrouped)
+            if (collectionView.IsGrouped)
             {
                 isGrouped = true;
 
-                if (colView.GroupHeaderTemplate != null)
+                if (collectionView.GroupHeaderTemplate != null)
                 {
-                    while (!colView.InternalItemSource.IsGroupHeader(firstIndex)) firstIndex++;
+                    while (!Source.IsGroupHeader(firstIndex)) firstIndex++;
                     //must be always true
-                    if (colView.InternalItemSource.IsGroupHeader(firstIndex))
+                    if (Source.IsGroupHeader(firstIndex))
                     {
-                        RecyclerViewItem groupHeader = colView.RealizeItem(firstIndex);
+                        RecyclerViewItem groupHeader = collectionView.RealizeItem(firstIndex);
                         firstIndex++;
 
                         if (groupHeader == null) throw new Exception("[" + firstIndex + "] Group Header failed to realize!");
@@ -143,7 +158,7 @@ namespace Tizen.NUI.Components
                         }
                         else
                         {
-                            MeasureChild(colView, groupHeader);
+                            MeasureChild(collectionView, groupHeader);
 
                             width = groupHeader.Layout.MeasuredWidth.Size.AsRoundedValue();
                             height = groupHeader.Layout.MeasuredHeight.Size.AsRoundedValue();
@@ -154,7 +169,7 @@ namespace Tizen.NUI.Components
                                             width + itemMargin.Start + itemMargin.End:
                                             height + itemMargin.Top + itemMargin.Bottom;
                         groupHeaderMargin = new Extents(itemMargin);
-                        colView.UnrealizeItem(groupHeader);
+                        collectionView.UnrealizeItem(groupHeader);
                     }
                 }
                 else
@@ -162,14 +177,14 @@ namespace Tizen.NUI.Components
                     groupHeaderSize = 0F;
                 }
 
-                if (colView.GroupFooterTemplate != null)
+                if (collectionView.GroupFooterTemplate != null)
                 {
                     int firstFooter = firstIndex;
-                    while (!colView.InternalItemSource.IsGroupFooter(firstFooter)) firstFooter++;
+                    while (!Source.IsGroupFooter(firstFooter)) firstFooter++;
                     //must be always true
-                    if (colView.InternalItemSource.IsGroupFooter(firstFooter))
+                    if (Source.IsGroupFooter(firstFooter))
                     {
-                        RecyclerViewItem groupFooter = colView.RealizeItem(firstFooter);
+                        RecyclerViewItem groupFooter = collectionView.RealizeItem(firstFooter);
 
                         if (groupFooter == null) throw new Exception("[" + firstFooter + "] Group Footer failed to realize!");
                         // Need to Set proper height or width on scroll direction.
@@ -180,7 +195,7 @@ namespace Tizen.NUI.Components
                         }
                         else
                         {
-                            MeasureChild(colView, groupFooter);
+                            MeasureChild(collectionView, groupFooter);
 
                             width = groupFooter.Layout.MeasuredWidth.Size.AsRoundedValue();
                             height = groupFooter.Layout.MeasuredHeight.Size.AsRoundedValue();
@@ -191,7 +206,7 @@ namespace Tizen.NUI.Components
                                             width + itemMargin.Start + itemMargin.End:
                                             height + itemMargin.Top + itemMargin.Bottom;
                         groupFooterMargin = new Extents(itemMargin);
-                        colView.UnrealizeItem(groupFooter);
+                        collectionView.UnrealizeItem(groupFooter);
                     }
                 }
                 else
@@ -204,21 +219,20 @@ namespace Tizen.NUI.Components
             bool failed = false;
 
             //Final Check of FirstIndex
-            if ((colView.InternalItemSource.Count - 1 < firstIndex) ||
-                (colView.InternalItemSource.IsFooter(firstIndex) && (colView.InternalItemSource.Count - 1) == firstIndex))
+            if ((Source.Count - 1 < firstIndex) ||
+                (Source.IsFooter(firstIndex) && (Source.Count - 1) == firstIndex))
             {
                 StepCandidate = 0F;
                 failed = true;
             }
 
             while (!failed &&
-                   (colView.InternalItemSource.IsHeader(firstIndex) ||
-                    colView.InternalItemSource.IsGroupHeader(firstIndex) ||
-                    colView.InternalItemSource.IsGroupFooter(firstIndex)))
+                    Source.IsHeader(firstIndex) ||
+                    Source.IsGroupHeader(firstIndex) ||
+                    Source.IsGroupFooter(firstIndex))
             {
-
-                if (colView.InternalItemSource.IsFooter(firstIndex)
-                    || ((colView.InternalItemSource.Count - 1) <= firstIndex))
+                if (Source.IsFooter(firstIndex)
+                    || ((Source.Count - 1) <= firstIndex))
                 {
                     StepCandidate = 0F;
                     failed = true;
@@ -229,14 +243,14 @@ namespace Tizen.NUI.Components
 
             if (!failed)
             {
-                RecyclerViewItem sizeDeligate = colView.RealizeItem(firstIndex);
+                RecyclerViewItem sizeDeligate = collectionView.RealizeItem(firstIndex);
                 if (sizeDeligate == null)
                 {
                     // error !
                     throw new Exception("Cannot create content from DatTemplate.");
                 }
 
-                sizeDeligate.BindingContext = colView.InternalItemSource.GetItem(firstIndex);
+                sizeDeligate.BindingContext = Source.GetItem(firstIndex);
 
                 // Need to Set proper height or width on scroll direction.
                 if (sizeDeligate.Layout == null)
@@ -246,7 +260,7 @@ namespace Tizen.NUI.Components
                 }
                 else
                 {
-                    MeasureChild(colView, sizeDeligate);
+                    MeasureChild(collectionView, sizeDeligate);
 
                     width = sizeDeligate.Layout.MeasuredWidth.Size.AsRoundedValue();
                     height = sizeDeligate.Layout.MeasuredHeight.Size.AsRoundedValue();
@@ -259,16 +273,16 @@ namespace Tizen.NUI.Components
                 CandidateMargin = new Extents(itemMargin);
                 if (StepCandidate == 0) StepCandidate = 1; //????
 
-                colView.UnrealizeItem(sizeDeligate, false);
+                collectionView.UnrealizeItem(sizeDeligate, false);
             }
 
             float Current = IsHorizontal? Padding.Start : Padding.Top;
-            IGroupableItemSource source = colView.InternalItemSource;
+            IGroupableItemSource source = Source;
             GroupInfo currentGroup = null;
             object currentParent = null;
             for (int i = 0; i < count; i++)
             {
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 {
                     if (i == 0 && hasHeader)
                         ItemSize.Add(headerSize);
@@ -311,7 +325,7 @@ namespace Tizen.NUI.Components
                                 GroupSize = currentSize,
                                 GroupPosition = Current
                             };
-                            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                                 currentGroup.ItemPosition.Add(0);
                             groups.Add(currentGroup);
                             if (source.IsGroupHeader(i)) Current += currentSize;
@@ -324,7 +338,7 @@ namespace Tizen.NUI.Components
                             {
                                 currentGroup.Count++;
                                 currentGroup.GroupSize += groupFooterSize;
-                                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                                     currentGroup.ItemPosition.Add(Current - currentGroup.GroupPosition);
                                 Current += groupFooterSize;
                             }
@@ -335,7 +349,7 @@ namespace Tizen.NUI.Components
                             {
                                 currentGroup.Count++;
                                 currentGroup.GroupSize += StepCandidate;
-                                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                                     currentGroup.ItemPosition.Add(Current - currentGroup.GroupPosition);
                                 Current += StepCandidate;
                             }
@@ -344,7 +358,7 @@ namespace Tizen.NUI.Components
                 }
                 else
                 {
-                    if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                    if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                         ItemPosition.Add(Current);
 
                     if (i == 0 && hasHeader) Current += headerSize;
@@ -354,8 +368,8 @@ namespace Tizen.NUI.Components
             }
 
             ScrollContentSize = Current + (IsHorizontal? Padding.End : Padding.Bottom);
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             base.Initialize(view);
             //Console.WriteLine("[NUI] Init Done, StepCnadidate{0}, Scroll{1}", StepCandidate, ScrollContentSize);
@@ -379,7 +393,7 @@ namespace Tizen.NUI.Components
                 force = true;
             }
 
-            int LastIndex = colView.InternalItemSource.Count - 1;
+            int LastIndex = Source.Count - 1;
 
             if (!force && PrevScrollPosition == Math.Abs(scrollPosition)) return;
             PrevScrollPosition = Math.Abs(scrollPosition);
@@ -396,7 +410,7 @@ namespace Tizen.NUI.Components
             int prevLastVisible = LastVisible;
 
             (float X, float Y) visibleArea = (PrevScrollPosition,
-                PrevScrollPosition + (IsHorizontal? colView.Size.Width : colView.Size.Height)
+                PrevScrollPosition + (IsHorizontal? collectionView.Size.Width : collectionView.Size.Height)
             );
 
             // 1. Set First/Last Visible Item Index.
@@ -411,7 +425,7 @@ namespace Tizen.NUI.Components
                 if (item.Index < FirstVisible || item.Index > LastVisible)
                 {
                     unrealizedItems.Add(item);
-                    colView.UnrealizeItem(item);
+                    collectionView.UnrealizeItem(item);
                 }
             }
             VisibleItems.RemoveAll(unrealizedItems.Contains);
@@ -430,7 +444,7 @@ namespace Tizen.NUI.Components
 
                 if (item == null)
                 {
-                    item = colView.RealizeItem(i);
+                    item = collectionView.RealizeItem(i);
                     if (item != null) VisibleItems.Add(item);
                     else throw new Exception("Failed to create RecycerViewItem index of ["+ i + "]");
                 }
@@ -440,14 +454,14 @@ namespace Tizen.NUI.Components
 
                 var size = (IsHorizontal? item.SizeWidth: item.SizeHeight);
 
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureFirst)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureFirst)
                 {
-                    if (item.IsHeader || item.IsFooter || item.isGroupHeader || item.isGroupFooter)
+                    if (item.IsHeader || item.IsFooter || item.IsGroupHeader || item.IsGroupFooter)
                     {
                         if (item.IsHeader) size = headerSize;
                         else if (item.IsFooter) size = footerSize;
-                        else if (item.isGroupHeader) size = groupHeaderSize;
-                        else if (item.isGroupFooter) size = groupFooterSize;
+                        else if (item.IsGroupHeader) size = groupHeaderSize;
+                        else if (item.IsGroupFooter) size = groupFooterSize;
                     }
                     else size = StepCandidate;
                 }
@@ -525,16 +539,16 @@ namespace Tizen.NUI.Components
         {
             if (item == null)
                 throw new ArgumentNullException(nameof(item));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             if (!IsInitialized ||
-                (colView.SizingStrategy == ItemSizingStrategy.MeasureFirst &&
+                (collectionView.SizingStrategy == ItemSizingStrategy.MeasureFirst &&
                 item.Index != 0) ||
                 (item.Index < 0))
                 return;
 
             float PrevSize, CurrentSize;
-            if (item.Index == (colView.InternalItemSource.Count - 1))
+            if (item.Index == (Source.Count - 1))
             {
                 PrevSize = ScrollContentSize - ItemPosition[item.Index];
             }
@@ -547,7 +561,7 @@ namespace Tizen.NUI.Components
 
             if (CurrentSize != PrevSize)
             {
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                     ItemSize[item.Index] = CurrentSize;
                 else
                     StepCandidate = CurrentSize;
@@ -564,11 +578,11 @@ namespace Tizen.NUI.Components
         {
             // Insert Single item.
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             if (isSourceEmpty || StepCandidate == 0)
             {
-                Initialize(colView);
+                Initialize(collectionView);
             }
 
             // Will be null if not a group.
@@ -584,7 +598,7 @@ namespace Tizen.NUI.Components
 
             // 1. Handle MeasureAll
             /*
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
             {
                 //Need To Implement
             }
@@ -641,7 +655,7 @@ namespace Tizen.NUI.Components
                     }
                     else
                     {
-                        if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                        if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                         {
                             float curPos = groupInfo.ItemPosition[startIndex - groupInfo.StartIndex];
                             groupInfo.ItemPosition.Insert(startIndex - groupInfo.StartIndex, curPos);
@@ -670,7 +684,7 @@ namespace Tizen.NUI.Components
             }
             else
             {
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 {
                     // Need to Implements
                 }
@@ -680,8 +694,8 @@ namespace Tizen.NUI.Components
             // 3. Update Scroll Content Size
             ScrollContentSize += currentSize;
 
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 4. Update Visible Items.
             foreach (RecyclerViewItem item in VisibleItems)
@@ -702,8 +716,8 @@ namespace Tizen.NUI.Components
                 LastVisible++;
             }
 
-            if (FirstVisible > colView.InternalItemSource.Count - 1) FirstVisible = colView.InternalItemSource.Count -1;
-            if (LastVisible > colView.InternalItemSource.Count - 1) LastVisible = colView.InternalItemSource.Count -1;
+            if (FirstVisible > Source.Count - 1) FirstVisible = Source.Count -1;
+            if (LastVisible > Source.Count - 1) LastVisible = Source.Count -1;
 
             float scrollPosition = PrevScrollPosition;
 
@@ -715,7 +729,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -732,11 +746,11 @@ namespace Tizen.NUI.Components
         {
              // Insert Group
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             if (isSourceEmpty || StepCandidate == 0)
             {
-                Initialize(colView);
+                Initialize(collectionView);
             }
 
             float currentSize = StepCandidate;
@@ -752,7 +766,7 @@ namespace Tizen.NUI.Components
 
             // 1. Handle MeasureAll
             /*
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
             {
                 //Need To Implement
             }
@@ -801,7 +815,7 @@ namespace Tizen.NUI.Components
                         }
                         else
                         {
-                            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                             {
                                //Need To Implement
                                /*
@@ -859,8 +873,8 @@ namespace Tizen.NUI.Components
             }
 
             // 3. Update Scroll Content Size
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 4. Update Visible Items.
             foreach (RecyclerViewItem item in VisibleItems)
@@ -881,8 +895,8 @@ namespace Tizen.NUI.Components
                 LastVisible = LastVisible + count;
             }
 
-            if (FirstVisible > colView.InternalItemSource.Count - 1) FirstVisible = colView.InternalItemSource.Count -1;
-            if (LastVisible > colView.InternalItemSource.Count - 1) LastVisible = colView.InternalItemSource.Count -1;
+            if (FirstVisible > Source.Count - 1) FirstVisible = Source.Count -1;
+            if (LastVisible > Source.Count - 1) LastVisible = Source.Count -1;
 
             // Position Adjust
             float scrollPosition = PrevScrollPosition;
@@ -893,7 +907,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -910,7 +924,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Single
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -925,7 +939,7 @@ namespace Tizen.NUI.Components
 
             // 1. Handle MeasureAll
             /*
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
             {
                 //Need To Implement
             }
@@ -967,7 +981,7 @@ namespace Tizen.NUI.Components
                 {
                     groupInfo.Count--;
 
-                    if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                    if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                     {
                         //Need to Implement this.
                     }
@@ -985,7 +999,7 @@ namespace Tizen.NUI.Components
             }
             else
             {
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 {
                     // Need to Implements
                 }
@@ -995,8 +1009,8 @@ namespace Tizen.NUI.Components
             ScrollContentSize -= currentSize;
 
             // 3. Update Scroll Content Size
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 4. Update Visible Items.
             RecyclerViewItem targetItem = null;
@@ -1005,7 +1019,7 @@ namespace Tizen.NUI.Components
                 if (item.Index == startIndex)
                 {
                     targetItem = item;
-                    colView.UnrealizeItem(item);
+                    collectionView.UnrealizeItem(item);
                 }
                 else if (item.Index > startIndex)
                 {
@@ -1037,7 +1051,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -1054,7 +1068,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Group
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1069,7 +1083,7 @@ namespace Tizen.NUI.Components
 
             // 1. Handle MeasureAll
             /*
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
             {
                 //Need To Implement
             }
@@ -1093,7 +1107,7 @@ namespace Tizen.NUI.Components
                 // Check item is group parent or not
                 // if group parent, add new gorupinfo
                 currentSize = groupInfo.GroupSize;
-                if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+                if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 {
                     // Update ItemSize and ItemPosition
                 }
@@ -1116,8 +1130,8 @@ namespace Tizen.NUI.Components
             ScrollContentSize -= currentSize;
 
             // 3. Update Scroll Content Size
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // 4. Update Visible Items.
             List<RecyclerViewItem> unrealizedItems = new List<RecyclerViewItem>();
@@ -1127,7 +1141,7 @@ namespace Tizen.NUI.Components
                     && (item.Index < startIndex + count))
                 {
                     unrealizedItems.Add(item);
-                    colView.UnrealizeItem(item);
+                    collectionView.UnrealizeItem(item);
                 }
                 else if (item.Index >= startIndex + count)
                 {
@@ -1159,7 +1173,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -1176,7 +1190,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Single
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1191,7 +1205,7 @@ namespace Tizen.NUI.Components
 
             // 1. Handle MeasureAll
             /*
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
             {
                 //Need To Implement
             }
@@ -1258,12 +1272,12 @@ namespace Tizen.NUI.Components
 
             if (FirstVisible < 0) FirstVisible = 0;
             if (LastVisible < 0) LastVisible = 0;
-            if (FirstVisible > colView.InternalItemSource.Count - 1) FirstVisible = colView.InternalItemSource.Count -1;
-            if (LastVisible > colView.InternalItemSource.Count - 1) LastVisible = colView.InternalItemSource.Count -1;
+            if (FirstVisible > Source.Count - 1) FirstVisible = Source.Count -1;
+            if (LastVisible > Source.Count - 1) LastVisible = Source.Count -1;
 
 
-            if (IsHorizontal) colView.ContentContainer.SizeWidth = ScrollContentSize;
-            else colView.ContentContainer.SizeHeight = ScrollContentSize;
+            if (IsHorizontal) collectionView.ContentContainer.SizeWidth = ScrollContentSize;
+            else collectionView.ContentContainer.SizeHeight = ScrollContentSize;
 
             // Position Adjust
             float scrollPosition = PrevScrollPosition;
@@ -1275,7 +1289,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -1292,7 +1306,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Groups
             if (source == null) throw new ArgumentNullException(nameof(source));
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1381,7 +1395,7 @@ namespace Tizen.NUI.Components
             // FIXME!! Unraelize All and reset First/Last Visible
             foreach (RecyclerViewItem item in VisibleItems)
             {
-                colView.UnrealizeItem(item);
+                collectionView.UnrealizeItem(item);
             }
             VisibleItems.Clear();
             FirstVisible = 0;
@@ -1397,7 +1411,7 @@ namespace Tizen.NUI.Components
                 scrollPosition = GetItemPosition(topInScreenIndex);
                 scrollPosition -= offset;
 
-                colView.ScrollTo(scrollPosition);
+                collectionView.ScrollTo(scrollPosition);
             }
             */
 
@@ -1416,7 +1430,7 @@ namespace Tizen.NUI.Components
             if (source == null) throw new ArgumentNullException(nameof(source));
             IGroupableItemSource gSource = source as IGroupableItemSource;
             if (gSource == null)throw new Exception("Source is not group!");
-            if (colView == null) return;
+            if (collectionView == null) return;
 
             // Get the first Visible Position to adjust.
             /*
@@ -1489,7 +1503,7 @@ namespace Tizen.NUI.Components
             if (targetSibling > -1 && targetSibling < Container.Children.Count)
             {
                 RecyclerViewItem candidate = Container.Children[targetSibling] as RecyclerViewItem;
-                if (candidate != null && candidate.Index >= 0 && candidate.Index < colView.InternalItemSource.Count)
+                if (candidate != null && candidate.Index >= 0 && candidate.Index < Source.Count)
                 {
                     nextFocusedView = candidate;
                 }
@@ -1502,7 +1516,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override (int start, int end) FindVisibleItems((float X, float Y) visibleArea)
         {
-            int MaxIndex = colView.InternalItemSource.Count - 1 - (hasFooter? 1 : 0);
+            int MaxIndex = Source.Count - 1 - (hasFooter? 1 : 0);
             int adds = 5;
             int skipGroup = -2;
             (int start, int end) found = (0, 0);
@@ -1614,16 +1628,17 @@ namespace Tizen.NUI.Components
             return found;
         }
 
-        // Item position excluding margins.
-        internal override (float X, float Y) GetItemPosition(int index)
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal override (float X, float Y) GetItemPosition(int index)
         {
             int spaceStartX = Padding.Start;
             int spaceStartY = Padding.Top;
-            if (colView.InternalItemSource.IsHeader(index))
+            if (Source.IsHeader(index))
             {
                 return (spaceStartX + headerMargin.Start, spaceStartY + headerMargin.Top);
             }
-            else if (colView.InternalItemSource.IsFooter(index))
+            else if (Source.IsFooter(index))
             {
                 return ((IsHorizontal? ScrollContentSize - footerSize - Padding.End + footerMargin.Start : spaceStartX + footerMargin.Start),
                         (IsHorizontal? spaceStartY + footerMargin.Top : ScrollContentSize - footerSize - Padding.Bottom + footerMargin.Top));
@@ -1639,11 +1654,11 @@ namespace Tizen.NUI.Components
                 float current = GetGroupPosition(gInfo, index);
                 Extents itemMargin = CandidateMargin;
 
-                if (colView.InternalItemSource.IsGroupHeader(index))
+                if (Source.IsGroupHeader(index))
                 {
                     itemMargin = groupHeaderMargin;
                 }
-                else if (colView.InternalItemSource.IsGroupFooter(index))
+                else if (Source.IsGroupFooter(index))
                 {
                     itemMargin = groupFooterMargin;
                 }
@@ -1654,7 +1669,7 @@ namespace Tizen.NUI.Components
                         spaceStartY + itemMargin.Top:
                         itemMargin.Top + GetGroupPosition(gInfo, index)));
             }
-            else if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            else if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
             {
                 //FIXME : CandidateMargin need to be actual itemMargin
                 return ((IsHorizontal? ItemPosition[index] + CandidateMargin.Start : spaceStartX + CandidateMargin.Start),
@@ -1670,42 +1685,43 @@ namespace Tizen.NUI.Components
             }
         }
 
-        // Item size excluding margins. this size is approximated size.
-        internal override (float Width, float Height) GetItemSize(int index)
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal override (float Width, float Height) GetItemSize(int index)
         {
-            if (colView.InternalItemSource.IsHeader(index))
+            if (Source.IsHeader(index))
             {
-                return ((IsHorizontal? (int)headerSize : (int)(colView.Size.Width) - Padding.Start - Padding.End)
+                return ((IsHorizontal? (int)headerSize : (int)(collectionView.Size.Width) - Padding.Start - Padding.End)
                         - headerMargin.Start - headerMargin.End,
-                        (IsHorizontal? (int)colView.Size.Height - Padding.Top - Padding.Bottom: (int)headerSize)
+                        (IsHorizontal? (int)collectionView.Size.Height - Padding.Top - Padding.Bottom: (int)headerSize)
                         - headerMargin.Top - headerMargin.Bottom);
             }
-            else if (colView.InternalItemSource.IsFooter(index))
+            else if (Source.IsFooter(index))
             {
-                return ((IsHorizontal? (int)footerSize : (int)(colView.Size.Width) - Padding.Start - Padding.End)
+                return ((IsHorizontal? (int)footerSize : (int)(collectionView.Size.Width) - Padding.Start - Padding.End)
                         - footerMargin.Start - footerMargin.End,
-                        (IsHorizontal? (int)colView.Size.Height - Padding.Top - Padding.Bottom: (int)footerSize)
+                        (IsHorizontal? (int)collectionView.Size.Height - Padding.Top - Padding.Bottom: (int)footerSize)
                         - footerMargin.Top - footerMargin.Bottom);
             }
-            else if (colView.InternalItemSource.IsGroupHeader(index))
+            else if (Source.IsGroupHeader(index))
             {
-                return ((IsHorizontal? (int)groupHeaderSize : (int)(colView.Size.Width) - Padding.Start - Padding.End)
+                return ((IsHorizontal? (int)groupHeaderSize : (int)(collectionView.Size.Width) - Padding.Start - Padding.End)
                         - groupHeaderMargin.Start - groupHeaderMargin.End,
-                        (IsHorizontal? (int)colView.Size.Height - Padding.Top - Padding.Bottom: (int)groupHeaderSize)
+                        (IsHorizontal? (int)collectionView.Size.Height - Padding.Top - Padding.Bottom: (int)groupHeaderSize)
                         - groupHeaderMargin.Top - groupHeaderMargin.Bottom);
             }
-            else if (colView.InternalItemSource.IsGroupFooter(index))
+            else if (Source.IsGroupFooter(index))
             {
-                return ((IsHorizontal? (int)groupFooterSize : (int)(colView.Size.Width) - Padding.Start - Padding.End)
+                return ((IsHorizontal? (int)groupFooterSize : (int)(collectionView.Size.Width) - Padding.Start - Padding.End)
                         - groupFooterMargin.Start - groupFooterMargin.End,
-                        (IsHorizontal? (int)colView.Size.Height - Padding.Top - Padding.Bottom: (int)groupFooterSize)
+                        (IsHorizontal? (int)collectionView.Size.Height - Padding.Top - Padding.Bottom: (int)groupFooterSize)
                         - groupFooterMargin.Top - groupFooterMargin.Bottom);
             }
             else
             {
-                return ((IsHorizontal? (int)StepCandidate : (int)(colView.Size.Width) - Padding.Start - Padding.End)
+                return ((IsHorizontal? (int)StepCandidate : (int)(collectionView.Size.Width) - Padding.Start - Padding.End)
                         - CandidateMargin.Start - CandidateMargin.End,
-                        (IsHorizontal? (int)colView.Size.Height - Padding.Top - Padding.Bottom: (int)StepCandidate)
+                        (IsHorizontal? (int)collectionView.Size.Height - Padding.Top - Padding.Bottom: (int)StepCandidate)
                         - CandidateMargin.Top - CandidateMargin.Bottom);
             }
         }
@@ -1751,19 +1767,19 @@ namespace Tizen.NUI.Components
 
         private float GetItemStepSize(int index)
         {
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
             {
                 return ItemSize[index];
             }
             else
             {
-                if (colView.InternalItemSource.IsHeader(index))
+                if (Source.IsHeader(index))
                     return headerSize;
-                else if (colView.InternalItemSource.IsFooter(index))
+                else if (Source.IsFooter(index))
                     return footerSize;
-                else if (colView.InternalItemSource.IsGroupHeader(index))
+                else if (Source.IsGroupHeader(index))
                     return groupHeaderSize;
-                else if (colView.InternalItemSource.IsGroupFooter(index))
+                else if (Source.IsGroupFooter(index))
                     return groupFooterSize;
                 else
                     return StepCandidate;
@@ -1772,30 +1788,21 @@ namespace Tizen.NUI.Components
 
         private void UpdatePosition(int index)
         {
-            bool IsGroup = (colView.InternalItemSource is IGroupableItemSource);
+            bool IsGroup = (Source is IGroupableItemSource);
 
             if (index <= 0) return;
-            if (index >= colView.InternalItemSource.Count)
+            if (index >= Source.Count)
 
                 if (IsGroup)
                 {
-                    //IsGroupHeader = (colView.InternalItemSource as IGroupableItemSource).IsGroupHeader(index);
-                    //IsGroupFooter = (colView.InternalItemSource as IGroupableItemSource).IsGroupFooter(index);
+                    //IsGroupHeader = (Source as IGroupableItemSource).IsGroupHeader(index);
+                    //IsGroupFooter = (Source as IGroupableItemSource).IsGroupFooter(index);
                     //Do Something
                 }
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 ItemPosition[index] = ItemPosition[index - 1] + GetItemStepSize(index - 1);
         }
 
-        private RecyclerViewItem GetVisibleItem(int index)
-        {
-            foreach (RecyclerViewItem item in VisibleItems)
-            {
-                if (item.Index == index) return item;
-            }
-            return null;
-        }
-
         private GroupInfo GetGroupInfo(int index)
         {
             if (Visited != null)
@@ -1818,7 +1825,7 @@ namespace Tizen.NUI.Components
 
         private float GetGroupPosition(GroupInfo groupInfo, int index)
         {
-            if (colView.SizingStrategy == ItemSizingStrategy.MeasureAll)
+            if (collectionView.SizingStrategy == ItemSizingStrategy.MeasureAll)
                 return groupInfo.GroupPosition + groupInfo.ItemPosition[index - groupInfo.StartIndex];
             else
             {
@@ -1851,15 +1858,5 @@ namespace Tizen.NUI.Components
                     return null;
                 }
         */
-        class GroupInfo
-        {
-            public object GroupParent;
-            public int StartIndex;
-            public int Count;
-            public float GroupSize;
-            public float GroupPosition;
-            //Items relative position from the GroupPosition. Only use for MeasureAll.
-            public List<float> ItemPosition = new List<float>();
-        }
     }
 }
index 8666960..e248ece 100755 (executable)
@@ -142,7 +142,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Internal encapsulated items data source.
         /// </summary>
-        internal IItemSource InternalItemSource { get; set; }
+        internal IItemSource InternalSource { get; set; }
 
         /// <summary>
         /// RecycleCache of ViewItem.
@@ -320,9 +320,10 @@ namespace Tizen.NUI.Components
         /// Realize indexed item.
         /// </summary>
         /// <param name="index"> Index position of realizing item </param>
-        internal virtual RecyclerViewItem RealizeItem(int index)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal virtual RecyclerViewItem RealizeItem(int index)
         {
-            object context = InternalItemSource.GetItem(index);
+            object context = InternalSource.GetItem(index);
             // Check DataTemplate is Same!
             if (ItemTemplate is DataTemplateSelector)
             {
@@ -359,7 +360,8 @@ namespace Tizen.NUI.Components
         /// </summary>
         /// <param name="item"> Target item for unrealizing </param>
         /// <param name="recycle"> Allow recycle. default is true </param>
-        internal virtual void UnrealizeItem(RecyclerViewItem item, bool recycle = true)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected internal virtual void UnrealizeItem(RecyclerViewItem item, bool recycle = true)
         {
             if (item == null)
             {
@@ -494,10 +496,10 @@ namespace Tizen.NUI.Components
                 InternalItemsLayouter = null;
                 ItemsSource = null;
                 ItemTemplate = null;
-                if (InternalItemSource != null)
+                if (InternalSource != null)
                 {
-                    InternalItemSource.Dispose();
-                    InternalItemSource = null;
+                    InternalSource.Dispose();
+                    InternalSource = null;
                 }
                 //
             }
@@ -516,7 +518,7 @@ namespace Tizen.NUI.Components
         {
             item.Index = index;
             item.ParentItemsView = this;
-            item.Template = (ItemTemplate as DataTemplateSelector)?.SelectDataTemplate(InternalItemSource.GetItem(index), this) ?? ItemTemplate;
+            item.Template = (ItemTemplate as DataTemplateSelector)?.SelectDataTemplate(InternalSource.GetItem(index), this) ?? ItemTemplate;
             item.BindingContext = context;
             item.Relayout += OnItemRelayout;
         }