Exemplo n.º 1
0
        protected override void UpdateCaptionDisplay(View cell)
        {
            if (cell == null)
            {
                return;
            }

            View     _rawToggleButton;
            TextView _caption;
            TextView _subCaption;

            DroidResources.DecodeBooleanElementLayout(Context, cell, out _caption, out _subCaption, out _rawToggleButton);
            _caption.Text = Caption;
        }
Exemplo n.º 2
0
        public override void Selected()
        {
            if (CurrentAttachedCell == null)
            {
                // how did this happen?!
                return;
            }

            View     _rawToggleButton;
            TextView _caption;
            TextView _subCaption;

            DroidResources.DecodeBooleanElementLayout(Context, CurrentAttachedCell, out _caption, out _subCaption, out _rawToggleButton);
            var _toggleButton = _rawToggleButton as ToggleButton;

            _toggleButton?.Toggle();
        }
Exemplo n.º 3
0
        protected override void UpdateCaptionDisplay(View cell)
        {
            if (cell == null)
            {
                return;
            }

            TextView _caption;
            TextView _subCaption;
            View     _rawCheckboxView;

            DroidResources.DecodeBooleanElementLayout(Context, cell, out _caption, out _subCaption, out _rawCheckboxView);
            _caption.Text = Caption;

            if (_subCaption != null)
            {
                _subCaption.Text = SubCaption;
            }
        }
Exemplo n.º 4
0
        protected override void UpdateDetailDisplay(View cell)
        {
            if (cell == null)
            {
                return;
            }

            TextView _caption;
            TextView _subCaption;
            View     _rawCheckboxView;

            DroidResources.DecodeBooleanElementLayout(Context, cell, out _caption, out _subCaption, out _rawCheckboxView);

            var _checkbox = (CheckBox)_rawCheckboxView;

            _checkbox.SetOnCheckedChangeListener(null);
            _checkbox.Checked = Value;
            _checkbox.SetOnCheckedChangeListener(this);
            _checkbox.Clickable = !ReadOnly;
        }
Exemplo n.º 5
0
        protected override void UpdateDetailDisplay(View cell)
        {
            if (cell == null)
            {
                return;
            }

            View     _rawToggleButton;
            TextView _caption;
            TextView _subCaption;

            DroidResources.DecodeBooleanElementLayout(Context, cell, out _caption, out _subCaption, out _rawToggleButton);
            var _toggleButton = _rawToggleButton as ToggleButton;

            if (_toggleButton != null)
            {
                _toggleButton.SetOnCheckedChangeListener(null);
                _toggleButton.Checked = Value;
                _toggleButton.SetOnCheckedChangeListener(this);

                if (TextOff != null)
                {
                    _toggleButton.TextOff = TextOff;
                    if (!Value)
                    {
                        _toggleButton.Text = TextOff;
                    }
                }

                if (TextOn != null)
                {
                    _toggleButton.TextOn = TextOn;
                    if (Value)
                    {
                        _toggleButton.Text = TextOn;
                    }
                }
            }
        }
Exemplo n.º 6
0
        public override void Selected()
        {
            if (ReadOnly)
            {
                return;
            }

            if (CurrentAttachedCell == null)
            {
                // how on earth did this happen!
                return;
            }

            TextView _caption;
            TextView _subCaption;
            View     _rawCheckboxView;

            DroidResources.DecodeBooleanElementLayout(Context, CurrentAttachedCell, out _caption, out _subCaption,
                                                      out _rawCheckboxView);

            var _checkbox = (CheckBox)_rawCheckboxView;

            _checkbox.Toggle();
        }