Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn00 committed Oct 5, 2020
1 parent 122c399 commit 486fbc7
Show file tree
Hide file tree
Showing 53 changed files with 122 additions and 240 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!--<PackageIcon>icon.png</PackageIcon>
<PackageIconFullPath>$(MSBuildThisFileDirectory)icon.png</PackageIconFullPath>-->
<Authors>Kirill Lyubimov</Authors>
<Owners>Kirill Lyubimov, rotorgames, martijn00</Owners>
<Owners>Kirill Lyubimov, rotorgames, martijn00, Baseflow</Owners>
<PackageTags>Xamarin.Forms, xamarin, forms, popup, page, modal</PackageTags>
<PackageReleaseNotes>https://github.com/rotorgames/Rg.Plugins.Popup/releases</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -18,7 +18,7 @@
<RepositoryUrl>https://github.com/rotorgames/Rg.Plugins.Popup</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<Version>2.0.0.5</Version>
<Version>2.0.0.6</Version>

<!--<Nullable>enable</Nullable>-->
<LangVersion>8.0</LangVersion>
Expand Down Expand Up @@ -83,7 +83,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Analyzers" Version="2.3.0">
<PackageReference Include="Roslynator.Analyzers" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 0 additions & 3 deletions Rg.Plugins.Popup.sln
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ Global
{629564FB-8C63-40BD-BD06-FE2453BB461F}.Publish|x86.ActiveCfg = Debug|Any CPU
{629564FB-8C63-40BD-BD06-FE2453BB461F}.Publish|x86.Build.0 = Debug|Any CPU
{629564FB-8C63-40BD-BD06-FE2453BB461F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{629564FB-8C63-40BD-BD06-FE2453BB461F}.Release|Any CPU.Build.0 = Release|Any CPU
{629564FB-8C63-40BD-BD06-FE2453BB461F}.Release|ARM.ActiveCfg = Release|Any CPU
{629564FB-8C63-40BD-BD06-FE2453BB461F}.Release|ARM.Build.0 = Release|Any CPU
{629564FB-8C63-40BD-BD06-FE2453BB461F}.Release|iPhone.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -509,7 +508,6 @@ Global
{0C21CF96-BEE6-4683-B061-14E69A4D2AB9}.Publish|x86.ActiveCfg = Release|Any CPU
{0C21CF96-BEE6-4683-B061-14E69A4D2AB9}.Publish|x86.Build.0 = Release|Any CPU
{0C21CF96-BEE6-4683-B061-14E69A4D2AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C21CF96-BEE6-4683-B061-14E69A4D2AB9}.Release|Any CPU.Build.0 = Release|Any CPU
{0C21CF96-BEE6-4683-B061-14E69A4D2AB9}.Release|ARM.ActiveCfg = Release|Any CPU
{0C21CF96-BEE6-4683-B061-14E69A4D2AB9}.Release|ARM.Build.0 = Release|Any CPU
{0C21CF96-BEE6-4683-B061-14E69A4D2AB9}.Release|iPhone.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -569,7 +567,6 @@ Global
{AE8BE751-A884-410B-957C-7F5B643BDEF7}.Publish|x86.ActiveCfg = Release|Any CPU
{AE8BE751-A884-410B-957C-7F5B643BDEF7}.Publish|x86.Build.0 = Release|Any CPU
{AE8BE751-A884-410B-957C-7F5B643BDEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE8BE751-A884-410B-957C-7F5B643BDEF7}.Release|Any CPU.Build.0 = Release|Any CPU
{AE8BE751-A884-410B-957C-7F5B643BDEF7}.Release|ARM.ActiveCfg = Release|Any CPU
{AE8BE751-A884-410B-957C-7F5B643BDEF7}.Release|ARM.Build.0 = Release|Any CPU
{AE8BE751-A884-410B-957C-7F5B643BDEF7}.Release|iPhone.ActiveCfg = Release|Any CPU
Expand Down
4 changes: 2 additions & 2 deletions Rg.Plugins.Popup/Animations/Base/BaseAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ public abstract class BaseAnimation : IPopupAnimation
{
private const uint DefaultDuration = 200;

[TypeConverter(typeof (UintTypeConverter))]
[TypeConverter(typeof(UintTypeConverter))]
public uint DurationIn { get; set; } = DefaultDuration;

[TypeConverter(typeof (UintTypeConverter))]
[TypeConverter(typeof(UintTypeConverter))]
public uint DurationOut { get; set; } = DefaultDuration;

[TypeConverter(typeof(EasingTypeConverter))]
Expand Down
2 changes: 1 addition & 1 deletion Rg.Plugins.Popup/Animations/FadeAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override void Preparing(View content, PopupPage page)
_defaultOpacity = page.Opacity;
page.Opacity = 0;
}
else if(content != null)
else if (content != null)
{
_defaultOpacity = content.Opacity;
content.Opacity = 0;
Expand Down
4 changes: 2 additions & 2 deletions Rg.Plugins.Popup/Animations/MoveAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MoveAnimation : FadeBackgroundAnimation
public MoveAnimationOptions PositionIn { get; set; }
public MoveAnimationOptions PositionOut { get; set; }

public MoveAnimation(): this(MoveAnimationOptions.Bottom, MoveAnimationOptions.Bottom) {}
public MoveAnimation() : this(MoveAnimationOptions.Bottom, MoveAnimationOptions.Bottom) { }

public MoveAnimation(MoveAnimationOptions positionIn, MoveAnimationOptions positionOut)
{
Expand All @@ -33,7 +33,7 @@ public override void Preparing(View content, PopupPage page)

HidePage(page);

if(content == null) return;
if (content == null) return;

UpdateDefaultTranslations(content);
}
Expand Down
12 changes: 6 additions & 6 deletions Rg.Plugins.Popup/Animations/ScaleAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ScaleAnimation : FadeAnimation
public MoveAnimationOptions PositionIn { get; set; }
public MoveAnimationOptions PositionOut { get; set; }

public ScaleAnimation():this(MoveAnimationOptions.Center, MoveAnimationOptions.Center) {}
public ScaleAnimation() : this(MoveAnimationOptions.Center, MoveAnimationOptions.Center) { }

public ScaleAnimation(MoveAnimationOptions positionIn, MoveAnimationOptions positionOut)
{
Expand All @@ -34,15 +34,15 @@ public ScaleAnimation(MoveAnimationOptions positionIn, MoveAnimationOptions posi

public override void Preparing(View content, PopupPage page)
{
if(HasBackgroundAnimation) base.Preparing(content, page);
if (HasBackgroundAnimation) base.Preparing(content, page);

HidePage(page);

if(content == null) return;
if (content == null) return;

UpdateDefaultProperties(content);

if(!HasBackgroundAnimation) content.Opacity = 0;
if (!HasBackgroundAnimation) content.Opacity = 0;
}

public override void Disposing(View content, PopupPage page)
Expand All @@ -51,7 +51,7 @@ public override void Disposing(View content, PopupPage page)

ShowPage(page);

if(content == null) return;
if (content == null) return;

content.Scale = _defaultScale;
content.Opacity = _defaultOpacity;
Expand Down Expand Up @@ -138,7 +138,7 @@ public async override Task Disappearing(View content, PopupPage page)
private Task Scale(View content, Easing easing, double start, double end, bool isAppearing)
{
TaskCompletionSource<bool> task = new TaskCompletionSource<bool>();

content.Animate("popIn", d =>
{
content.Scale = d;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace Rg.Plugins.Popup.Converters.TypeConverters
Expand Down
8 changes: 1 addition & 7 deletions Rg.Plugins.Popup/Enums/MoveAnimationOptions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rg.Plugins.Popup.Enums
namespace Rg.Plugins.Popup.Enums
{
public enum MoveAnimationOptions
{
Expand Down
2 changes: 1 addition & 1 deletion Rg.Plugins.Popup/Extensions/VisualElementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Rg.Plugins.Popup.Extensions
{
internal static class VisualElementExtensions
{
[Obsolete("Use "+nameof(Element)+"."+nameof(Element.Descendants))]
[Obsolete("Use " + nameof(Element) + "." + nameof(Element.Descendants))]
internal static IEnumerable<Element> RgDescendants(this Element element)
{
var queue = new Queue<Element>(16);
Expand Down
12 changes: 6 additions & 6 deletions Rg.Plugins.Popup/Pages/PopupPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class PopupPage : ContentPage
{
#region Private

private const string IsAnimatingObsoleteText =
nameof(IsAnimating) +
private const string IsAnimatingObsoleteText =
nameof(IsAnimating) +
" is obsolute as of v1.1.5. Please use "
+nameof(IsAnimationEnabled) +
+ nameof(IsAnimationEnabled) +
" instead. See more info: "
+Config.MigrationV1_0_xToV1_1_xUrl;
+ Config.MigrationV1_0_xToV1_1_xUrl;

#endregion

Expand Down Expand Up @@ -161,7 +161,7 @@ protected override bool OnBackButtonPressed()

protected override void LayoutChildren(double x, double y, double width, double height)
{
if(HasSystemPadding)
if (HasSystemPadding)
{
var systemPadding = SystemPadding;
var systemPaddingSide = SystemPaddingSides;
Expand All @@ -188,7 +188,7 @@ protected override void LayoutChildren(double x, double y, double width, double
else
height -= top + bottom;
}
else if(HasKeyboardOffset)
else if (HasKeyboardOffset)
{
height -= KeyboardOffset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Task RemoveAsync(PopupPage page)
DecoreView.RemoveView(renderer.View);
renderer.Dispose();

if(element != null)
if (element != null)
element.Parent = null;

return PostAsync(DecoreView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Android.App;
using Android.Content;
using Android.Graphics;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
Expand All @@ -12,7 +13,6 @@
using Xamarin.Forms.Platform.Android;
using Point = Xamarin.Forms.Point;
using View = Android.Views.View;
using Android.OS;

[assembly: ExportRenderer(typeof(PopupPage), typeof(PopupPageRenderer))]
namespace Rg.Plugins.Popup.Droid.Renderers
Expand All @@ -26,11 +26,11 @@ public class PopupPageRenderer : PageRenderer
private Point _downPosition;
private bool _disposed;

private PopupPage CurrentElement => (PopupPage) Element;
private PopupPage CurrentElement => (PopupPage)Element;

#region Main Methods

public PopupPageRenderer(Context context):base(context)
public PopupPageRenderer(Context context) : base(context)
{
_gestureDetectorListener = new RgGestureDetectorListener();

Expand Down Expand Up @@ -83,7 +83,7 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)
{
keyboardOffset = Context.FromPixels(screenRealSize.Y - visibleRect.Bottom);
}

systemPadding = new Thickness
{
Left = Context.FromPixels(windowInsets.SystemWindowInsetLeft),
Expand Down Expand Up @@ -131,15 +131,15 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)

protected override void OnAttachedToWindow()
{
Context.HideKeyboard(((Activity) Context).Window.DecorView);
Context.HideKeyboard(((Activity)Context).Window.DecorView);
base.OnAttachedToWindow();
}

protected override void OnDetachedFromWindow()
{
Device.StartTimer(TimeSpan.FromMilliseconds(0), () =>
{
Popup.Context.HideKeyboard(((Activity) Popup.Context).Window.DecorView);
Popup.Context.HideKeyboard(((Activity)Popup.Context).Window.DecorView);
return false;
});
base.OnDetachedFromWindow();
Expand Down Expand Up @@ -207,7 +207,7 @@ public override bool OnTouchEvent(MotionEvent e)

_gestureDetector.OnTouchEvent(e);

if(CurrentElement != null && CurrentElement.BackgroundInputTransparent)
if (CurrentElement != null && CurrentElement.BackgroundInputTransparent)
{
if (ChildCount > 0 && !IsInRegion(e.RawX, e.RawY, GetChildAt(0)) || ChildCount == 0)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Linq;
using Rg.Plugins.Popup.IOS.Renderers;
using UIKit;
using Xamarin.Forms;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using UIKit;
using Xamarin.Forms.Platform.iOS;
using System;
using Foundation;
using System;
using UIKit;
using Xamarin.Forms.Platform.iOS;

namespace Rg.Plugins.Popup.IOS.Platform
{
Expand Down Expand Up @@ -94,7 +94,7 @@ public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientati
public override void ViewDidLayoutSubviews()
{
base.ViewDidLayoutSubviews();

PresentedViewController?.ViewDidLayoutSubviews();
}
}
Expand Down
8 changes: 4 additions & 4 deletions Rg.Plugins.Popup/Platforms/Ios/Platform/PopupWindow.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System;
using CoreGraphics;
using UIKit;
using Rg.Plugins.Popup.Pages;
using Foundation;
using Rg.Plugins.Popup.Pages;
using UIKit;

namespace Rg.Plugins.Popup.IOS.Platform
{
[Preserve(AllMembers = true)]
[Register("RgPopupWindow")]
internal class PopupWindow : UIWindow
{
public PopupWindow(IntPtr handle):base(handle)
public PopupWindow(IntPtr handle) : base(handle)
{
// Fix #307
}
Expand All @@ -22,7 +22,7 @@ public PopupWindow()

public override UIView HitTest(CGPoint point, UIEvent uievent)
{
var platformRenderer = (PopupPlatformRenderer) RootViewController;
var platformRenderer = (PopupPlatformRenderer)RootViewController;
var formsElement = platformRenderer?.Renderer?.Element as PopupPage;
var renderer = platformRenderer?.Renderer;
var hitTestResult = base.HitTest(point, uievent);
Expand Down
5 changes: 2 additions & 3 deletions Rg.Plugins.Popup/Platforms/Ios/Renderers/PopupPageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using Size = Xamarin.Forms.Size;

[assembly: ExportRenderer(typeof(PopupPage), typeof(PopupPageRenderer))]
namespace Rg.Plugins.Popup.IOS.Renderers
Expand All @@ -21,7 +20,7 @@ public class PopupPageRenderer : PageRenderer
private bool _isDisposed;

internal CGRect KeyboardBounds { get; private set; } = CGRect.Empty;
internal PopupPage CurrentElement => (PopupPage) Element;
internal PopupPage CurrentElement => (PopupPage)Element;

#region Main Methods

Expand Down Expand Up @@ -143,7 +142,7 @@ private async void KeyBoardDownNotification(NSNotification notifi)
//It is needed that buttons are working when keyboard is opened. See #11
await Task.Delay(70);

if(!_isDisposed)
if (!_isDisposed)
await UIView.AnimateAsync((double)(NSNumber)duration, OnKeyboardAnimated);
}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Linq;
using AppKit;
using Rg.Plugins.Popup.MacOS.Renderers;
using Xamarin.Forms;
Expand Down
5 changes: 0 additions & 5 deletions Rg.Plugins.Popup/Platforms/Mac/Impl/PopupPlatformMacOS.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using AppKit;
using CoreGraphics;
using Foundation;
using Rg.Plugins.Popup.Contracts;
using Rg.Plugins.Popup.MacOS.Extensions;
using Rg.Plugins.Popup.MacOS.Impl;
using Rg.Plugins.Popup.MacOS.Platform;
using Rg.Plugins.Popup.Pages;
using Xamarin.Forms;
using Xamarin.Forms.Platform.MacOS;
using XFPlatform = Xamarin.Forms.Platform.MacOS.Platform;

[assembly: Dependency(typeof(PopupPlatformMacOS))]
namespace Rg.Plugins.Popup.MacOS.Impl
Expand Down
Loading

0 comments on commit 486fbc7

Please sign in to comment.