summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-10-23 13:47:06 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 13:52:29 +0900
commitdb4c712c0b6aa849badb9ce6d557c0019e575d01 (patch)
treea1d051c629c7210e1e0f77c23156b274931d0117 /Xamarin.Forms.Platform.MacOS
parent1a7c36737dcbe6b2fc516cb72d9f3921b18c324a (diff)
downloadxamarin-forms-db4c712c0b6aa849badb9ce6d557c0019e575d01.tar.gz
xamarin-forms-db4c712c0b6aa849badb9ce6d557c0019e575d01.tar.bz2
xamarin-forms-db4c712c0b6aa849badb9ce6d557c0019e575d01.zip
force sync with upstream 2.4.0-sr2
Change-Id: I36f0de33d03e804afd17f7ab2c60ae6f435ec402
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS')
-rw-r--r--Xamarin.Forms.Platform.MacOS/Platform.cs12
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs33
-rw-r--r--Xamarin.Forms.Platform.MacOS/Renderers/ScrollViewRenderer.cs1
3 files changed, 4 insertions, 42 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/Platform.cs b/Xamarin.Forms.Platform.MacOS/Platform.cs
index f936a320..7e853ac4 100644
--- a/Xamarin.Forms.Platform.MacOS/Platform.cs
+++ b/Xamarin.Forms.Platform.MacOS/Platform.cs
@@ -43,17 +43,7 @@ namespace Xamarin.Forms.Platform.MacOS
var alert = NSAlert.WithMessage(arguments.Title, arguments.Cancel, arguments.Destruction, null, "");
if (arguments.Buttons != null)
{
- int maxScrollHeight = (int)(0.6 * NSScreen.MainScreen.Frame.Height);
- NSView extraButtons = GetExtraButton(arguments);
- if (extraButtons.Frame.Height > maxScrollHeight) {
- NSScrollView scrollView = new NSScrollView();
- scrollView.Frame = new RectangleF(0, 0, extraButtons.Frame.Width, maxScrollHeight);
- scrollView.DocumentView = extraButtons;
- scrollView.HasVerticalScroller = true;
- alert.AccessoryView = scrollView;
- } else {
- alert.AccessoryView = extraButtons;
- }
+ alert.AccessoryView = GetExtraButton(arguments);
alert.Layout();
}
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs
index 595de47d..50957746 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/NavigationPageRenderer.cs
@@ -7,7 +7,6 @@ using AppKit;
using CoreAnimation;
using Foundation;
using Xamarin.Forms.Internals;
-using Xamarin.Forms.PlatformConfiguration.macOSSpecific;
namespace Xamarin.Forms.Platform.MacOS
{
@@ -264,30 +263,6 @@ namespace Xamarin.Forms.Platform.MacOS
}
}
- NSViewControllerTransitionOptions ToViewControllerTransitionOptions(NavigationTransitionStyle transitionStyle)
- {
- switch (transitionStyle)
- {
- case NavigationTransitionStyle.Crossfade:
- return NSViewControllerTransitionOptions.Crossfade;
- case NavigationTransitionStyle.SlideBackward:
- return NSViewControllerTransitionOptions.SlideBackward;
- case NavigationTransitionStyle.SlideDown:
- return NSViewControllerTransitionOptions.SlideDown;
- case NavigationTransitionStyle.SlideForward:
- return NSViewControllerTransitionOptions.SlideForward;
- case NavigationTransitionStyle.SlideLeft:
- return NSViewControllerTransitionOptions.SlideLeft;
- case NavigationTransitionStyle.SlideRight:
- return NSViewControllerTransitionOptions.SlideRight;
- case NavigationTransitionStyle.SlideUp:
- return NSViewControllerTransitionOptions.SlideUp;
-
- default:
- return NSViewControllerTransitionOptions.None;
- }
- }
-
async Task<bool> PopPageAsync(Page page, bool animated)
{
if (page == null)
@@ -306,10 +281,8 @@ namespace Xamarin.Forms.Platform.MacOS
if (animated)
{
var previousPageRenderer = Platform.GetRenderer(previousPage);
- var transitionStyle = NavigationPage.OnThisPlatform().GetNavigationTransitionPopStyle();
-
return await this.HandleAsyncAnimation(target.ViewController, previousPageRenderer.ViewController,
- ToViewControllerTransitionOptions(transitionStyle), () => Platform.DisposeRendererAndChildren(target), true);
+ NSViewControllerTransitionOptions.SlideBackward, () => Platform.DisposeRendererAndChildren(target), true);
}
RemovePage(page, false);
@@ -340,10 +313,8 @@ namespace Xamarin.Forms.Platform.MacOS
}
var vco = Platform.GetRenderer(oldPage);
AddChildViewController(vc.ViewController);
-
- var transitionStyle = NavigationPage.OnThisPlatform().GetNavigationTransitionPushStyle();
return await this.HandleAsyncAnimation(vco.ViewController, vc.ViewController,
- ToViewControllerTransitionOptions(transitionStyle), () => page?.SendAppearing(), true);
+ NSViewControllerTransitionOptions.SlideForward, () => page?.SendAppearing(), true);
}
void UpdateBackgroundColor()
diff --git a/Xamarin.Forms.Platform.MacOS/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.MacOS/Renderers/ScrollViewRenderer.cs
index 42cbec13..ee3af812 100644
--- a/Xamarin.Forms.Platform.MacOS/Renderers/ScrollViewRenderer.cs
+++ b/Xamarin.Forms.Platform.MacOS/Renderers/ScrollViewRenderer.cs
@@ -195,6 +195,7 @@ namespace Xamarin.Forms.Platform.MacOS
return;
ContentView.Frame = new RectangleF(ContentView.Frame.X, ContentView.Frame.Y, Frame.Width, Frame.Height);
+ ResetNativeNonScroll();
}
private bool ResetNativeNonScroll( )