diff options
author | Paul DiPietro <pauldipietro@users.noreply.github.com> | 2016-08-03 03:50:31 -0500 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-08-03 09:50:31 +0100 |
commit | 23614ca8c6cc78cb2b1df91977fd539a9fa159df (patch) | |
tree | 15b7712a80444ac76c19d8802d1b9cd32065d056 /Xamarin.Forms.Controls.Issues | |
parent | a0611515e4bf9bb98b149047202ab27a032f259b (diff) | |
download | xamarin-forms-23614ca8c6cc78cb2b1df91977fd539a9fa159df.tar.gz xamarin-forms-23614ca8c6cc78cb2b1df91977fd539a9fa159df.tar.bz2 xamarin-forms-23614ca8c6cc78cb2b1df91977fd539a9fa159df.zip |
[Android] Fix ListView contextual actions not closing in AppCompat's NavigationPage/TabbedPage (#272)
* [Android] Fix ListView contextual actions not closing upon navigation in AppCompat
The Platform type in the ListViewAdapter was being treated as the
non-AppCompat type, and the NavAnimationInProgress value was not
being set as necessary in the NavigationPageRenderer.
* [Android] Add fix for TabbedPage swipes not closing contextual actions
Similar fix where swiping to another tab with the context menu open would
not close it. Relies on the prior commit.
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
3 files changed, 122 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40824.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40824.cs new file mode 100644 index 00000000..09b853e1 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40824.cs @@ -0,0 +1,57 @@ +using System; + +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Collections.Generic; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 40824, "ListView item's contextual action menu not being closed upon navigation in AppCompat")] + public class Bugzilla40824 : TestContentPage + { + protected override void Init() + { + var list = new ListView + { + ItemsSource = new List<string> + { + "Cat", + "Dog", + "Rat" + }, + ItemTemplate = new DataTemplate(() => + { + var cell = new TextCell(); + cell.SetBinding(TextCell.TextProperty, "."); + cell.ContextActions.Add(new MenuItem + { + Text = "Action", + Icon = "icon", + IsDestructive = true, + Command = new Command(() => DisplayAlert("TITLE", "Context action invoked", "Ok")), + }); + return cell; + }), + }; + + Content = new StackLayout + { + Children = + { + new Button + { + Text = "Go to next page", + Command = new Command(() => Navigation.PushAsync(new ContentPage { Title = "Next Page", Content = new Label { Text = "Here" } })) + }, + list + } + }; + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42364.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42364.cs new file mode 100644 index 00000000..2d85e315 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42364.cs @@ -0,0 +1,63 @@ +using System; + +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Collections.Generic; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 42364, "ListView item's contextual action menu not being closed upon swiping a TabbedPage in AppCompat")] + public class Bugzilla42354 : TestTabbedPage + { + protected override void Init() + { + var list = new ListView + { + ItemsSource = new List<string> + { + "Cat", + "Dog", + "Rat" + }, + ItemTemplate = new DataTemplate(() => + { + var cell = new TextCell(); + cell.SetBinding(TextCell.TextProperty, "."); + cell.ContextActions.Add(new MenuItem + { + Text = "Action", + Icon = "icon", + IsDestructive = true, + Command = new Command(() => DisplayAlert("TITLE", "Context action invoked", "Ok")), + }); + return cell; + }), + }; + + Children.Add(new ContentPage + { + Title = "Page One", + Content = new StackLayout + { + Children = + { + new Button + { + Text = "Go to next page", + Command = new Command(() => Navigation.PushAsync(new ContentPage { Title = "Next Page", Content = new Label { Text = "Here" } })) + }, + list + } + } + }); + + Children.Add(new ContentPage { Title = "Page Two" }); + } + } +}
\ 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 67bfb32f..f9aeff69 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 @@ -105,6 +105,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40333.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla31806.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40858.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40824.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40955.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla41078.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40998.cs" /> @@ -118,6 +119,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42074.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42075.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42329.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42364.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" /> |