예제 #1
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;

            if (disposing)
            {
                if (Control != null)
                {
                    Control.SetOnClickListener(null);
                    Control.SetOnTouchListener(null);
                    Control.RemoveOnAttachStateChangeListener(this);
                    _textColorSwitcher = null;
                }
                _backgroundTracker?.Dispose();
                _backgroundTracker = null;
                _buttonLayoutManager?.Dispose();
                _buttonLayoutManager = null;
            }

            base.Dispose(disposing);
        }
예제 #2
0
 public MaterialButtonRenderer()
 {
     _buttonLayoutManager = new ButtonLayoutManager(this,
                                                    preserveInitialPadding: true,
                                                    spacingAdjustsPadding: false,
                                                    borderAdjustsPadding: false,
                                                    collapseHorizontalPadding: true);
 }
        public MaterialButtonRenderer()
        {
            VisualElement.VerifyVisualFlagEnabled();

            _buttonLayoutManager = new ButtonLayoutManager(this,
                                                           preserveInitialPadding: true,
                                                           spacingAdjustsPadding: false,
                                                           borderAdjustsPadding: false,
                                                           collapseHorizontalPadding: true);
        }
    public void setUpButtons(float forwardAngle)
    {
        buttonLayoutManager = new ButtonLayoutManager(this);

        for (int i = 0; i < Button.Length; i++)
        {
            Button[i].GetComponent <ButtonInfo>().setSphereUI(this.gameObject);
        }

        float radius = this.transform.localScale.x / 2.0f;

        buttonLayoutManager.setUp(ButtonLength, radius, forwardAngle);
    }
        public MaterialButtonRenderer(Context context, BindableObject element)
            : base(MaterialContextThemeWrapper.Create(context))
        {
            _automationPropertiesProvider = new AutomationPropertiesProvider(this);
            _buttonLayoutManager          = new ButtonLayoutManager(this,
                                                                    alignIconWithText: true,
                                                                    preserveInitialPadding: true,
                                                                    borderAdjustsPadding: false,
                                                                    maintainLegacyMeasurements: false);

            SoundEffectsEnabled = false;
            SetOnClickListener(this);
            SetOnTouchListener(this);
            AddOnAttachStateChangeListener(this);
            OnFocusChangeListener = this;

            Tag = this;
        }
예제 #6
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (Control != null)
            {
                Control.TouchUpInside -= OnButtonTouchUpInside;
                Control.TouchDown     -= OnButtonTouchDown;
                _buttonLayoutManager?.Dispose();
                _buttonLayoutManager = null;
            }

            _isDisposed = true;

            base.Dispose(disposing);
        }
예제 #7
0
        public MaterialButtonRenderer(Context context)
            : base(new ContextThemeWrapper(context, Resource.Style.XamarinFormsMaterialTheme))
        {
            VisualElement.VerifyVisualFlagEnabled();

            _automationPropertiesProvider = new AutomationPropertiesProvider(this);
            _buttonLayoutManager          = new ButtonLayoutManager(this,
                                                                    alignIconWithText: true,
                                                                    preserveInitialPadding: true,
                                                                    borderAdjustsPadding: false,
                                                                    maintainLegacyMeasurements: false);

            SoundEffectsEnabled = false;
            SetOnClickListener(this);
            SetOnTouchListener(this);
            AddOnAttachStateChangeListener(this);
            OnFocusChangeListener = this;

            Tag = this;
        }
예제 #8
0
 public ButtonRenderer()
 {
     AutoPackage          = false;
     _backgroundTracker   = new BorderBackgroundManager(this);
     _buttonLayoutManager = new ButtonLayoutManager(this);
 }