public EntryCellView(Context context, Cell cell) : base(context, cell) { _editText = new CustomEditText(context) { Focusable = true, ImeOptions = ImeAction.Done, OnFocusChangeListener = this, Ellipsize = TextUtils.TruncateAt.End, ClearFocusAction = DoneEdit, Background = _Context.GetDrawable(Android.Resource.Color.Transparent) }; _editText.SetPadding(0, 0, 0, 0); _editText.SetOnEditorActionListener(this); _editText.SetSingleLine(true); _editText.InputType |= InputTypes.TextFlagNoSuggestions; // Disabled spell check Click += EntryCellView_Click; using (var lParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)) { CellContent.AddView(_editText, lParams); } if (_debugWithColors) { _editText.Background = _Context.GetDrawable(Android.Resource.Color.HoloRedLight); } }
protected override void Dispose(bool disposing) { if (disposing) { Click -= EntryCellView_Click; _editText.RemoveFromParent(); _editText.SetOnEditorActionListener(null); _editText.RemoveTextChangedListener(this); _editText.OnFocusChangeListener = null; _editText.ClearFocusAction = null; _editText.Dispose(); _editText = null; } base.Dispose(disposing); }