Remove unnecessary update at initialize 00/135100/1
authorSeungkeun Lee <sngn.lee@samsung.com>
Wed, 21 Jun 2017 02:25:25 +0000 (11:25 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Wed, 21 Jun 2017 02:25:25 +0000 (11:25 +0900)
Change-Id: Ia6e1bcfa7c7ceb35b7b0c8d17376ebecb05f0d97

Xamarin.Forms.Platform.Tizen/Renderers/ActivityIndicatorRenderer.cs [changed mode: 0755->0644]
Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/ContentPageRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs

old mode 100755 (executable)
new mode 100644 (file)
index 6540762..25e891c
@@ -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();
                }
 
index f34bd32..ff23d67 100644 (file)
@@ -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();
                }
 
index c44c629..97b07bb 100644 (file)
@@ -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()
index 81a00a4..974cf38 100644 (file)
@@ -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
index ff96a67..b904b7d 100644 (file)
@@ -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();
                }
        }
index f269869..3274ec3 100644 (file)
@@ -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();
                }
 
index fff2179..a602ae0 100644 (file)
@@ -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();
                }
 
index da00ef9..e0b54d5 100644 (file)
@@ -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:
index f40ece7..0e76298 100644 (file)
@@ -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();
                        }