From 9638a6b40214f40450c0ec5fd03b5380508f11a2 Mon Sep 17 00:00:00 2001 From: zhouleonlei Date: Wed, 9 Dec 2020 11:09:10 +0800 Subject: [PATCH] [NUI] Fixed svace issue for API8 --- src/Tizen.NUI/src/internal/PropertyRangeManager.cs | 15 +++++++++------ src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/Tizen.NUI/src/internal/PropertyRangeManager.cs b/src/Tizen.NUI/src/internal/PropertyRangeManager.cs index 894727d..a0168b4 100755 --- a/src/Tizen.NUI/src/internal/PropertyRangeManager.cs +++ b/src/Tizen.NUI/src/internal/PropertyRangeManager.cs @@ -92,13 +92,16 @@ namespace Tizen.NUI // we add 1000, just incase View class starts using animatable properties int startAnimatablePropertyIndex = (int)Tizen.NUI.PropertyRanges.ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + maxCountPerDerivation; - while (viewType.GetTypeInfo().BaseType?.Name != "CustomView") // custom view is our C# view base class. we don't go any deeper. + if (viewType != null) { - // for every base class increase property start index - startEventPropertyIndex += (int)Tizen.NUI.PropertyRanges.DEFAULT_PROPERTY_MAX_COUNT_PER_DERIVATION; // DALi uses 10,000 - startAnimatablePropertyIndex += maxCountPerDerivation; - NUILog.Debug("getStartPropertyIndex = " + viewType.Name + "current index " + startEventPropertyIndex); - viewType = viewType.GetTypeInfo().BaseType; + while (viewType.GetTypeInfo().BaseType?.Name != "CustomView") // custom view is our C# view base class. we don't go any deeper. + { + // for every base class increase property start index + startEventPropertyIndex += (int)Tizen.NUI.PropertyRanges.DEFAULT_PROPERTY_MAX_COUNT_PER_DERIVATION; // DALi uses 10,000 + startAnimatablePropertyIndex += maxCountPerDerivation; + NUILog.Debug("getStartPropertyIndex = " + viewType.Name + "current index " + startEventPropertyIndex); + viewType = viewType.GetTypeInfo().BaseType; + } } range.startEventIndex = startEventPropertyIndex; diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs index 974197f..f156cb4 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs @@ -133,18 +133,20 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public void ChangeLayoutSiblingOrder(int order) { - var ownerParent = Owner.GetParent() as View; - if (Owner != null && ownerParent != null) + if (Owner != null) { - var parent = ownerParent.Layout as LayoutGroup; - - if(parent != null && parent.LayoutChildren.Count>order) + var ownerParent = Owner.GetParent() as View; + if (ownerParent != null) { - parent.LayoutChildren.Remove(this); - parent.LayoutChildren.Insert(order,this); + var parent = ownerParent.Layout as LayoutGroup; + + if (parent != null && parent.LayoutChildren.Count > order) + { + parent.LayoutChildren.Remove(this); + parent.LayoutChildren.Insert(order, this); + } } } - RequestLayout(); } -- 2.7.4