Skip to content

Commit 5d0b259

Browse files
authored
Merge pull request #592 from LuckyDucko/patch-4
(iOS) Fix freezing under xamarin forms 5.0.0.1558-pre3
2 parents 6f34dae + 4a4f86d commit 5d0b259

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Rg.Plugins.Popup/Animations/Base/BaseAnimation.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using Rg.Plugins.Popup.Pages;
55
using Xamarin.Forms;
66

7+
using EasingTypeConverter = Rg.Plugins.Popup.Converters.TypeConverters.EasingTypeConverter;
8+
79
namespace Rg.Plugins.Popup.Animations.Base
810
{
911
public abstract class BaseAnimation : IPopupAnimation

Rg.Plugins.Popup/Platforms/Android/Renderers/PopupPageRenderer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)
6868
var decoreHeight = decoreView.Height;
6969
var decoreWidht = decoreView.Width;
7070

71-
var visibleRect = new Rect();
71+
var visibleRect = new Android.Graphics.Rect();
72+
7273
decoreView.GetWindowVisibleDisplayFrame(visibleRect);
7374

7475
if (Build.VERSION.SdkInt >= BuildVersionCodes.M)
@@ -244,4 +245,4 @@ private bool IsInRegion(float x, float y, View v)
244245

245246
#endregion
246247
}
247-
}
248+
}

Rg.Plugins.Popup/Platforms/Ios/Extensions/PlatformExtension.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ public static void UpdateSize(this PopupPageRenderer renderer)
6161
Right = applactionFrame.Right - applactionFrame.Width - applactionFrame.Left,
6262
Bottom = applactionFrame.Bottom - applactionFrame.Height - applactionFrame.Top + renderer.KeyboardBounds.Height
6363
};
64+
if (currentElement.SystemPadding != systemPadding && renderer.Element.Width != superviewFrame.Width && renderer.Element.Height != superviewFrame.Height)
65+
{
66+
currentElement.BatchBegin();
6467

65-
currentElement.BatchBegin();
66-
67-
currentElement.SystemPadding = systemPadding;
68-
renderer.SetElementSize(new Size(superviewFrame.Width, superviewFrame.Height));
68+
currentElement.SystemPadding = systemPadding;
69+
renderer.SetElementSize(new Size(superviewFrame.Width, superviewFrame.Height));
6970

70-
currentElement.BatchCommit();
71+
currentElement.BatchCommit();
72+
}
7173
}
7274
}
7375
}

0 commit comments

Comments
 (0)