diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Native')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Native/Box.cs | 20 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Native/LayoutEventArgs.cs | 11 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Native/ListView.cs | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Native/SearchBar.cs | 33 |
4 files changed, 27 insertions, 39 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Box.cs b/Xamarin.Forms.Platform.Tizen/Native/Box.cs index 2f551902..e2550e1a 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/Box.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Box.cs @@ -40,24 +40,24 @@ namespace Xamarin.Forms.Platform.Tizen.Native /// </remarks> void NotifyOnLayout() { - var g = Geometry; - - if (0 == g.Width || 0 == g.Height) - { - // ignore irrelevant dimensions - return; - } if (null != LayoutUpdated) { + var g = Geometry; + + if (0 == g.Width || 0 == g.Height || g == _previousGeometry) + { + // ignore irrelevant dimensions + return; + } + LayoutUpdated(this, new LayoutEventArgs() { - HasChanged = g != _previousGeometry, Geometry = g, } ); - } - _previousGeometry = g; + _previousGeometry = g; + } } } } diff --git a/Xamarin.Forms.Platform.Tizen/Native/LayoutEventArgs.cs b/Xamarin.Forms.Platform.Tizen/Native/LayoutEventArgs.cs index 060a1212..ddad8039 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/LayoutEventArgs.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/LayoutEventArgs.cs @@ -9,21 +9,12 @@ namespace Xamarin.Forms.Platform.Tizen.Native public class LayoutEventArgs : EventArgs { /// <summary> - /// Whether or not the dimensions have changed. - /// </summary> - public bool HasChanged - { - get; - internal set; - } - - /// <summary> /// Geometry of the layout area, absolute coordinate /// </summary> public Rect Geometry { get; - set; + internal set; } } } diff --git a/Xamarin.Forms.Platform.Tizen/Native/ListView.cs b/Xamarin.Forms.Platform.Tizen/Native/ListView.cs index fed99101..8501df10 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/ListView.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/ListView.cs @@ -595,6 +595,8 @@ namespace Xamarin.Forms.Platform.Tizen.Native renderer.NativeView.MinimumHeight = Forms.ConvertToScaledPixel(element.MinimumHeightRequest); } + (renderer as LayoutRenderer)?.RegisterOnLayoutUpdated(); + return renderer.NativeView; } }; diff --git a/Xamarin.Forms.Platform.Tizen/Native/SearchBar.cs b/Xamarin.Forms.Platform.Tizen/Native/SearchBar.cs index db597ed9..42ada16e 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/SearchBar.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/SearchBar.cs @@ -399,25 +399,20 @@ namespace Xamarin.Forms.Platform.Tizen.Native /// <param name="e">Event arguments.</param> void SearchBarLayoutUpdated(object sender, LayoutEventArgs e) { - if (!e.HasChanged) - { - return; - } - - _underlineRectangle.Geometry = new ERect(Geometry.Left + RectanglePaddingHorizontal, - Geometry.Top + EntryPaddingVertical + EntryHeight + RectanglePaddingTop, - Geometry.Width - (RectanglePaddingHorizontal * 2), - RectangleHeight); - - _entry.Geometry = new ERect(Geometry.Left + EntryPaddingHorizontal, - Geometry.Top + EntryPaddingVertical, - Geometry.Width - (EntryPaddingHorizontal + (CancelButtonPaddingHorizontal * 2) + CancelButtonSize), - EntryHeight); - - _cancelButton.Geometry = new ERect(Geometry.Right - CancelButtonSize - CancelButtonPaddingHorizontal, - Geometry.Top + RectanglePaddingBottom, - CancelButtonSize, - CancelButtonSize); + _underlineRectangle.Geometry = new ERect(e.Geometry.Left + RectanglePaddingHorizontal, + e.Geometry.Top + EntryPaddingVertical + EntryHeight + RectanglePaddingTop, + e.Geometry.Width - (RectanglePaddingHorizontal * 2), + RectangleHeight); + + _entry.Geometry = new ERect(e.Geometry.Left + EntryPaddingHorizontal, + e.Geometry.Top + EntryPaddingVertical, + e.Geometry.Width - (EntryPaddingHorizontal + (CancelButtonPaddingHorizontal * 2) + CancelButtonSize), + EntryHeight); + + _cancelButton.Geometry = new ERect(e.Geometry.Right - CancelButtonSize - CancelButtonPaddingHorizontal, + e.Geometry.Top + RectanglePaddingBottom, + CancelButtonSize, + CancelButtonSize); } } } |