コード例 #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;
        }
コード例 #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();
        }
コード例 #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;
            }
        }
コード例 #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;
        }
コード例 #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;
                    }
                }
            }
        }
コード例 #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();
        }