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/CellAdapter.cs | |
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/CellAdapter.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/CellAdapter.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Xamarin.Forms.Platform.Android/CellAdapter.cs b/Xamarin.Forms.Platform.Android/CellAdapter.cs index 03957d37..7664834b 100644 --- a/Xamarin.Forms.Platform.Android/CellAdapter.cs +++ b/Xamarin.Forms.Platform.Android/CellAdapter.cs @@ -174,12 +174,10 @@ namespace Xamarin.Forms.Platform.Android view.SetBackgroundResource(0); } - internal void CloseContextAction() + internal void CloseContextActions() { - if (_actionMode != null) - _actionMode.Finish(); - if (_supportActionMode != null) - _supportActionMode.Finish(); + _actionMode?.Finish(); + _supportActionMode?.Finish(); } void CreateContextMenu(IMenu menu) @@ -226,8 +224,7 @@ namespace Xamarin.Forms.Platform.Android { if (!cell.HasContextActions) { - _actionMode?.Finish(); - _supportActionMode?.Finish(); + CloseContextActions(); return false; } |