Пример #1
0
        public ButtonCellView(Context context, Cell cell) : base(context, cell)
        {
            _Button = new AButton(AndroidContext)
            {
                Focusable = true,
                // Background = new ColorDrawable()
            };
            _Button.Background ??= CreateRippleDrawable();

            _Button.SetSingleLine(false);
            _Button.Ellipsize = null;
            _Button.SetMinLines(1);
            _Button.SetMaxLines(10);

            _Button.SetFocusable(ViewFocusability.FocusableAuto);
            _Button.SetOnClickListener(this);
            _Button.SetOnLongClickListener(this);
            DefaultFontSize  = _Button.TextSize;
            DefaultTextColor = new AColor(_Button.CurrentTextColor);

            this.Add(_Button,
                     0,
                     0,
                     GridSpec.Fill,
                     GridSpec.Fill,
                     Extensions.Layout.Match,
                     Extensions.Layout.Match
                     );
        }
Пример #2
0
        private void Initialize()
        {
            _button = MXContainer.Resolve <Button>(GetType().Name, Context) ?? new Button(Context);
            AddView(_button, new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Fill));
            _button.Gravity = GravityFlags.Center;
            _button.SetPadding(4 * Padding, 2 * Padding, 4 * Padding, 0);
            _button.SetSingleLine(true);
            _button.Ellipsize    = TextUtils.TruncateAt.End;
            _button.TextChanged += TextChanged;

            ForegroundColor = iApp.Instance.Style.TextColor;
        }