Fix gesture issue in BoxView
authorSungHyun Min <shyun.min@samsung.com>
Wed, 10 May 2017 07:17:13 +0000 (16:17 +0900)
committerKangho Hur <kangho.hur@samsung.com>
Mon, 10 Jul 2017 02:11:25 +0000 (11:11 +0900)
 TASK=TCAPI-2365

 - Gestures are handled only on the ViewRenderer.
 - Base class of BoxViewRenderer is changed to inherit ViewRenderer
 - ViewRenderer is changed to allow EvasObject type as a NativeView

Change-Id: I39ff90ea48da7569e4a7c6b2250d6a52a88a0736
Signed-off-by: SungHyun Min <shyun.min@samsung.com>
Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs

index b065134..6d3ed38 100644 (file)
@@ -4,20 +4,18 @@ using ERectangle = ElmSharp.Rectangle;
 
 namespace Xamarin.Forms.Platform.Tizen
 {
-       public class BoxViewRenderer : VisualElementRenderer<BoxView>
+       public class BoxViewRenderer : ViewRenderer<BoxView, ERectangle>
        {
-               ERectangle _control;
-
                public BoxViewRenderer()
                {
                }
 
                protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
                {
-                       if (_control == null)
+                       if (Control == null)
                        {
-                               _control = new ERectangle(Forms.Context.MainWindow);
-                               SetNativeControl(_control);
+                               var rectangle = new ERectangle(Forms.Context.MainWindow);
+                               SetNativeControl(rectangle);
                        }
 
                        if (e.NewElement != null)
@@ -54,19 +52,19 @@ namespace Xamarin.Forms.Platform.Tizen
                                if (Element.BackgroundColor.IsDefault)
                                {
                                        // Set to default color. (Transparent)
-                                       _control.Color = EColor.Transparent;
+                                       Control.Color = EColor.Transparent;
                                }
                                else
                                {
                                        // Use BackgroundColor only if color is default and background color is not default.
-                                       _control.Color = Element.BackgroundColor.MultiplyAlpha(Element.Opacity).ToNative();
+                                       Control.Color = Element.BackgroundColor.MultiplyAlpha(Element.Opacity).ToNative();
                                }
                        }
                        else
                        {
                                // Color has higer priority than BackgroundColor.
-                               _control.Color = Element.Color.MultiplyAlpha(Element.Opacity).ToNative();
+                               Control.Color = Element.Color.MultiplyAlpha(Element.Opacity).ToNative();
                        }
                }
        }
-}
+}
\ No newline at end of file
index bf1891b..f104ba4 100644 (file)
@@ -7,7 +7,7 @@ namespace Xamarin.Forms.Platform.Tizen
        /// </summary>
        public abstract class ViewRenderer<TView, TNativeView> : VisualElementRenderer<TView>
                where TView : View
-               where TNativeView : Widget
+               where TNativeView : EvasObject
        {
                GestureDetector _gestureDetector;