Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        public LabelCellView(Context context, Cell cell)
            : base(context, cell)
        {
            _valueLabel = new TextView(context)
            {
                Ellipsize = TextUtils.TruncateAt.End,
                Gravity   = GravityFlags.Left,
            };
            _valueLabel.SetSingleLine(true);

            using (var lParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                               ViewGroup.LayoutParams.WrapContent))
            {
                CellContent.AddView(_valueLabel, lParams);
            }

            if (_debugWithColors)
            {
                _valueLabel.Background = _Context.GetDrawable(Android.Resource.Color.HoloRedLight);
            }
        }