Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Fix Renderer error related with Bezel and CircleSurface #305

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,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))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What

namespace Tizen.Wearable.CircularUI.Forms.Renderer
{
public class StepperRenderer : XStepperRenderer
{
protected override void UpdateRotaryInteraction(bool enable)
{
if (Element.FindBezelRouter() == null)
{
base.UpdateRotaryInteraction(enable);
}
}
}
}