summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>2017-06-12 07:05:52 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 02:11:27 (GMT)
commit5c4716800c109871404b0da4e8e0b90b4c353a7d (patch)
tree53402345131bec49c891c1d7c13946f5a3afbb96
parent372a380207b3b76c5e1a3c0579987db5e6f45218 (diff)
downloadxamarin-forms-5c4716800c109871404b0da4e8e0b90b4c353a7d.zip
xamarin-forms-5c4716800c109871404b0da4e8e0b90b4c353a7d.tar.gz
xamarin-forms-5c4716800c109871404b0da4e8e0b90b4c353a7d.tar.bz2
Make sure single Xamarin property influences only one EFL property
Change-Id: Ib5b2fcab1f7c880cef3b199badc2710f8d05384b Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs18
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/CarouselPageRenderer.cs7
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs17
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs7
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/SliderRenderer.cs11
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/StepperRenderer.cs11
11 files changed, 44 insertions, 51 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
index 6d3ed38..f34bd32 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
@@ -6,10 +6,6 @@ namespace Xamarin.Forms.Platform.Tizen
{
public class BoxViewRenderer : ViewRenderer<BoxView, ERectangle>
{
- public BoxViewRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
{
if (Control == null)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
index f48ef74..c44c629 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
@@ -8,9 +8,9 @@ namespace Xamarin.Forms.Platform.Tizen
public ButtonRenderer()
{
RegisterPropertyHandler(Button.TextProperty, UpdateText);
- RegisterPropertyHandler(Button.FontFamilyProperty, UpdateText);
- RegisterPropertyHandler(Button.FontSizeProperty, UpdateText);
- RegisterPropertyHandler(Button.FontAttributesProperty, UpdateText);
+ RegisterPropertyHandler(Button.FontFamilyProperty, UpdateFontFamily);
+ RegisterPropertyHandler(Button.FontSizeProperty, UpdateFontSize);
+ RegisterPropertyHandler(Button.FontAttributesProperty, UpdateFontAttributes);
RegisterPropertyHandler(Button.TextColorProperty, UpdateTextColor);
RegisterPropertyHandler(Button.ImageProperty, UpdateBitmap);
RegisterPropertyHandler(Button.BorderColorProperty, UpdateBorder);
@@ -58,8 +58,20 @@ namespace Xamarin.Forms.Platform.Tizen
void UpdateText()
{
Control.Text = Element.Text ?? "";
+ }
+
+ void UpdateFontSize()
+ {
Control.FontSize = Element.FontSize;
+ }
+
+ void UpdateFontAttributes()
+ {
Control.FontAttributes = Element.FontAttributes;
+ }
+
+ void UpdateFontFamily()
+ {
Control.FontFamily = Element.FontFamily;
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/CarouselPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/CarouselPageRenderer.cs
index 812b8ab..c89fae0 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/CarouselPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/CarouselPageRenderer.cs
@@ -43,13 +43,6 @@ namespace Xamarin.Forms.Platform.Tizen
protected EvasObject _page;
/// <summary>
- /// The default constructor.
- /// </summary>
- public CarouselPageRenderer()
- {
- }
-
- /// <summary>
/// Invoked whenever the CarouselPage element has been changed in Xamarin.
/// </summary>
/// <param name="e">Event parameters.</param>
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs
index 63fb327..08f7902 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ImageRenderer.cs
@@ -8,10 +8,6 @@ namespace Xamarin.Forms.Platform.Tizen
{
public class ImageRenderer : ViewRenderer<Image, Native.Image>
{
- public ImageRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<Image> e)
{
if (Control == null)
@@ -149,4 +145,4 @@ namespace Xamarin.Forms.Platform.Tizen
return Task.FromResult<bool>(false);
}
}
-} \ No newline at end of file
+}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
index 876e7f8..b3701d3 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
@@ -9,13 +9,13 @@ namespace Xamarin.Forms.Platform.Tizen
public LabelRenderer()
{
- RegisterPropertyHandler(Label.TextProperty, () => Control.Text = Element.Text);
+ RegisterPropertyHandler(Label.TextProperty, UpdateText);
RegisterPropertyHandler(Label.TextColorProperty, UpdateTextColor);
// FontProperty change is called also for FontSizeProperty, FontFamilyProperty and FontAttributesProperty change
RegisterPropertyHandler(Label.FontProperty, UpdateFontProperties);
RegisterPropertyHandler(Label.LineBreakModeProperty, UpdateLineBreakMode);
- RegisterPropertyHandler(Label.HorizontalTextAlignmentProperty, UpdateTextAlignment);
- RegisterPropertyHandler(Label.VerticalTextAlignmentProperty, UpdateTextAlignment);
+ RegisterPropertyHandler(Label.HorizontalTextAlignmentProperty, UpdateHorizontalTextAlignment);
+ RegisterPropertyHandler(Label.VerticalTextAlignmentProperty, UpdateVerticalTextAlignment);
RegisterPropertyHandler(Label.FormattedTextProperty, UpdateFormattedText);
if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
{
@@ -77,14 +77,23 @@ namespace Xamarin.Forms.Platform.Tizen
Control.FormattedText = ConvertFormattedText(Element.FormattedText);
}
+ void UpdateText()
+ {
+ Control.Text = Element.Text;
+ }
+
void UpdateTextColor()
{
Control.TextColor = Element.TextColor.ToNative();
}
- void UpdateTextAlignment()
+ void UpdateHorizontalTextAlignment()
{
Control.HorizontalTextAlignment = Element.HorizontalTextAlignment.ToNative();
+ }
+
+ void UpdateVerticalTextAlignment()
+ {
Control.VerticalTextAlignment = Element.VerticalTextAlignment.ToNative();
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
index 2f723f3..c2df806 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/LayoutRenderer.cs
@@ -9,13 +9,6 @@ namespace Xamarin.Forms.Platform.Tizen
{
bool _isLayoutUpdatedRegistered = false;
- /// <summary>
- /// Default constructor.
- /// </summary>
- public LayoutRenderer()
- {
- }
-
public void RegisterOnLayoutUpdated()
{
if (!_isLayoutUpdatedRegistered)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
index edcba08..49f4557 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
@@ -41,10 +41,6 @@ namespace Xamarin.Forms.Platform.Tizen
NaviItem CurrentNaviItem => _naviFrame.NavigationStack.Count > 0 ? _naviFrame.NavigationStack.Last() : null;
NaviItem PreviousNaviItem => _naviFrame.NavigationStack.Count > 1 ? _naviFrame.NavigationStack[_naviFrame.NavigationStack.Count - 2] : null;
- public NavigationPageRenderer()
- {
- }
-
protected override void Dispose(bool disposing)
{
_naviFrame.AnimationFinished -= AnimationFinishedHandler;
@@ -475,4 +471,4 @@ namespace Xamarin.Forms.Platform.Tizen
}
}
}
-} \ No newline at end of file
+}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs
index 663e56b..a8356ba 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs
@@ -12,10 +12,6 @@ namespace Xamarin.Forms.Platform.Tizen
internal Native.Dialog _dialog;
Dictionary<ListItem, int> _itemToItemNumber = new Dictionary<ListItem, int>();
- public PickerRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
{
if (Control == null)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs
index 5c7a423..8fe97a7 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs
@@ -8,10 +8,6 @@ namespace Xamarin.Forms.Platform.Tizen
{
public class ProgressBarRenderer : ViewRenderer<ProgressBar, EProgressBar>
{
- public ProgressBarRenderer()
- {
- }
-
protected override void OnElementChanged(ElementChangedEventArgs<ProgressBar> e)
{
if (base.Control == null)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/SliderRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/SliderRenderer.cs
index 93cc6e8..b275464 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/SliderRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/SliderRenderer.cs
@@ -10,8 +10,8 @@ namespace Xamarin.Forms.Platform.Tizen
public SliderRenderer()
{
RegisterPropertyHandler(Slider.ValueProperty, UpdateValue);
- RegisterPropertyHandler(Slider.MinimumProperty, UpdateMinMax);
- RegisterPropertyHandler(Slider.MaximumProperty, UpdateMinMax);
+ RegisterPropertyHandler(Slider.MinimumProperty, UpdateMinimum);
+ RegisterPropertyHandler(Slider.MaximumProperty, UpdateMaximum);
}
protected override void OnElementChanged(ElementChangedEventArgs<Slider> e)
@@ -53,11 +53,14 @@ namespace Xamarin.Forms.Platform.Tizen
Control.Value = Element.Value;
}
- protected void UpdateMinMax()
+ protected void UpdateMinimum()
{
Control.Minimum = Element.Minimum;
+ }
+
+ protected void UpdateMaximum()
+ {
Control.Maximum = Element.Maximum;
- UpdateValue();
}
}
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/StepperRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/StepperRenderer.cs
index 09d1bf6..e5e4c58 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/StepperRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/StepperRenderer.cs
@@ -9,8 +9,8 @@ namespace Xamarin.Forms.Platform.Tizen
public StepperRenderer()
{
RegisterPropertyHandler(Stepper.ValueProperty, UpdateValue);
- RegisterPropertyHandler(Stepper.MinimumProperty, UpdateMinMax);
- RegisterPropertyHandler(Stepper.MaximumProperty, UpdateMinMax);
+ RegisterPropertyHandler(Stepper.MinimumProperty, UpdateMinimum);
+ RegisterPropertyHandler(Stepper.MaximumProperty, UpdateMaximum);
RegisterPropertyHandler(Stepper.IncrementProperty, UpdateStep);
}
@@ -70,11 +70,14 @@ namespace Xamarin.Forms.Platform.Tizen
Control.Value = Element.Value;
}
- protected void UpdateMinMax()
+ protected void UpdateMinimum()
{
Control.Minimum = Element.Minimum;
+ }
+
+ protected void UpdateMaximum()
+ {
Control.Maximum = Element.Maximum;
- UpdateValue();
}
void UpdateStep()