[ElmSharp] Added new Scrolled event in Panel (#767)
authorarosis78 <jh0506.yun@samsung.com>
Fri, 29 Mar 2019 02:11:54 +0000 (11:11 +0900)
committerGitHub <noreply@github.com>
Fri, 29 Mar 2019 02:11:54 +0000 (11:11 +0900)
src/ElmSharp/ElmSharp/Panel.cs
test/ElmSharp.Test/TC/AnimationViewTest1.cs
test/ElmSharp.Test/TC/PanelTest2.cs

index 3c6cd78..e1ba995 100644 (file)
@@ -49,6 +49,7 @@ namespace ElmSharp
     public class Panel : Layout
     {
         SmartEvent _toggled;
+        SmartEvent _scrolled;
 
         /// <summary>
         /// Creates and initializes a new instance of the Panel class.
@@ -58,7 +59,10 @@ namespace ElmSharp
         public Panel(EvasObject parent) : base(parent)
         {
             _toggled = new SmartEvent(this, this.RealHandle, "toggled");
+            _scrolled = new SmartEvent(this, this.RealHandle, "scroll");
+
             _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty);
+            _scrolled.On += (s, e) => Scrolled?.Invoke(this, EventArgs.Empty);
         }
 
         /// <summary>
@@ -100,6 +104,12 @@ namespace ElmSharp
         public event EventHandler Toggled;
 
         /// <summary>
+        /// Scrolled will be triggered when the panel has been scrolled. This event is emitted only when the panel is scrollable
+        /// </summary>
+        /// <since_tizen> preview </since_tizen>
+        public event EventHandler Scrolled;
+
+        /// <summary>
         /// Enable or disable scrolling in the panel.
         /// </summary>
         /// <param name="enable">
index c297bf4..956f7c6 100644 (file)
@@ -37,7 +37,7 @@ namespace ElmSharp.Test
             {
                 _stateLabel.Text = "<font_size=32>State = Playing</font_size>";
             }
-            else if (_state == AnimationViewState.ReversePlay)
+            else if (_state == AnimationViewState.ReversedPlay)
             {
                 _stateLabel.Text = "<font_size=32>State = Reverse Playing</font_size>";
             }
index d40825a..3d9985b 100644 (file)
@@ -100,6 +100,10 @@ namespace ElmSharp.Test
             {
                 Console.WriteLine("Panel Toggled!");
             };
+            panel.Scrolled += (s, e) =>
+            {
+                Console.WriteLine("Panel Scrolled! : IsOpen = " + panel.IsOpen);
+            };
         }
 
     }