bool HandleContextMode(AView view, int position) { if (view is EditText || view is TextView || view is SearchView) { return(false); } Cell cell = GetCellForPosition(position); if (cell == null) { return(false); } if (_actionMode != null || _supportActionMode != null) { if (!cell.HasContextActions) { CloseContextActions(); return(false); } ActionModeContext = cell; if (ActionModeContext.IsContextActionsLegacyModeEnabled == false) { _actionModeNeedsUpdates = true; } _actionMode?.Invalidate(); _supportActionMode?.Invalidate(); } else { if (!cell.HasContextActions) { return(false); } ActionModeContext = cell; var appCompatActivity = view.Context as AppCompatActivity; if (appCompatActivity == null) { _actionMode = view.Context.GetActivity().StartActionMode(this); } else { _supportActionMode = appCompatActivity.StartSupportActionMode(this); } } ContextView = view; return(true); }
bool HandleContextMode(AView view, int position) { if (view is EditText || view is TextView || view is SearchView) { return(false); } Cell cell = GetCellForPosition(position); if (cell == null) { return(false); } if (_actionMode != null || _supportActionMode != null) { if (!cell.HasContextActions) { _actionMode?.Finish(); _supportActionMode?.Finish(); return(false); } ActionModeContext = cell; _actionMode?.Invalidate(); _supportActionMode?.Invalidate(); } else { if (!cell.HasContextActions) { return(false); } ActionModeContext = cell; var appCompatActivity = Forms.Context as FormsAppCompatActivity; if (appCompatActivity == null) { _actionMode = ((Activity)Forms.Context).StartActionMode(this); } else { _supportActionMode = appCompatActivity.StartSupportActionMode(this); } } ContextView = view; return(true); }
bool global::Android.Support.V7.View.ActionMode.ICallback.OnPrepareActionMode(global::Android.Support.V7.View.ActionMode mode, IMenu menu) { return(OnPrepareActionModeImpl(menu)); }
void global::Android.Support.V7.View.ActionMode.ICallback.OnDestroyActionMode(global::Android.Support.V7.View.ActionMode mode) { OnDestroyActionModeImpl(); _supportActionMode.Dispose(); _supportActionMode = null; }
bool global::Android.Support.V7.View.ActionMode.ICallback.OnCreateActionMode(global::Android.Support.V7.View.ActionMode mode, IMenu menu) { CreateContextMenu(menu); return(true); }
bool global::Android.Support.V7.View.ActionMode.ICallback.OnActionItemClicked(global::Android.Support.V7.View.ActionMode mode, IMenuItem item) { mode.Menu.Clear(); OnActionItemClickedImpl(item); _supportActionMode?.Finish(); return(true); }