summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2016-11-29 10:03:53 +0900
committerKangho Hur <kangho.hur@samsung.com>2016-11-29 10:03:53 +0900
commit375d74b21f2ac1e75f9278258e59fd5428a8b9c3 (patch)
tree6dfd5cb8bafcbf266b49ab847500266b9cbbe1f7
parentaca56b3713b65835c91539cf189febc3f9be7024 (diff)
parent44e0344c9749fb6a5df98c7b31e24bc30f8701ba (diff)
downloadxamarin-forms-375d74b21f2ac1e75f9278258e59fd5428a8b9c3.tar.gz
xamarin-forms-375d74b21f2ac1e75f9278258e59fd5428a8b9c3.tar.bz2
xamarin-forms-375d74b21f2ac1e75f9278258e59fd5428a8b9c3.zip
Merge tag 'release-2.3.3' into devel/dotnet
-rw-r--r--.nuspec/Xamarin.Forms.AppLinks.nuspec2
-rw-r--r--.nuspec/Xamarin.Forms.Maps.nuspec2
-rw-r--r--.nuspec/Xamarin.Forms.nuspec2
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs45
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/WindowsSpecific/Page.cs2
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs4
-rw-r--r--Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs4
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailControl.cs7
-rw-r--r--Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs8
-rw-r--r--Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs8
-rw-r--r--Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs71
13 files changed, 120 insertions, 38 deletions
diff --git a/.nuspec/Xamarin.Forms.AppLinks.nuspec b/.nuspec/Xamarin.Forms.AppLinks.nuspec
index 05f679df..8f58428d 100644
--- a/.nuspec/Xamarin.Forms.AppLinks.nuspec
+++ b/.nuspec/Xamarin.Forms.AppLinks.nuspec
@@ -6,7 +6,7 @@
<authors>Xamarin Inc.</authors>
<owners>Xamarin Inc.</owners>
<tags>xamarin forms applinks xamarinforms xamarin.forms</tags>
- <licenseUrl>http://download.xamarin.com/content/licenses/Xamarin.Forms.rtf</licenseUrl>
+ <licenseUrl>http://aka.ms/xamarin-forms-license</licenseUrl>
<iconUrl>http://xamarin.com/content/images/nuget/xamarin.png</iconUrl>
<projectUrl>http://xamarin.com/forms</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
diff --git a/.nuspec/Xamarin.Forms.Maps.nuspec b/.nuspec/Xamarin.Forms.Maps.nuspec
index 7cc93df2..c30e14fe 100644
--- a/.nuspec/Xamarin.Forms.Maps.nuspec
+++ b/.nuspec/Xamarin.Forms.Maps.nuspec
@@ -6,7 +6,7 @@
<authors>Xamarin, Inc.</authors>
<owners>Xamarin, Inc.</owners>
<tags>xamarin forms maps xamarinforms xamarinformsmaps xamarin.forms.maps</tags>
- <licenseUrl>http://download.xamarin.com/content/licenses/Xamarin.Forms.rtf</licenseUrl>
+ <licenseUrl>http://aka.ms/xamarin-forms-license</licenseUrl>
<iconUrl>http://xamarin.com/content/images/nuget/xamarin.png</iconUrl>
<projectUrl>http://xamarin.com/forms</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
diff --git a/.nuspec/Xamarin.Forms.nuspec b/.nuspec/Xamarin.Forms.nuspec
index 72a4e4ac..c82a6ee0 100644
--- a/.nuspec/Xamarin.Forms.nuspec
+++ b/.nuspec/Xamarin.Forms.nuspec
@@ -6,7 +6,7 @@
<authors>Xamarin Inc.</authors>
<owners>Xamarin Inc.</owners>
<tags>xamarin forms xamarinforms xamarin.forms</tags>
- <licenseUrl>http://download.xamarin.com/content/licenses/Xamarin.Forms.rtf</licenseUrl>
+ <licenseUrl>http://aka.ms/xamarin-forms-license</licenseUrl>
<iconUrl>http://xamarin.com/content/images/nuget/xamarin.png</iconUrl>
<projectUrl>http://xamarin.com/forms</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs
new file mode 100644
index 00000000..54fef829
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs
@@ -0,0 +1,45 @@
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 44338, "Tapping off of a cell with an open context action causes a crash in iOS 10", PlatformAffected.iOS)]
+ public class Bugzilla44338 : TestContentPage
+ {
+ protected override void Init()
+ {
+ string[] items = new string[] { "A", "B", "C" };
+ Content = new ListView
+ {
+ ItemsSource = items,
+ ItemTemplate = new DataTemplate(() =>
+ {
+ var label = new Label();
+ label.SetBinding(Label.TextProperty, ".");
+ var view = new ViewCell
+ {
+ View = new StackLayout
+ {
+ Children =
+ {
+ label
+ }
+ }
+ };
+ view.ContextActions.Add(new MenuItem
+ {
+ Text = "Action",
+ Command = new Command(() => DisplayAlert("Alert", "Context Action Pressed", "Close"))
+ });
+ return view;
+ })
+ };
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
index c56e37ea..9abd6ead 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
@@ -125,6 +125,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42519.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44166.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44338.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" />
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/WindowsSpecific/Page.cs b/Xamarin.Forms.Core/PlatformConfiguration/WindowsSpecific/Page.cs
index 59e53b5f..fd9503b1 100644
--- a/Xamarin.Forms.Core/PlatformConfiguration/WindowsSpecific/Page.cs
+++ b/Xamarin.Forms.Core/PlatformConfiguration/WindowsSpecific/Page.cs
@@ -14,7 +14,7 @@ namespace Xamarin.Forms.PlatformConfiguration.WindowsSpecific
public static readonly BindableProperty ToolbarPlacementProperty =
BindableProperty.CreateAttached("ToolbarPlacement", typeof(ToolbarPlacement),
- typeof(Page), ToolbarPlacement.Default);
+ typeof(FormsElement), ToolbarPlacement.Default);
public static ToolbarPlacement GetToolbarPlacement(BindableObject element)
{
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs
index ab2fb61a..794c466e 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs
@@ -126,6 +126,8 @@ namespace Xamarin.Forms.Platform.Android
(application as IApplicationController)?.SetAppIndexingProvider(new AndroidAppIndexProvider(this));
Xamarin.Forms.Application.Current = application;
+ SetSoftInputMode();
+
CheckForAppLink(Intent);
application.PropertyChanged += AppOnPropertyChanged;
@@ -167,8 +169,6 @@ namespace Xamarin.Forms.Platform.Android
SetSupportActionBar(bar);
- SetSoftInputMode();
-
_layout = new ARelativeLayout(BaseContext);
SetContentView(_layout);
diff --git a/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs b/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs
index c8795c6a..0a2397d8 100644
--- a/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs
+++ b/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs
@@ -106,6 +106,8 @@ namespace Xamarin.Forms.Platform.Android
_application = application;
Xamarin.Forms.Application.Current = application;
+ SetSoftInputMode();
+
application.PropertyChanged += AppOnPropertyChanged;
SetMainPage();
@@ -127,8 +129,6 @@ namespace Xamarin.Forms.Platform.Android
base.OnCreate(savedInstanceState);
- SetSoftInputMode();
-
_layout = new LinearLayout(BaseContext);
SetContentView(_layout);
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
index 51f737f8..dddd0ba6 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
@@ -239,6 +239,13 @@ namespace Xamarin.Forms.Platform.UWP
_bottomCommandBarArea = GetTemplateChild("BottomCommandBarArea") as Border;
_topCommandBarArea = GetTemplateChild("TopCommandBarArea") as Border;
+ if (_commandBar != null && _bottomCommandBarArea != null && _topCommandBarArea != null)
+ {
+ // We have to wait for the command bar to load so that it'll be in the control hierarchy
+ // otherwise we can't properly move it to wherever the toolbar is supposed to be
+ _commandBar.Loaded += (sender, args) => UpdateToolbarPlacement();
+ }
+
UpdateToolbarPlacement();
UpdateMode();
diff --git a/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs b/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs
index b06acb1f..68586abc 100644
--- a/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs
+++ b/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs
@@ -77,7 +77,13 @@ namespace Xamarin.Forms.Platform.WinRT
#if WINDOWS_UWP
_bottomCommandBarArea = GetTemplateChild("BottomCommandBarArea") as Border;
_topCommandBarArea = GetTemplateChild("TopCommandBarArea") as Border;
- UpdateToolbarPlacement();
+
+ if (_commandBar != null && _bottomCommandBarArea != null && _topCommandBarArea != null)
+ {
+ // We have to wait for the command bar to load so that it'll be in the control hierarchy
+ // otherwise we can't properly move it to wherever the toolbar is supposed to be
+ _commandBar.Loaded += (sender, args) => UpdateToolbarPlacement();
+ }
#endif
TaskCompletionSource<CommandBar> tcs = _commandBarTcs;
diff --git a/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs b/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs
index 7be51c05..a57b6749 100644
--- a/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs
+++ b/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs
@@ -150,7 +150,13 @@ namespace Xamarin.Forms.Platform.WinRT
#if WINDOWS_UWP
_bottomCommandBarArea = GetTemplateChild("BottomCommandBarArea") as Border;
_topCommandBarArea = GetTemplateChild("TopCommandBarArea") as Border;
- UpdateToolbarPlacement();
+
+ if (_commandBar != null && _bottomCommandBarArea != null && _topCommandBarArea != null)
+ {
+ // We have to wait for the command bar to load so that it'll be in the control hierarchy
+ // otherwise we can't properly move it to wherever the toolbar is supposed to be
+ _commandBar.Loaded += (sender, args) => UpdateToolbarPlacement();
+ }
#endif
TaskCompletionSource<CommandBar> tcs = _commandBarTcs;
diff --git a/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs b/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs
index bc04ede2..14f95a73 100644
--- a/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs
+++ b/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs
@@ -210,7 +210,7 @@ namespace Xamarin.Forms.Platform.iOS
void ClearCloserRecognizer(UIScrollView scrollView)
{
- if (_globalCloser == null)
+ if (_globalCloser == null || _globalCloser.State == UIGestureRecognizerState.Cancelled)
return;
var cell = GetContextCell(scrollView);
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
index fdbd116d..9374c362 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
@@ -95,11 +95,25 @@ namespace Xamarin.Forms.Platform.iOS
return OnPopToRoot(page, animated);
}
+ public override UIViewController[] PopToRootViewController(bool animated)
+ {
+ if (!_ignorePopCall && ViewControllers.Length > 1)
+ RemoveViewControllers(animated);
+
+ return base.PopToRootViewController(animated);
+ }
+
public Task<bool> PopViewAsync(Page page, bool animated = true)
{
return OnPopViewAsync(page, animated);
}
+ public override UIViewController PopViewController(bool animated)
+ {
+ RemoveViewControllers(animated);
+ return base.PopViewController(animated);
+ }
+
public Task<bool> PushPageAsync(Page page, bool animated = true)
{
return OnPushAsync(page, animated);
@@ -489,9 +503,6 @@ namespace Xamarin.Forms.Platform.iOS
// In the future we may want to make RemovePageAsync and deprecate RemovePage to handle cases where Push/Pop is called
// during a remove cycle.
- var parentingVC = target as ParentingViewController;
- if (parentingVC != null)
- parentingVC.IgnorePageBeingRemoved = true;
if (_removeControllers == null)
{
@@ -508,6 +519,36 @@ namespace Xamarin.Forms.Platform.iOS
UpdateLeftBarButtonItem(parentingViewController, page);
}
+ void RemoveViewControllers(bool animated)
+ {
+ var controller = TopViewController as ParentingViewController;
+ if (controller == null || controller.Child == null)
+ return;
+
+ // Gesture in progress, lets not be proactive and just wait for it to finish
+ var count = ViewControllers.Length;
+ var task = GetAppearedOrDisappearedTask(controller.Child);
+ task.ContinueWith(async t =>
+ {
+ // task returns true if the user lets go of the page and is not popped
+ // however at this point the renderer is already off the visual stack so we just need to update the NavigationPage
+ // Also worth noting this task returns on the main thread
+ if (t.Result)
+ return;
+ _ignorePopCall = true;
+ // because iOS will just chain multiple animations together...
+ var removed = count - ViewControllers.Length;
+ for (var i = 0; i < removed; i++)
+ {
+ // lets just pop these suckers off, do not await, the true is there to make this fast
+ await ((INavigationPageController)Element).PopAsyncInner(animated, true);
+ }
+ // because we skip the normal pop process we need to dispose ourselves
+ controller.Dispose();
+ _ignorePopCall = false;
+ }, TaskScheduler.FromCurrentSynchronizationContext());
+ }
+
void UpdateBackgroundColor()
{
var color = Element.BackgroundColor == Color.Default ? Color.White : Element.BackgroundColor;
@@ -747,12 +788,6 @@ namespace Xamarin.Forms.Platform.iOS
}
}
- public bool IgnorePageBeingRemoved
- {
- get;
- set;
- }
-
public event EventHandler Appearing;
public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
@@ -808,24 +843,6 @@ namespace Xamarin.Forms.Platform.iOS
base.ViewWillAppear(animated);
}
- public override async void DidMoveToParentViewController(UIViewController parent)
- {
- //If Parent of our child is already null we removed this using our API
- //If we still have parent and we are removing our render we need to update our navigation
- if (parent == null && !IgnorePageBeingRemoved)
- {
- NavigationRenderer n;
- if (_navigation.TryGetTarget(out n))
- {
- var navController = n.Element as INavigationPageController;
- await navController?.PopAsyncInner(true, true);
- }
-
- }
- base.DidMoveToParentViewController(parent);
-
- }
-
protected override void Dispose(bool disposing)
{
if (disposing)