From 619445e705834bb7925f7b5f901d4f7e288b2b6a Mon Sep 17 00:00:00 2001 From: JKennedy24 Date: Thu, 18 Jan 2018 11:05:17 +0000 Subject: [PATCH 01/20] Potential Fix for SystemPadding As of XF V2.5 `Forms.Context` is obsolete I have swapped it to local Context. Potential fix for https://github.com/rotorgames/Rg.Plugins.Popup/issues/162 --- src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs index 254f510b..7a06f51d 100644 --- a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs +++ b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs @@ -76,7 +76,7 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b) private Thickness GetSystemPadding() { - var decoreView = (FrameLayout)((Activity)Forms.Context).Window.DecorView; + var decoreView = (FrameLayout)((Activity)Context).Window.DecorView; Rect visibleRect = new Rect(); decoreView.GetWindowVisibleDisplayFrame(visibleRect); @@ -189,4 +189,4 @@ private bool IsInRegion(float x, float y, View v) #endregion } -} \ No newline at end of file +} From 2b26db68a5c45bea1c804b6b3e9ccca33105652e Mon Sep 17 00:00:00 2001 From: JKennedy24 Date: Thu, 18 Jan 2018 10:34:18 +0000 Subject: [PATCH 02/20] Fixes Issue #217 and allows support for lower versions Allows support for lower versions of windows 10 --- src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj b/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj index 018d4f7f..6df0e94f 100644 --- a/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj +++ b/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj @@ -11,8 +11,8 @@ Rg.Plugins.Popup.UWP ru-RU UAP - 10.0.16299.0 - 10.0.16299.0 + 10.0.10240.0 + 10.0.10240.0 14 512 {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} From fdcd33542ae42432c8f8041c4f16993cb9775bf7 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 11:24:25 +0400 Subject: [PATCH 03/20] feat(Appveyor): Update build config --- appveyor.yml | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 76e786dd..d6382f2c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,20 +1,32 @@ version: 1.1.3.{build}-pre branches: only: - - master - - develop + - master + - develop image: Visual Studio 2017 configuration: Publish platform: Any CPU environment: - nuget_api_key: - secure: L7CA8R31O28Mlv6Bw82r9nwZWnnRJzuHvdOLrNckp47kfsipZBiCYlF0fiwb3jXr + nuget_api_key: + secure: L7CA8R31O28Mlv6Bw82r9nwZWnnRJzuHvdOLrNckp47kfsipZBiCYlF0fiwb3jXr + github_api_key: + secure: c6q7KD53/7bdsiAyFFFKLvQih4V5PHnqG2/R+pEBuoxtHSctp3RMKzB5HScez8aM assembly_info: - patch: true - file: '**\AssemblyInfo.*' - assembly_version: '{version}' - assembly_file_version: '{version}' - assembly_informational_version: '{version}' + patch: true + file: '**\AssemblyInfo.*' + assembly_version: '{version}' + assembly_file_version: '{version}' + assembly_informational_version: '{version}' +deploy: + - provider: GitHub + auth_token: $(github_api_key) + tag: $(appveyor_repo_tag_name) + artifact: /.*\.nupkg/ # upload all NuGet packages to release assets + draft: false + prerelease: false + on: + branch: master # release from master branch only + appveyor_repo_tag: true # deploy on tag push only build_script: - cmd: >- cd src @@ -26,11 +38,14 @@ build_script: msbuild Rg.Plugins.Popup.sln /t:Build /p:Configuration=Publish /p:Platform="Any CPU" deploy_script: - ps: >- + $isRelease = $env:APPVEYOR_REPO_TAG -eq "true" -And $env:APPVEYOR_REPO_TAG_NAME.StartsWith("v", "CurrentCultureIgnoreCase") + $isForceBuild = $env:APPVEYOR_FORCED_BUILD -or $env:APPVEYOR_RE_BUILD + cd ../nuspec nuget pack "Rg.Plugins.Popup.nuspec" -Version $env:APPVEYOR_BUILD_VERSION - if($env:APPVEYOR_REPO_BRANCH -eq "master" -and ($env:APPVEYOR_REPO_TAG -or $env:APPVEYOR_FORCED_BUILD -or $env:APPVEYOR_RE_BUILD)) + if($env:APPVEYOR_REPO_BRANCH -eq "master" -and ($isRelease -or $isForceBuild)) { nuget push *.nupkg -Source "https://www.nuget.org" -ApiKey $env:NUGET_API_KEY } From 093ded890a2c45c708561b44b98d28eb538ca56f Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 11:25:29 +0400 Subject: [PATCH 04/20] v1.1.3-beta --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d6382f2c..b860e404 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.1.3.{build}-pre +version: 1.1.3.{build}-beta branches: only: - master From cb0a1b2dcbc7a1c47a2115052f34171bee7ef27c Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 11:28:45 +0400 Subject: [PATCH 05/20] fix(Appveyor): Fix config file --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b860e404..7f1fb663 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,8 +38,8 @@ build_script: msbuild Rg.Plugins.Popup.sln /t:Build /p:Configuration=Publish /p:Platform="Any CPU" deploy_script: - ps: >- - $isRelease = $env:APPVEYOR_REPO_TAG -eq "true" -And $env:APPVEYOR_REPO_TAG_NAME.StartsWith("v", "CurrentCultureIgnoreCase") - $isForceBuild = $env:APPVEYOR_FORCED_BUILD -or $env:APPVEYOR_RE_BUILD + $isRelease = $env:APPVEYOR_REPO_TAG -eq "true" -And $env:APPVEYOR_REPO_TAG_NAME.StartsWith("v", "CurrentCultureIgnoreCase") + $isForceBuild = $env:APPVEYOR_FORCED_BUILD -or $env:APPVEYOR_RE_BUILD cd ../nuspec @@ -47,10 +47,10 @@ deploy_script: if($env:APPVEYOR_REPO_BRANCH -eq "master" -and ($isRelease -or $isForceBuild)) { - nuget push *.nupkg -Source "https://www.nuget.org" -ApiKey $env:NUGET_API_KEY + nuget push *.nupkg -Source "https://www.nuget.org" -ApiKey $env:NUGET_API_KEY } if($env:APPVEYOR_REPO_BRANCH -eq "develop") { - Get-ChildItem .\*.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + Get-ChildItem .\*.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } } \ No newline at end of file From 06edddab7ef76e25f97bb006aac9fdc5857e5c9f Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 11:32:05 +0400 Subject: [PATCH 06/20] fix(Appveyor): Added space to config file --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 7f1fb663..ae2a1819 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -39,6 +39,7 @@ build_script: deploy_script: - ps: >- $isRelease = $env:APPVEYOR_REPO_TAG -eq "true" -And $env:APPVEYOR_REPO_TAG_NAME.StartsWith("v", "CurrentCultureIgnoreCase") + $isForceBuild = $env:APPVEYOR_FORCED_BUILD -or $env:APPVEYOR_RE_BUILD cd ../nuspec From 570dac672c74b7d93d19d04535aed1add3b29b09 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 11:39:52 +0400 Subject: [PATCH 07/20] Merge pull request #221 from JKennedy24/#217 Fixes Issue #217 and allows support for lower versions (reverted from commit da06e0aee44bc375443eb61d2c4697ef60e22103) --- src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj b/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj index 6df0e94f..018d4f7f 100644 --- a/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj +++ b/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj @@ -11,8 +11,8 @@ Rg.Plugins.Popup.UWP ru-RU UAP - 10.0.10240.0 - 10.0.10240.0 + 10.0.16299.0 + 10.0.16299.0 14 512 {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} From a2f803df8dcb01e49e4ef11891d92dc6d086fbcc Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 14:56:38 +0400 Subject: [PATCH 08/20] feat(Appveyor): Updated config file for the new deploy system --- appveyor.yml | 55 +++++++++++++--------------------------------------- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ae2a1819..db3ee961 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,55 +3,26 @@ branches: only: - master - develop +skip_tags: true image: Visual Studio 2017 configuration: Publish platform: Any CPU -environment: - nuget_api_key: - secure: L7CA8R31O28Mlv6Bw82r9nwZWnnRJzuHvdOLrNckp47kfsipZBiCYlF0fiwb3jXr - github_api_key: - secure: c6q7KD53/7bdsiAyFFFKLvQih4V5PHnqG2/R+pEBuoxtHSctp3RMKzB5HScez8aM assembly_info: patch: true file: '**\AssemblyInfo.*' assembly_version: '{version}' assembly_file_version: '{version}' assembly_informational_version: '{version}' -deploy: - - provider: GitHub - auth_token: $(github_api_key) - tag: $(appveyor_repo_tag_name) - artifact: /.*\.nupkg/ # upload all NuGet packages to release assets - draft: false - prerelease: false - on: - branch: master # release from master branch only - appveyor_repo_tag: true # deploy on tag push only +environment: + solution_dir: "src" + nuspec_dir: "nuspec" +init: + - nuget update -self +before_build: + - nuget restore %solution_dir% build_script: -- cmd: >- - cd src - - nuget update -self - - nuget restore - - msbuild Rg.Plugins.Popup.sln /t:Build /p:Configuration=Publish /p:Platform="Any CPU" -deploy_script: -- ps: >- - $isRelease = $env:APPVEYOR_REPO_TAG -eq "true" -And $env:APPVEYOR_REPO_TAG_NAME.StartsWith("v", "CurrentCultureIgnoreCase") - - $isForceBuild = $env:APPVEYOR_FORCED_BUILD -or $env:APPVEYOR_RE_BUILD - - cd ../nuspec - - nuget pack "Rg.Plugins.Popup.nuspec" -Version $env:APPVEYOR_BUILD_VERSION - - if($env:APPVEYOR_REPO_BRANCH -eq "master" -and ($isRelease -or $isForceBuild)) - { - nuget push *.nupkg -Source "https://www.nuget.org" -ApiKey $env:NUGET_API_KEY - } - - if($env:APPVEYOR_REPO_BRANCH -eq "develop") - { - Get-ChildItem .\*.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } - } \ No newline at end of file + - msbuild %solution_dir%/Rg.Plugins.Popup.sln /t:Build /p:Configuration=Publish /p:Platform="Any CPU" +after_build: + - nuget pack %nuspec_dir%/Rg.Plugins.Popup.nuspec -Version %APPVEYOR_BUILD_VERSION% +artifacts: + - path: "*.nupkg" \ No newline at end of file From 7b9efafdf480e000949097cf109da6b09b1491a8 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 15:04:45 +0400 Subject: [PATCH 09/20] feat(Platform Min Version, UWP): Downgrade min TargetPlatformMinVersion to 10.0.10240.0 #217 --- src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj b/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj index 018d4f7f..b087f705 100644 --- a/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj +++ b/src/Rg.Plugins.Popup.UWP/Rg.Plugins.Popup.UWP.csproj @@ -12,7 +12,7 @@ ru-RU UAP 10.0.16299.0 - 10.0.16299.0 + 10.0.10240.0 14 512 {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} From 57b0355ef53479e3ae1d08fcdcad4031e0ff4923 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Mon, 29 Jan 2018 15:24:52 +0400 Subject: [PATCH 10/20] feat(Nuspec): Removed release notes and cleaned description --- nuspec/Rg.Plugins.Popup.nuspec | 91 +--------------------------------- 1 file changed, 2 insertions(+), 89 deletions(-) diff --git a/nuspec/Rg.Plugins.Popup.nuspec b/nuspec/Rg.Plugins.Popup.nuspec index b96756de..309e6570 100644 --- a/nuspec/Rg.Plugins.Popup.nuspec +++ b/nuspec/Rg.Plugins.Popup.nuspec @@ -10,95 +10,8 @@ https://raw.githubusercontent.com/rotorgames/Rg.Plugins.Popup/master/icons/icon.png https://github.com/rotorgames/Rg.Plugins.Popup/blob/master/LICENSE.md false - - Plugin for Xamarin forms. Allows you to open any page as a popup. - - Support Android, iOS, UWP - - Attention. This version is not compatible with 0.0.17 and 1.0.0 - - - --> - [1.1.3.x-pre] - - Fix Android. Back button didn't work - [1.1.2-pre] - - Updated a min xamarin forms version to 2.5.0.121934 - - Fix Android. PopupStack was not cleared after an application resume - - Removed Stubs project and added Init methods - [1.1.1-pre] - - Doesn't have any changes - [1.1.0-pre9] - - Set min Xamarin.Forms version 2.4.0.280 because only then Xamarin.Forms opened internal methods witch needed for this plugin - [1.1.0-pre8] - - Fixed iOS. The Linker removed library in release mode - [1.1.0-pre7] - - Added NET.Standard support - [1.1.0-pre5] - - Fixed Android. PopupPageRenderer thrown an exception when an user clicked on background if an animation was disabled and BackgroundClick could be invoked even if a touch was on Content. See [#173] - - Fixed iOS. Сhildren of PopupPage was not released from memory if them was removed before page was popped. - [1.1.0-pre4] - - Fixed iOS. ViewDidLayoutSubviews thrown an exception because it was invoked even when a popup was popped. See #134 - [1.1.0-pre3] - - Fixed Android. BackgroundClick and CloseWhenBackgroundIsClicked didn't work with Xamarin.Forms 2.4.x. See #173 - - Fixed iOS. The app could throw an exception when a popup is closed with an opened keyboard. See #122 - [1.1.0-pre2] - - Fixed. Popups was not opened on iOS 8.x - - Fixed. Click on back button can throw exception - [1.1.0-pre1] - - Added instance for IPopupNavigation for MVVM and DI - - Added new opening system with UIWindow witch gives us to open some popups under native dialogs and action sheet - - Made PopupPage.SystemPadding as BindableProperty - - Fixed memory leaks on iOS, Android, UWP, WP - - Fixed clicking on buttons on all platforms. Buttons were not clicked when keyboard was opened. - [1.0.4] - - Fix. Popup page won't open on a modal inside a navigation page in iOS #49 - [1.0.3] - - Plugin didn't work on UWP. - [1.0.2] - - Add support Windows Phone and UWP - - Initialization is not required now (except UWP) - - Improved performance animation on Android - - Now, new animation system - - Now it is possible to use one copy of the page a few times - - Add overridden methods OnAppearingAnimationEnd and OnDisappearingAnimationEnd - - Add overridden method OnBackgroundClicked in PopupPage - - Removed some reflection methods - - Removed from Popup Page, properties that override the default properties Page - - Fix. Glitch in animation when popping - - Fix. BackgroundImage is not visible in PopupPage - - Fix. DisplayAlert and DisplayActionSheet did not shown in iOS - - Fix. UWP project crashes in release mode. - - Fix. When you compile in the console does not display warnings. - - Fix. The application no longer crashes if during the animation, press the back button - [0.0.16] - - Add support Xamarin.Forms v2.2.0.31 - [0.0.15] - - Add support Link All in android - [0.0.14] - - Fix the app crash on ios in release mode and add support Link All in iOS - [0.0.13] - - Fix ItemSelected did not work in ListView on ios - [0.0.12] - - Fix Popup not working if there was an open modal page. - - Renamed PopAllAsync in PopAll, since this method is not async - [0.0.11] - - Fix It does not throw an exception if an error occurred in the Popup Navigation.Pop Async - - Fix Renamed class names and methods that have been misspelled. - [0.0.10] - - Fix Demo not open after clone in git - - Add PopupPage close on backgroind click - - Make PopupPageRendere public modifier - [0.0.9] - - Fix Android Keyboard not hided when entry unfocused - [0.0.8] - - Fix Android Hide keyboard when popup open or close - - Fix iOS Moved popup when keyboard showed - [0.0.6] - - Add SystemPadding - [0.0.5] - - Fix Android PopupPage do not update layout in AppCompat - - xamarin forms popup page modal + Plugin for Xamarin forms. Allows you to open any page as a popup. + Xamarin.Forms xamarin forms popup page modal From e0e891f30030c806dd6aaa9a6b44e9fbaef9fdab Mon Sep 17 00:00:00 2001 From: Kirill Date: Mon, 29 Jan 2018 17:45:45 +0400 Subject: [PATCH 11/20] feat(Readme): Added develop nuget and more setup description to readme --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 469cc38a..7c92ad40 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # Popup Page Plugin for Xamarin Forms [![Build status](https://ci.appveyor.com/api/projects/status/faktrrb31efbqq3x/branch/master?svg=true)](https://ci.appveyor.com/project/Kirill/rg-plugins-popup/branch/master) The plugin allows you to open any page as a popup. -Nuget: https://www.nuget.org/packages/Rg.Plugins.Popup/ [![NuGet](https://img.shields.io/nuget/v/Rg.Plugins.Popup.svg)](https://www.nuget.org/packages/Rg.Plugins.Popup/) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Rg.Plugins.Popup.svg)](https://www.nuget.org/packages/Rg.Plugins.Popup/) +## Setup +* Available on NuGet: https://www.nuget.org/packages/Rg.Plugins.Popup [![NuGet](https://img.shields.io/nuget/v/Rg.Plugins.Popup.svg)](https://www.nuget.org/packages/Rg.Plugins.Popup/) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Rg.Plugins.Popup.svg)](https://www.nuget.org/packages/Rg.Plugins.Popup/) +* Install into your PCL project and Client projects. +* Development NuGet: https://ci.appveyor.com/nuget/rg-plugins-popup-p6l5elugev99 [![Build status](https://ci.appveyor.com/api/projects/status/faktrrb31efbqq3x/branch/develop?svg=true)](https://ci.appveyor.com/project/Kirill/rg-plugins-popup/branch/develop) ![Landing](img/popup-landing.png) From fa8629607e4d824d08b7dea8f365533d54ace9ff Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Tue, 30 Jan 2018 17:17:37 +0400 Subject: [PATCH 12/20] fix(System Animation, Droid): Animation was not played if Animator duration scale was disabled on Android. See #219 #159 --- .../Impl/PopupPlatformDroid.cs | 34 +++++++++++++++ .../Renderers/PopupPageRenderer.cs | 2 +- .../Impl/PopupPlatformIos.cs | 2 + .../Impl/PopupPlatformWinPhone.cs | 2 + .../Contracts/IPopupPlatform.cs | 2 + src/Rg.Plugins.Popup/Pages/PopupPage.cs | 42 +++++++++++++++++-- .../Services/PopupNavigationImpl.cs | 17 ++++++++ 7 files changed, 96 insertions(+), 5 deletions(-) diff --git a/src/Rg.Plugins.Popup.Droid/Impl/PopupPlatformDroid.cs b/src/Rg.Plugins.Popup.Droid/Impl/PopupPlatformDroid.cs index 6ffa68d1..00286257 100644 --- a/src/Rg.Plugins.Popup.Droid/Impl/PopupPlatformDroid.cs +++ b/src/Rg.Plugins.Popup.Droid/Impl/PopupPlatformDroid.cs @@ -2,6 +2,8 @@ using System.Linq; using System.Threading.Tasks; using Android.App; +using Android.OS; +using Android.Provider; using Android.Runtime; using Android.Widget; using Rg.Plugins.Popup.Contracts; @@ -32,6 +34,8 @@ public event EventHandler OnInitialized public bool IsInitialized => Popup.IsInitialized; + public bool IsSystemAnimationEnabled => GetIsSystemAnimationEnabled(); + public async Task AddAsync(PopupPage page) { var decoreView = DecoreView; @@ -122,5 +126,35 @@ private bool OnBackPressed(object sender, EventArgs e) } #endregion + + #region System Animation + + private bool GetIsSystemAnimationEnabled() + { + float animationScale; + var context = Popup.Context; + + if (context == null) + return false; + + if (Build.VERSION.SdkInt >= BuildVersionCodes.JellyBeanMr1) + { + animationScale = Settings.Global.GetFloat( + context.ContentResolver, + Settings.Global.AnimatorDurationScale, + 0); + } + else + { + animationScale = Settings.System.GetFloat( + context.ContentResolver, + Settings.System.AnimatorDurationScale, + 0); + } + + return animationScale > 0; + } + + #endregion } } \ No newline at end of file diff --git a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs index 7a06f51d..7fd7c5ba 100644 --- a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs +++ b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs @@ -189,4 +189,4 @@ private bool IsInRegion(float x, float y, View v) #endregion } -} +} \ No newline at end of file diff --git a/src/Rg.Plugins.Popup.IOS/Impl/PopupPlatformIos.cs b/src/Rg.Plugins.Popup.IOS/Impl/PopupPlatformIos.cs index 73f35757..5e5cc42b 100644 --- a/src/Rg.Plugins.Popup.IOS/Impl/PopupPlatformIos.cs +++ b/src/Rg.Plugins.Popup.IOS/Impl/PopupPlatformIos.cs @@ -28,6 +28,8 @@ public event EventHandler OnInitialized public bool IsInitialized => Popup.IsInitialized; + public bool IsSystemAnimationEnabled => true; + public async Task AddAsync(PopupPage page) { page.Parent = Application.Current.MainPage; diff --git a/src/Rg.Plugins.Popup.WinShared/Impl/PopupPlatformWinPhone.cs b/src/Rg.Plugins.Popup.WinShared/Impl/PopupPlatformWinPhone.cs index aedd491d..503f7a33 100644 --- a/src/Rg.Plugins.Popup.WinShared/Impl/PopupPlatformWinPhone.cs +++ b/src/Rg.Plugins.Popup.WinShared/Impl/PopupPlatformWinPhone.cs @@ -33,6 +33,8 @@ public event EventHandler OnInitialized public bool IsInitialized => Popup.IsInitialized; + public bool IsSystemAnimationEnabled => true; + [Preserve] public PopupPlatformWinPhone() { diff --git a/src/Rg.Plugins.Popup/Contracts/IPopupPlatform.cs b/src/Rg.Plugins.Popup/Contracts/IPopupPlatform.cs index 09938909..5488295c 100644 --- a/src/Rg.Plugins.Popup/Contracts/IPopupPlatform.cs +++ b/src/Rg.Plugins.Popup/Contracts/IPopupPlatform.cs @@ -10,6 +10,8 @@ internal interface IPopupPlatform bool IsInitialized { get; } + bool IsSystemAnimationEnabled { get; } + Task AddAsync(PopupPage page); Task RemoveAsync(PopupPage page); diff --git a/src/Rg.Plugins.Popup/Pages/PopupPage.cs b/src/Rg.Plugins.Popup/Pages/PopupPage.cs index d60d63e8..3e389872 100644 --- a/src/Rg.Plugins.Popup/Pages/PopupPage.cs +++ b/src/Rg.Plugins.Popup/Pages/PopupPage.cs @@ -128,30 +128,64 @@ internal void DisposingAnimation() internal async Task AppearingAnimation() { + OnAppearingAnimationBegin(); + await OnAppearingAnimationBeginAsync(); + if (IsAnimating && Animation != null) await Animation.Appearing(Content, this); - await OnAppearingAnimationEnd(); + OnAppearingAnimationEnd(); + await OnAppearingAnimationEndAsync(); } internal async Task DisappearingAnimation() { - await OnDisappearingAnimationBegin(); + OnDisappearingAnimationBegin(); + await OnDisappearingAnimationBeginAsync(); if (IsAnimating && Animation != null) await Animation.Disappearing(Content, this); + + OnDisappearingAnimationEnd(); + await OnDisappearingAnimationEndAsync(); } #endregion #region Override Animation Methods - protected virtual Task OnAppearingAnimationEnd() + protected virtual void OnAppearingAnimationBegin() + { + } + + protected virtual void OnAppearingAnimationEnd() + { + } + + protected virtual void OnDisappearingAnimationBegin() + { + } + + protected virtual void OnDisappearingAnimationEnd() + { + } + + protected virtual Task OnAppearingAnimationBeginAsync() + { + return Task.FromResult(0); + } + + protected virtual Task OnAppearingAnimationEndAsync() + { + return Task.FromResult(0); + } + + protected virtual Task OnDisappearingAnimationBeginAsync() { return Task.FromResult(0); } - protected virtual Task OnDisappearingAnimationBegin() + protected virtual Task OnDisappearingAnimationEndAsync() { return Task.FromResult(0); } diff --git a/src/Rg.Plugins.Popup/Services/PopupNavigationImpl.cs b/src/Rg.Plugins.Popup/Services/PopupNavigationImpl.cs index 37446be6..de16faf3 100644 --- a/src/Rg.Plugins.Popup/Services/PopupNavigationImpl.cs +++ b/src/Rg.Plugins.Popup/Services/PopupNavigationImpl.cs @@ -43,6 +43,8 @@ private async void OnInitialized(object sender, EventArgs e) public async Task PushAsync(PopupPage page, bool animate = true) { + animate = CanBeAnimated(animate); + if (animate) { page.PreparingAnimation(); @@ -58,6 +60,8 @@ public async Task PushAsync(PopupPage page, bool animate = true) public Task PopAsync(bool animate = true) { + animate = CanBeAnimated(animate); + if (PopupStack.Count == 0) throw new IndexOutOfRangeException("There is not page in PopupStack"); @@ -66,6 +70,8 @@ public Task PopAsync(bool animate = true) public async Task PopAllAsync(bool animate = true) { + animate = CanBeAnimated(animate); + var popupTasks = _popupStack.ToList().Select(page => RemovePageAsync(page, animate)); await Task.WhenAll(popupTasks); @@ -79,6 +85,8 @@ public async Task RemovePageAsync(PopupPage page, bool animate = true) if(page.IsBeingDismissed) return; + animate = CanBeAnimated(animate); + page.IsBeingDismissed = true; if (animate) @@ -116,5 +124,14 @@ internal void RemovePopupFromStack(PopupPage page) if (_popupStack.Contains(page)) _popupStack.Remove(page); } + + #region Animation + + private bool CanBeAnimated(bool animate) + { + return animate && PopupPlatform.IsSystemAnimationEnabled; + } + + #endregion } } From 9f98a5173b1da5b8c2d7bf249b04ce07da5f3be9 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Tue, 30 Jan 2018 17:18:06 +0400 Subject: [PATCH 13/20] feat(Animations, Demo): Updated pages for new animation system --- src/Demo/Demo/Pages/FirstPopupPage.xaml.cs | 9 ++++----- src/Demo/Demo/Pages/LoginPopupPage.xaml.cs | 11 ++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Demo/Demo/Pages/FirstPopupPage.xaml.cs b/src/Demo/Demo/Pages/FirstPopupPage.xaml.cs index 5f598ea5..13ecca8c 100644 --- a/src/Demo/Demo/Pages/FirstPopupPage.xaml.cs +++ b/src/Demo/Demo/Pages/FirstPopupPage.xaml.cs @@ -1,6 +1,5 @@ using System; using System.Threading.Tasks; -using Demo.Animations; using Rg.Plugins.Popup.Pages; using Rg.Plugins.Popup.Services; using Xamarin.Forms; @@ -14,17 +13,17 @@ public FirstPopupPage() InitializeComponent(); } - private void OnClose(object sender, EventArgs e) + private async void OnClose(object sender, EventArgs e) { - PopupNavigation.PopAsync(); + await PopupNavigation.PopAsync(); } - protected override Task OnAppearingAnimationEnd() + protected override Task OnAppearingAnimationEndAsync() { return Content.FadeTo(0.5); } - protected override Task OnDisappearingAnimationBegin() + protected override Task OnDisappearingAnimationBeginAsync() { return Content.FadeTo(1); } diff --git a/src/Demo/Demo/Pages/LoginPopupPage.xaml.cs b/src/Demo/Demo/Pages/LoginPopupPage.xaml.cs index 41b76ea0..58281b04 100644 --- a/src/Demo/Demo/Pages/LoginPopupPage.xaml.cs +++ b/src/Demo/Demo/Pages/LoginPopupPage.xaml.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Rg.Plugins.Popup.Extensions; using Rg.Plugins.Popup.Pages; @@ -16,9 +13,9 @@ public LoginPopupPage() InitializeComponent(); } - protected override void OnAppearing() + protected override void OnAppearingAnimationBegin() { - base.OnAppearing(); + base.OnAppearingAnimationBegin(); FrameContainer.HeightRequest = -1; @@ -33,7 +30,7 @@ protected override void OnAppearing() UsernameEntry.Opacity = PasswordEntry.Opacity = 0; } - protected async override Task OnAppearingAnimationEnd() + protected override async Task OnAppearingAnimationEndAsync() { var translateLength = 400u; @@ -57,7 +54,7 @@ await Task.WhenAll( LoginButton.FadeTo(1)); } - protected async override Task OnDisappearingAnimationBegin() + protected override async Task OnDisappearingAnimationBeginAsync() { var taskSource = new TaskCompletionSource(); From bae5e33204bb14f31a95bda83cc113068b9b2a77 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Tue, 30 Jan 2018 17:39:13 +0400 Subject: [PATCH 14/20] feat(Readme): Update information about PopupPage animation methods --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7c92ad40..229d4d50 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ namespace HelloXamarinFormsWorld.Android base.OnCreate(bundle); Rg.Plugins.Popup.Popup.Init(this, bundle); - + Xamarin.Forms.Forms.Init(this, bundle); LoadApplication (new App ()); } @@ -129,8 +129,8 @@ Xamarin.Forms.Forms.Init(e, Rg.Plugins.Popup.Popup.GetExtraAssemblies()); * BackgroundColor: Hex #80FF5C5C where #80 opacity [Range](http://stackoverflow.com/questions/5445085/understanding-colors-in-android-6-characters/11019879#11019879) * CloseWhenBackgroundIsClicked: Close pop-up when click on the background * HasSystemPadding: Enabled/Disabled system padding offset (Only for Content not for Background) - - ![Android](/icons/system-padding-droid.png) ![Android](/icons/system-padding-ios.png) + + ![Android](/icons/system-padding-droid.png) ![Android](/icons/system-padding-ios.png) * SystemPadding: (ReadOnly) Thickness ## How To Use @@ -192,19 +192,51 @@ public partial class MyPopupPage : PopupPage { base.OnDisappearing(); } - - // Method for animation child in PopupPage - // Invoced after custom animation end - protected override Task OnAppearingAnimationEnd() + + // Methods for support animations of views in your popup page + + // Invoked before an appearing animation + protected override void OnAppearingAnimationBegin() + { + base.OnAppearingAnimationBegin(); + } + + // Invoked after an appearing animation + protected override void OnAppearingAnimationEnd() + { + base.OnAppearingAnimationEnd(); + } + + // Invoked before an disappearing animation + protected override void OnDisappearingAnimationBegin() + { + base.OnDisappearingAnimationBegin(); + } + + // Invoked after an disappearing animation + protected override void OnDisappearingAnimationEnd() + { + base.OnDisappearingAnimationEnd(); + } + + protected override Task OnAppearingAnimationBeginAsync() + { + return base.OnAppearingAnimationBeginAsync(); + } + + protected override Task OnAppearingAnimationEndAsync() + { + return base.OnAppearingAnimationEndAsync(); + } + + protected override Task OnDisappearingAnimationBeginAsync() { - return Content.FadeTo(0.5); + return base.OnDisappearingAnimationBeginAsync(); } - // Method for animation child in PopupPage - // Invoked before custom animation begin - protected override Task OnDisappearingAnimationBegin() + protected override Task OnDisappearingAnimationEndAsync() { - return Content.FadeTo(1); + return base.OnDisappearingAnimationEndAsync(); } protected override bool OnBackButtonPressed() @@ -214,10 +246,10 @@ public partial class MyPopupPage : PopupPage return true; } - // Invoced when background is clicked - protected override bool OnBackgroundClicked() + // Invoced when background is clicked + protected override bool OnBackgroundClicked() { - // Return default value - CloseWhenBackgroundIsClicked + // Return default value - CloseWhenBackgroundIsClicked return base.OnBackgroundClicked(); } } @@ -256,10 +288,10 @@ public partial class MyPopupPage : PopupPage content.Opacity = 0; } - // Call After OnDisappering + // Call After OnDisappering public void Disposing(View content, PopupPage page) { - // Dispose Unmanaged Code + // Dispose Unmanaged Code } // Call After OnAppering From 67146ba24277f78dc5dd2b9786c6857f1c0839ee Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Tue, 30 Jan 2018 18:01:55 +0400 Subject: [PATCH 15/20] refact(Readme): Removed offsets --- README.md | 214 +++++++++++++++++++++++++++--------------------------- 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/README.md b/README.md index 229d4d50..33445567 100644 --- a/README.md +++ b/README.md @@ -177,147 +177,147 @@ Task RemovePageAsync(PopupPage page, bool animate = true) // Navigation.RemovePo ``` ```csharp public partial class MyPopupPage : PopupPage +{ + public MyPopupPage() { - public MyPopupPage() - { - InitializeComponent(); - } + InitializeComponent(); + } - protected override void OnAppearing() - { - base.OnAppearing(); - } + protected override void OnAppearing() + { + base.OnAppearing(); + } - protected override void OnDisappearing() - { - base.OnDisappearing(); - } + protected override void OnDisappearing() + { + base.OnDisappearing(); + } - // Methods for support animations of views in your popup page + // Methods for support animations of views in your popup page - // Invoked before an appearing animation - protected override void OnAppearingAnimationBegin() - { - base.OnAppearingAnimationBegin(); - } + // Invoked before an appearing animation + protected override void OnAppearingAnimationBegin() + { + base.OnAppearingAnimationBegin(); + } - // Invoked after an appearing animation - protected override void OnAppearingAnimationEnd() - { - base.OnAppearingAnimationEnd(); - } + // Invoked after an appearing animation + protected override void OnAppearingAnimationEnd() + { + base.OnAppearingAnimationEnd(); + } - // Invoked before an disappearing animation - protected override void OnDisappearingAnimationBegin() - { - base.OnDisappearingAnimationBegin(); - } + // Invoked before an disappearing animation + protected override void OnDisappearingAnimationBegin() + { + base.OnDisappearingAnimationBegin(); + } - // Invoked after an disappearing animation - protected override void OnDisappearingAnimationEnd() - { - base.OnDisappearingAnimationEnd(); - } + // Invoked after an disappearing animation + protected override void OnDisappearingAnimationEnd() + { + base.OnDisappearingAnimationEnd(); + } - protected override Task OnAppearingAnimationBeginAsync() - { - return base.OnAppearingAnimationBeginAsync(); - } + protected override Task OnAppearingAnimationBeginAsync() + { + return base.OnAppearingAnimationBeginAsync(); + } - protected override Task OnAppearingAnimationEndAsync() - { - return base.OnAppearingAnimationEndAsync(); - } + protected override Task OnAppearingAnimationEndAsync() + { + return base.OnAppearingAnimationEndAsync(); + } - protected override Task OnDisappearingAnimationBeginAsync() - { - return base.OnDisappearingAnimationBeginAsync(); - } + protected override Task OnDisappearingAnimationBeginAsync() + { + return base.OnDisappearingAnimationBeginAsync(); + } - protected override Task OnDisappearingAnimationEndAsync() - { - return base.OnDisappearingAnimationEndAsync(); - } + protected override Task OnDisappearingAnimationEndAsync() + { + return base.OnDisappearingAnimationEndAsync(); + } - protected override bool OnBackButtonPressed() - { - // Prevent hide popup - //return base.OnBackButtonPressed(); - return true; - } + protected override bool OnBackButtonPressed() + { + // Prevent hide popup + //return base.OnBackButtonPressed(); + return true; + } - // Invoced when background is clicked - protected override bool OnBackgroundClicked() - { - // Return default value - CloseWhenBackgroundIsClicked - return base.OnBackgroundClicked(); - } + // Invoced when background is clicked + protected override bool OnBackgroundClicked() + { + // Return default value - CloseWhenBackgroundIsClicked + return base.OnBackgroundClicked(); } +} - // Main Page +// Main Page - public partial class MainPage : ContentPage +public partial class MainPage : ContentPage +{ + public MainPage() { - public MainPage() - { - InitializeComponent(); - } + InitializeComponent(); + } - // Button Click - private async void OnOpenPupup(object sender, EventArgs e) - { - var page = new MyPopupPage(); + // Button Click + private async void OnOpenPupup(object sender, EventArgs e) + { + var page = new MyPopupPage(); - await Navigation.PushPopupAsync(page); - // or - await PopupNavigation.PushAsync(page); - } + await Navigation.PushPopupAsync(page); + // or + await PopupNavigation.PushAsync(page); } +} ``` ## User Animation ```csharp - // User animation - class UserAnimation : IPopupAnimation +// User animation +class UserAnimation : IPopupAnimation +{ + // Call Before OnAppering + public void Preparing(View content, PopupPage page) { - // Call Before OnAppering - public void Preparing(View content, PopupPage page) - { - // Preparing content and page - content.Opacity = 0; - } + // Preparing content and page + content.Opacity = 0; + } - // Call After OnDisappering - public void Disposing(View content, PopupPage page) - { - // Dispose Unmanaged Code - } + // Call After OnDisappering + public void Disposing(View content, PopupPage page) + { + // Dispose Unmanaged Code + } - // Call After OnAppering - public async Task Appearing(View content, PopupPage page) - { - // Show animation - await content.FadeTo(1); - } + // Call After OnAppering + public async Task Appearing(View content, PopupPage page) + { + // Show animation + await content.FadeTo(1); + } - // Call Before OnDisappering - public async Task Disappearing(View content, PopupPage page) - { - // Hide animation - await content.FadeTo(0); - } + // Call Before OnDisappering + public async Task Disappearing(View content, PopupPage page) + { + // Hide animation + await content.FadeTo(0); } +} - // Popup Page - public partial class UserPopupPage : PopupPage +// Popup Page +public partial class UserPopupPage : PopupPage +{ + public SecondPopupPage() { - public SecondPopupPage() - { - InitializeComponent(); - Animation = new UserAnimation(); - } + InitializeComponent(); + Animation = new UserAnimation(); } +} ``` Or in xaml From 41dfcaf325689f3c480b91135e7ae84aeeb0ded3 Mon Sep 17 00:00:00 2001 From: Kirill Date: Tue, 30 Jan 2018 21:43:40 +0400 Subject: [PATCH 16/20] feat(Readme): Added Troubleshooting descriptions --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 33445567..92d72b5d 100644 --- a/README.md +++ b/README.md @@ -336,8 +336,15 @@ Or in xaml ``` -## Thanks +## Troubleshooting + +### Doesn't work/build or etc +* Check if one version of plugin has been installed to an each project with Xamarin.Forms in solution. +* Clean a solution or an each Xamarin.Forms project. +* Close Visual Studio (or VS for Mac or Xamarin Studio or other IDA) and remove an each obj and bin folder in the each project. +* If previous items didn't help, don't hesitate, [create a new issue here](https://github.com/rotorgames/Rg.Plugins.Popup/issues). +## Thanks * [xam-forms-transparent-modal](https://github.com/gaborv/xam-forms-transparent-modal) ## License From cd5a3fbc8e11634403d205502beacd26d02fc356 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Wed, 31 Jan 2018 09:34:08 +0400 Subject: [PATCH 17/20] refact(Context, Renderer, Droid): View.Context is used now --- src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs index 7fd7c5ba..a7070e5c 100644 --- a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs +++ b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs @@ -100,7 +100,7 @@ private Thickness GetSystemPadding() protected override void OnAttachedToWindow() { - Forms.Context.HideKeyboard(((Activity)Forms.Context).Window.DecorView); + Context.HideKeyboard(((Activity) Context).Window.DecorView); base.OnAttachedToWindow(); } @@ -108,7 +108,7 @@ protected override void OnDetachedFromWindow() { Device.StartTimer(TimeSpan.FromMilliseconds(0), () => { - Forms.Context.HideKeyboard(((Activity)Forms.Context).Window.DecorView); + Context.HideKeyboard(((Activity) Context).Window.DecorView); return false; }); base.OnDetachedFromWindow(); From 2038779663f5a06e0180cdcb0d0401034b70bc25 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Wed, 31 Jan 2018 14:46:41 +0400 Subject: [PATCH 18/20] fix(Droid): Popup was crashed after a keyboard hides --- src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs index a7070e5c..1bd47e17 100644 --- a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs +++ b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs @@ -108,7 +108,7 @@ protected override void OnDetachedFromWindow() { Device.StartTimer(TimeSpan.FromMilliseconds(0), () => { - Context.HideKeyboard(((Activity) Context).Window.DecorView); + Popup.Context.HideKeyboard(((Activity) Popup.Context).Window.DecorView); return false; }); base.OnDetachedFromWindow(); From 75620e624cb8801225aa9f8b56e982ded88b71cb Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Wed, 31 Jan 2018 14:49:14 +0400 Subject: [PATCH 19/20] fix(Size, Droid): Optimized layout methods and fixed size of popup was not updated after an application resumed on Android 7+. See #209 --- .../Renderers/PopupPageRenderer.cs | 15 +++++++++++++-- src/Rg.Plugins.Popup/Pages/PopupPage.cs | 7 +++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs index 1bd47e17..ddc1f9a6 100644 --- a/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs +++ b/src/Rg.Plugins.Popup.Droid/Renderers/PopupPageRenderer.cs @@ -62,8 +62,10 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b) var systemPadding = GetSystemPadding(); - CurrentElement.SetSystemPadding(systemPadding); - CurrentElement.Layout(new Rectangle(Context.FromPixels(l), Context.FromPixels(t), Context.FromPixels(r), Context.FromPixels(b))); + CurrentElement.SetSystemPadding(systemPadding, !changed); + + if(changed) + CurrentElement.Layout(new Rectangle(Context.FromPixels(l), Context.FromPixels(t), Context.FromPixels(r), Context.FromPixels(b))); CurrentElement.BatchCommit(); @@ -114,6 +116,15 @@ protected override void OnDetachedFromWindow() base.OnDetachedFromWindow(); } + protected override void OnWindowVisibilityChanged(ViewStates visibility) + { + base.OnWindowVisibilityChanged(visibility); + + // It is needed because a size of popup has not updated on Android 7+. See #209 + if (visibility == ViewStates.Visible) + ForceLayout(); + } + #endregion #region Touch Methods diff --git a/src/Rg.Plugins.Popup/Pages/PopupPage.cs b/src/Rg.Plugins.Popup/Pages/PopupPage.cs index 3e389872..c17eff9e 100644 --- a/src/Rg.Plugins.Popup/Pages/PopupPage.cs +++ b/src/Rg.Plugins.Popup/Pages/PopupPage.cs @@ -214,10 +214,13 @@ internal async void SendBackgroundClick() } } - internal void SetSystemPadding(Thickness systemPadding) + internal void SetSystemPadding(Thickness systemPadding, bool forceLayout = true) { + var systemPaddingWasChanged = SystemPadding != systemPadding; SystemPadding = systemPadding; - ForceLayout(); + + if(systemPaddingWasChanged && forceLayout) + ForceLayout(); } #endregion From 250746a7e3ccd894c44662289813bd326dfc6449 Mon Sep 17 00:00:00 2001 From: Kirill Lyubimov Date: Thu, 1 Feb 2018 09:24:19 +0400 Subject: [PATCH 20/20] version(v1.1.4-beta) --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index db3ee961..165b4d77 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.1.3.{build}-beta +version: 1.1.4.{build}-beta branches: only: - master