Skip to content

Commit

Permalink
Update Renderer to use disable rotary event on IBezelInteractionRoutor (
Browse files Browse the repository at this point in the history
  • Loading branch information
myroot authored and rookiejava committed May 17, 2020
1 parent 81588b9 commit 88b9bfa
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ protected override ElmSharp.Size Measure(int availableWidth, int availableHeight
return new ElmSharp.Size(300, 290);
}

protected override void UpdateRotaryInteraction(bool enable)
{
if (Element.FindBezelRouter() == null)
{
base.UpdateRotaryInteraction(enable);
}
}

void UpdateMinimum()
{
Control.MinimumDateTime = Element.MinimumDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
using Xamarin.Forms;
using Xamarin.Forms.Platform.Tizen;
using Xamarin.Forms.Platform.Tizen.Native.Watch;
using ElmSharp.Wearable;
using ESize = ElmSharp.Size;
using XForms = Xamarin.Forms.Forms;

[assembly: ExportRenderer(typeof(Tizen.Wearable.CircularUI.Forms.CircleStepper), typeof(Tizen.Wearable.CircularUI.Forms.Renderer.CircleStepperRenderer))]


namespace Tizen.Wearable.CircularUI.Forms.Renderer
{
public class CircleStepperRenderer : StepperRenderer
Expand All @@ -43,6 +42,11 @@ public CircleStepperRenderer()

protected new CircleStepper Element => base.Element as CircleStepper;

protected override ElmSharp.Spinner CreateNativeControl()
{
return new WatchSpinner(XForms.NativeParent, this.GetSurface());
}

protected override void OnElementChanged(ElementChangedEventArgs<Stepper> e)
{
base.OnElementChanged(e);
Expand Down
34 changes: 34 additions & 0 deletions src/Tizen.Wearable.CircularUI.Forms.Renderer/StepperRenderer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using Xamarin.Forms;
using XStepperRenderer = Xamarin.Forms.Platform.Tizen.StepperRenderer;
using CStepperRenderer = Tizen.Wearable.CircularUI.Forms.Renderer.StepperRenderer;

[assembly: ExportRenderer(typeof(ListView), typeof(CStepperRenderer))]
namespace Tizen.Wearable.CircularUI.Forms.Renderer
{
public class StepperRenderer : XStepperRenderer
{
protected override void UpdateRotaryInteraction(bool enable)
{
if (Element.FindBezelRouter() == null)
{
base.UpdateRotaryInteraction(enable);
}
}
}
}

0 comments on commit 88b9bfa

Please sign in to comment.