diff options
author | adrianknight89 <adrianknight89@outlook.com> | 2016-12-06 06:14:38 -0600 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-12-06 12:14:38 +0000 |
commit | 10c65d035869fdc587f6ddddc0d472033af61ee6 (patch) | |
tree | 27a0c6fe105daaef87bc7b9120335301d97de828 /Xamarin.Forms.Platform.Android/Renderers | |
parent | 5a2cb89775e4de1fe8b8e1d4b673612e5f41f94a (diff) | |
download | xamarin-forms-10c65d035869fdc587f6ddddc0d472033af61ee6.tar.gz xamarin-forms-10c65d035869fdc587f6ddddc0d472033af61ee6.tar.bz2 xamarin-forms-10c65d035869fdc587f6ddddc0d472033af61ee6.zip |
[Android] Dismiss context menu when view cell is removed (#568)
* close context action when cell is no longer available
* rename method
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers')
-rw-r--r-- | Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs b/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs index 51c603c4..245c3d74 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs @@ -54,9 +54,9 @@ namespace Xamarin.Forms.Platform.Android var platform = _listView.Platform; if (platform.GetType() == typeof(AppCompat.Platform)) - MessagingCenter.Subscribe<AppCompat.Platform>(this, AppCompat.Platform.CloseContextActionsSignalName, p => CloseContextAction()); + MessagingCenter.Subscribe<AppCompat.Platform>(this, AppCompat.Platform.CloseContextActionsSignalName, p => CloseContextActions()); else - MessagingCenter.Subscribe<Platform>(this, Platform.CloseContextActionsSignalName, p => CloseContextAction()); + MessagingCenter.Subscribe<Platform>(this, Platform.CloseContextActionsSignalName, p => CloseContextActions()); } public override int Count @@ -321,7 +321,7 @@ namespace Xamarin.Forms.Platform.Android { if (disposing) { - CloseContextAction(); + CloseContextActions(); var platform = _listView.Platform; if (platform.GetType() == typeof(AppCompat.Platform)) @@ -445,6 +445,9 @@ namespace Xamarin.Forms.Platform.Android void OnDataChanged() { + if (ActionModeContext != null && !TemplatedItemsView.TemplatedItems.Contains(ActionModeContext)) + CloseContextActions(); + if (IsAttachedToWindow) NotifyDataSetChanged(); else |