summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungHyun Min <shyun.min@samsung.com>2017-05-10 16:17:13 +0900
committerSeungkeun Lee <sngn.lee@samsung.com>2017-05-12 06:24:43 +0000
commitf5acf4941730676bb16c2e6fc97d0d28bded6445 (patch)
treee54af45fb3f1d0c2194955ed6debeb2718473ac1
parent4b706be64a518a1977ab1503f7b44644cdc770cc (diff)
downloadxamarin-forms-f5acf4941730676bb16c2e6fc97d0d28bded6445.tar.gz
xamarin-forms-f5acf4941730676bb16c2e6fc97d0d28bded6445.tar.bz2
xamarin-forms-f5acf4941730676bb16c2e6fc97d0d28bded6445.zip
Fix gesture issue in BoxView
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>
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs18
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs2
2 files changed, 9 insertions, 11 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
index b0651340..6d3ed38e 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
@@ -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
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs
index bf1891bf..f104ba42 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs
@@ -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;