[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 3c6cd78372f10af604ea73fb73e3e72df3f7d9ba..e1ba9954db320be497d70ab57b9963ff1cdb56bd 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>
@@ -99,6 +103,12 @@ namespace ElmSharp
         /// <since_tizen> preview </since_tizen>
         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>
index c297bf48af88fa2c511dc649ee337ca73bdb6207..956f7c69c413335c7f5919fbbc3c1c157638de82 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 d40825a830bc3a984646be4849bf14b79201933b..3d9985b3273ecd5cc14a57c7c015d43d4273dbb5 100644 (file)
@@ -100,6 +100,10 @@ namespace ElmSharp.Test
             {
                 Console.WriteLine("Panel Toggled!");
             };
+            panel.Scrolled += (s, e) =>
+            {
+                Console.WriteLine("Panel Scrolled! : IsOpen = " + panel.IsOpen);
+            };
         }
 
     }