summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungkeun Lee <sngn.lee@samsung.com>2017-06-21 02:25:25 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 02:11:27 (GMT)
commit535265c5ad415d89ea596385ac4d75436f957a3a (patch)
tree870bfa384cc47a4eea643ce525895ded1a5613a2
parent3dae3f36abba30dfb5e3faaca653f007dbdf435e (diff)
downloadxamarin-forms-535265c5ad415d89ea596385ac4d75436f957a3a.zip
xamarin-forms-535265c5ad415d89ea596385ac4d75436f957a3a.tar.gz
xamarin-forms-535265c5ad415d89ea596385ac4d75436f957a3a.tar.bz2
Remove unnecessary update at initialize
Change-Id: Ia6e1bcfa7c7ceb35b7b0c8d17376ebecb05f0d97
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Platform.Tizen/Renderers/ActivityIndicatorRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs15
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs8
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs10
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs24
9 files changed, 65 insertions, 17 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ActivityIndicatorRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ActivityIndicatorRenderer.cs
index 6540762..25e891c 100755..100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ActivityIndicatorRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ActivityIndicatorRenderer.cs
@@ -36,8 +36,11 @@ namespace Xamarin.Forms.Platform.Tizen
base.OnElementChanged(e);
}
- void UpdateColor()
+ void UpdateColor(bool initialize)
{
+ if (initialize && Element.Color.IsDefault)
+ return;
+
Control.Color = (Element.Color == Color.Default) ? s_defaultColor : Element.Color.ToNative();
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
index f34bd32..ff23d67 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
@@ -31,13 +31,22 @@ namespace Xamarin.Forms.Platform.Tizen
base.OnElementPropertyChanged(sender, e);
}
- protected override void UpdateBackgroundColor()
+ protected override void UpdateBackgroundColor(bool initialize)
{
- UpdateColor();
+ if (initialize && Element.BackgroundColor.IsDefault)
+ return;
+
+ if (Element.Color.IsDefault)
+ {
+ UpdateColor();
+ }
}
- protected override void UpdateOpacity()
+ protected override void UpdateOpacity(bool initialize)
{
+ if (initialize && Element.Opacity == 1d)
+ return;
+
UpdateColor();
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
index c44c629..97b07bb 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
@@ -95,8 +95,12 @@ namespace Xamarin.Forms.Platform.Tizen
protected override void UpdateThemeStyle()
{
- Control.UpdateStyle(Specific.GetStyle(Element));
- ((IVisualElementController)Element).NativeSizeChanged();
+ var style = Specific.GetStyle(Element);
+ if (!string.IsNullOrEmpty(style))
+ {
+ Control.UpdateStyle(style);
+ ((IVisualElementController)Element).NativeSizeChanged();
+ }
}
void UpdateBorder()
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs
index 81a00a4..974cf38 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs
@@ -34,8 +34,11 @@ namespace Xamarin.Forms.Platform.Tizen
base.OnElementChanged(e);
}
- protected override void UpdateBackgroundColor()
+ protected override void UpdateBackgroundColor(bool initialize)
{
+ if (initialize && Element.BackgroundColor.IsDefault)
+ return;
+
// base.UpdateBackgroundColor() is not called on purpose, we don't want the regular background setting
if (Element.BackgroundColor.IsDefault || Element.BackgroundColor.A == 0)
_page.Color = EColor.Transparent;
@@ -48,8 +51,11 @@ namespace Xamarin.Forms.Platform.Tizen
// empty on purpose
}
- void UpdateBackgroundImage()
+ void UpdateBackgroundImage(bool initiaize)
{
+ if (initiaize && string.IsNullOrWhiteSpace(Element.BackgroundImage))
+ return;
+
if (string.IsNullOrWhiteSpace(Element.BackgroundImage))
_page.File = null;
else
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs
index ff96a67..b904b7d 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs
@@ -77,8 +77,11 @@ namespace Xamarin.Forms.Platform.Tizen
Control.FontAttributes = Element.FontAttributes;
}
- void UpdateKeyboard()
+ void UpdateKeyboard(bool initialize)
{
+ if (initialize && Element.Keyboard == Keyboard.Default)
+ return;
+
Control.Keyboard = Element.Keyboard.ToNative();
}
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
index f269869..3274ec3 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
@@ -111,8 +111,11 @@ namespace Xamarin.Forms.Platform.Tizen
Control.HorizontalTextAlignment = Element.HorizontalTextAlignment.ToNative();
}
- void UpdateKeyboard()
+ void UpdateKeyboard(bool initialize)
{
+ if (initialize && Element.Keyboard == Keyboard.Default)
+ return;
+
Control.Keyboard = Element.Keyboard.ToNative();
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs
index fff2179..a602ae0 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs
@@ -347,8 +347,11 @@ namespace Xamarin.Forms.Platform.Tizen
/// <summary>
/// Updates the height of the row.
/// </summary>
- void UpdateRowHeight()
+ void UpdateRowHeight(bool initialize)
{
+ if (initialize)
+ return;
+
Control.UpdateRealizedItems();
}
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
index da00ef9..e0b54d5 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
@@ -20,6 +20,7 @@ namespace Xamarin.Forms.Platform.Tizen
var _switch = new Check(Forms.Context.MainWindow)
{
PropagateEvents = false,
+ Style = SwitchStyle.Toggle
};
SetNativeControl(_switch);
}
@@ -40,6 +41,10 @@ namespace Xamarin.Forms.Platform.Tizen
protected override void UpdateThemeStyle()
{
var style = Specific.GetStyle(Element);
+ if (string.IsNullOrEmpty(style))
+ {
+ return;
+ }
switch (style)
{
case SwitchStyle.Toggle:
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs
index f40ece7..0e76298 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs
@@ -566,8 +566,11 @@ namespace Xamarin.Forms.Platform.Tizen
return new ESize(NativeView.MinimumWidth, NativeView.MinimumHeight);
}
- protected virtual void UpdateBackgroundColor()
+ protected virtual void UpdateBackgroundColor(bool initialize)
{
+ if (initialize && Element.BackgroundColor.IsDefault)
+ return;
+
if (NativeView is Widget)
{
(NativeView as Widget).BackgroundColor = Element.BackgroundColor.ToNative();
@@ -578,8 +581,11 @@ namespace Xamarin.Forms.Platform.Tizen
}
}
- protected virtual void UpdateOpacity()
+ protected virtual void UpdateOpacity(bool initialize)
{
+ if (initialize && Element.Opacity == 1d)
+ return;
+
if (NativeView is Widget)
{
(NativeView as Widget).Opacity = (int)(Element.Opacity * 255.0);
@@ -764,8 +770,11 @@ namespace Xamarin.Forms.Platform.Tizen
/// <summary>
/// Updates the IsEnabled property.
/// </summary>
- void UpdateIsEnabled()
+ void UpdateIsEnabled(bool initialize)
{
+ if (initialize && Element.IsEnabled)
+ return;
+
var widget = NativeView as Widget;
if (widget != null)
{
@@ -776,8 +785,11 @@ namespace Xamarin.Forms.Platform.Tizen
/// <summary>
/// Updates the InputTransparent property.
/// </summary>
- void UpdateInputTransparent()
+ void UpdateInputTransparent(bool initialize)
{
+ if (initialize && Element.InputTransparent == default(bool))
+ return;
+
NativeView.PassEvents = Element.InputTransparent;
}
@@ -818,14 +830,14 @@ namespace Xamarin.Forms.Platform.Tizen
}
}
- void UpdateToolTip()
+ void UpdateToolTip(bool initialize)
{
var tooltip = Specific.GetToolTip(Element);
if (tooltip != null)
{
NativeView.SetTooltipText(tooltip);
}
- else
+ else if (!initialize)
{
NativeView.UnsetTooltip();
}