From: neostom432 <31119276+neostom432@users.noreply.github.com> Date: Thu, 27 Aug 2020 08:14:40 +0000 (+0900) Subject: [NUI] change amount of Notificaion step (#1930) X-Git-Tag: accepted/tizen/unified/20210219.040944~458 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b37f25432ed45e03ef16be710b20c850aa86931;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] change amount of Notificaion step (#1930) Change default notification step value and add new property to modify it. Co-authored-by: neostom432 Co-authored-by: dongsug-song <35130733+dongsug-song@users.noreply.github.com> --- diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index 1f40c90..0c072d5 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -66,6 +66,7 @@ namespace Tizen.NUI.Components private int mScrollDuration = 125; private int mPageWidth = 0; private float mPageFlickThreshold = 0.4f; + private float mScrollingEventThreshold = 0.00001f; private class ScrollableBaseCustomLayout : LayoutGroup { @@ -442,6 +443,29 @@ namespace Tizen.NUI.Components public float DecelerationThreshold { get; set; } = 0.1f; /// + /// Scrolling event will be thrown when this amount of scroll positino is changed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float ScrollingEventThreshold + { + get + { + return mScrollingEventThreshold; + } + set + { + if (mScrollingEventThreshold != value && value > 0) + { + ContentContainer.RemovePropertyNotification(propertyNotification); + propertyNotification = ContentContainer.AddPropertyNotification("position", PropertyCondition.Step(value)); + propertyNotification.Notified += OnPropertyChanged; + mScrollingEventThreshold = value; + } + } + } + + + /// /// Page will be changed when velocity of panning is over threshold. /// The unit of threshold is pixel per milisec. /// @@ -523,7 +547,7 @@ namespace Tizen.NUI.Components Layout = new AbsoluteLayout() { SetPositionByLayout = false }, }; ContentContainer.Relayout += OnScrollingChildRelayout; - propertyNotification = ContentContainer.AddPropertyNotification("position", PropertyCondition.Step(1.0f)); + propertyNotification = ContentContainer.AddPropertyNotification("position", PropertyCondition.Step(mScrollingEventThreshold)); propertyNotification.Notified += OnPropertyChanged; base.Add(ContentContainer); @@ -839,6 +863,8 @@ namespace Tizen.NUI.Components mPanGestureDetector.Dispose(); mPanGestureDetector = null; } + + propertyNotification.Dispose(); } base.Dispose(type); }