[NUI] Add ScrollPosition and ScrollCurrentPosition to ScrollableBase (#1845)
authorjaehyun0cho <jaehyun0cho@gmail.com>
Thu, 6 Aug 2020 06:01:50 +0000 (15:01 +0900)
committerGitHub <noreply@github.com>
Thu, 6 Aug 2020 06:01:50 +0000 (15:01 +0900)
To get the scroll position given to ScrollTo, ScrollPosition is added.
ScrollPosition is the position in the opposite direction to the position
of ContentContainer.

To get the current scroll position, ScrollCurrentPosition is added.
ScrollCurrentPosition is the position in the opposite direction to the
current position of ContentContainer.

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
src/Tizen.NUI.Components/Controls/ScrollableBase.cs

index 3d623b3..bb43385 100755 (executable)
@@ -1081,6 +1081,31 @@ namespace Tizen.NUI.Components
             return position;
         }
 
+        /// <summary>
+        /// Scroll position given to ScrollTo.
+        /// This is the position in the opposite direction to the position of ContentContainer.
+        /// </summary>
+        /// <since_tizen> 8 </since_tizen>
+        public Position ScrollPosition
+        {
+            get
+            {
+                return new Position(-ContentContainer.Position);
+            }
+        }
+
+        /// <summary>
+        /// Current scroll position in the middle of ScrollTo animation.
+        /// This is the position in the opposite direction to the current position of ContentContainer.
+        /// </summary>
+        /// <since_tizen> 8 </since_tizen>
+        public Position ScrollCurrentPosition
+        {
+            get
+            {
+                return new Position(-ContentContainer.CurrentPosition);
+            }
+        }
     }
 
 } // namespace