[NUI] Add more condition when item is last.
authoreverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Fri, 25 Nov 2022 06:56:47 +0000 (22:56 -0800)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Wed, 29 Mar 2023 05:40:29 +0000 (14:40 +0900)
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs

index 8dca378..721e667 100755 (executable)
@@ -210,7 +210,8 @@ namespace Tizen.NUI.Components
 
             bool failed = false;
             //Final Check of FirstIndex
-            if (colView.InternalItemSource.Count - 1 < firstIndex)
+            if ((colView.InternalItemSource.Count - 1 < firstIndex) ||
+                (colView.InternalItemSource.IsFooter(firstIndex) && (colView.InternalItemSource.Count - 1) == firstIndex))
             {
                 StepCandidate = 0F;
                 failed = true;
@@ -517,7 +518,7 @@ namespace Tizen.NUI.Components
             // Insert Single item.
             if (source == null) throw new ArgumentNullException(nameof(source));
             if (colView == null) return;
-            if (isSourceEmpty || StepCandidate == 0)
+            if (isSourceEmpty || StepCandidate <= 1)
             {
                 Initialize(colView);
             }
@@ -669,7 +670,7 @@ namespace Tizen.NUI.Components
              // Insert Group
             if (source == null) throw new ArgumentNullException(nameof(source));
             if (colView == null) return;
-            if (isSourceEmpty || StepCandidate == 0)
+            if (isSourceEmpty || StepCandidate <= 1)
             {
                 Initialize(colView);
             }
index 612602b..4a9e376 100755 (executable)
@@ -204,8 +204,8 @@ namespace Tizen.NUI.Components
             bool failed = false;
 
             //Final Check of FirstIndex
-
-            if (colView.InternalItemSource.Count - 1 < firstIndex)
+            if ((colView.InternalItemSource.Count - 1 < firstIndex) ||
+                (colView.InternalItemSource.IsFooter(firstIndex) && (colView.InternalItemSource.Count - 1) == firstIndex))
             {
                 StepCandidate = 0F;
                 failed = true;