Пример #1
0
        protected override void ApplyButton(ButtonPosition position, EButton button)
        {
            switch (position)
            {
            case ButtonPosition.Neutral:
                this.SetButton2Part(button.SetWatchPopupRightStyle());
                break;

            case ButtonPosition.Negative:
                if (_hasAcceptButton)
                {
                    button.BackgroundColor = EColor.Default;
                    this.SetButton1Part(button.SetWatchPopupLeftStyle());
                }
                else
                {
                    button.BackgroundColor = new EColor(0, 47, 66, 255);
                    this.SetButton1Part(button.SetBottomStyle());
                }
                break;

            case ButtonPosition.Positive:
            default:
                // Due to ux limiation, nothing to do
                break;
            }
        }
Пример #2
0
        public WatchDateTimePickerDialog(EvasObject parent) : base(parent)
        {
            this.SetWatchCircleStyle();
            AlignmentX = -1;
            AlignmentY = -1;
            WeightX    = 1.0;
            WeightY    = 1.0;

            _container = new Box(parent)
            {
                AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1
            };
            _container.BackgroundColor = ElmSharp.Color.Blue;
            _container.SetLayoutCallback(OnContainerLayout);

            _datetimeLayout = new DateTimeLayout(parent);
            _surfaceLayout  = new ELayout(parent);

            _container.PackEnd(_datetimeLayout);
            _container.PackEnd(_surfaceLayout);

            _surface = new CircleSurface(_surfaceLayout);

            _picker = new WatchDateTimePicker(parent, _surface);
            _picker.Show();
            _datetimeLayout.SetContent(_picker);

            _doneButton = new Button(parent)
            {
                Text = "Set",
            };
            _doneButton.SetBottomStyle();
            _datetimeLayout.SetBottomButtonPart(_doneButton);
            _doneButton.Clicked += OnDoneClicked;

            ActivateRotaryInteraction();

            _datetimeLayout.Show();
            _surfaceLayout.Show();
            _container.Show();

            SetContent(_container);
            ShowAnimationFinished += OnShowAnimationFinished;
            BackButtonPressed     += OnBackButtonPressed;
        }