From b19708d7b00c9980dc45a584dcdc63aceabe6599 Mon Sep 17 00:00:00 2001 From: "everLEEst(SangHyeon Lee)" Date: Thu, 24 Nov 2022 22:56:47 -0800 Subject: [PATCH] [NUI] Add more condition when item is last. --- .../Controls/RecyclerView/Layouter/GridLayouter.cs | 7 ++++--- .../Controls/RecyclerView/Layouter/LinearLayouter.cs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs index 8dca378..721e667 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs @@ -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); } diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs index 612602b..4a9e376 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs @@ -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; -- 2.7.4