From 9fac1fc0aed8afdd8919e8fd9f393bc91a82ff8f Mon Sep 17 00:00:00 2001 From: zhouleonlei Date: Mon, 23 Nov 2020 20:01:53 +0800 Subject: [PATCH] [NUI] Fix Svace issues for Components --- src/Tizen.NUI.Components/Controls/Pagination.cs | 4 ++-- src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs | 2 +- src/Tizen.NUI.Components/Controls/ScrollableBase.cs | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/Pagination.cs b/src/Tizen.NUI.Components/Controls/Pagination.cs index 9638605..51da81b 100755 --- a/src/Tizen.NUI.Components/Controls/Pagination.cs +++ b/src/Tizen.NUI.Components/Controls/Pagination.cs @@ -473,7 +473,7 @@ namespace Tizen.NUI.Components } ImageVisual indicator = new ImageVisual { - URL = paginationStyle.IndicatorImageUrl.Normal, + URL = paginationStyle.IndicatorImageUrl?.Normal, Size = new Size2D((int)paginationStyle.IndicatorSize.Width, (int)paginationStyle.IndicatorSize.Height), //TODO: Apply color properties from PaginationStyle class. MixColor = (indicatorColor == null) ? new Color(1.0f, 1.0f, 1.0f, 0.5f) : indicatorColor, @@ -511,7 +511,7 @@ namespace Tizen.NUI.Components for (int i = 0; i < indicatorList.Count; i++) { ImageVisual indicator = indicatorList[i]; - indicator.URL = paginationStyle.IndicatorImageUrl.Normal; + indicator.URL = paginationStyle.IndicatorImageUrl?.Normal; indicator.Size = new Size2D((int)paginationStyle.IndicatorSize.Width, (int)paginationStyle.IndicatorSize.Height); indicator.Position = new Position2D((int)(paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * i, 0); } diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs index 2f3daab..6f54fb1 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs @@ -278,7 +278,7 @@ namespace Tizen.NUI.Components } } - if (nextFocusedView) + if (nextFocusedView != null) { // Check next focused view is inside of visible area. // If it is not, move scroll position to make it visible. diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index f2d8869..f652788 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -180,8 +180,11 @@ namespace Tizen.NUI.Components ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState)); // Size of ScrollableBase is changed. Change Page width too. - scrollableBase.mPageWidth = (int)MeasuredWidth.Size.AsRoundedValue(); - scrollableBase.OnScrollingChildRelayout(null, null); + if (scrollableBase != null) + { + scrollableBase.mPageWidth = (int)MeasuredWidth.Size.AsRoundedValue(); + scrollableBase.OnScrollingChildRelayout(null, null); + } } protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom) -- 2.7.4