private void SetUpViewStyle()
        {
            // Config Status segmentedControl
            UITextAttributes attributesForNormalState = new UITextAttributes();

            attributesForNormalState.Font = UIFont.SystemFontOfSize(15f);
            StatusSegmentedControl.SetTitleTextAttributes(attributesForNormalState, UIControlState.Normal);

            // Disable clear button
            ClearFilterButton.Enabled = false;
        }
        void ReleaseDesignerOutlets()
        {
            if (cancelButton != null)
            {
                cancelButton.Dispose();
                cancelButton = null;
            }

            if (ClearFilterButton != null)
            {
                ClearFilterButton.Dispose();
                ClearFilterButton = null;
            }

            if (FromDateTextField != null)
            {
                FromDateTextField.Dispose();
                FromDateTextField = null;
            }

            if (NumberEventTextField != null)
            {
                NumberEventTextField.Dispose();
                NumberEventTextField = null;
            }

            if (saveChangesButton != null)
            {
                saveChangesButton.Dispose();
                saveChangesButton = null;
            }

            if (StatusSegmentedControl != null)
            {
                StatusSegmentedControl.Dispose();
                StatusSegmentedControl = null;
            }

            if (TitleTextField != null)
            {
                TitleTextField.Dispose();
                TitleTextField = null;
            }

            if (ToDateTextField != null)
            {
                ToDateTextField.Dispose();
                ToDateTextField = null;
            }
        }
Exemple #3
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
            DateBeginView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
            DateEndView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            _contentViewExpanded                  = ContentView.AtBottomOf(this);
            _contentViewCollapsedByToolbar        = ContentView.Above(DatePickerToolbar);
            _contentViewCollapsedByToolbar.Active = false;

            this.AddConstraints(
                ContentView.FullWidthOf(this));

            this.AddConstraints(
                ContentView.AtTopOf(this),
                _contentViewExpanded,
                _contentViewCollapsedByToolbar);

            this.AddConstraints(
                VacationsPager.AtTopOf(ContentView, AppDimens.Inset3X),
                VacationsPager.WithSameCenterX(ContentView),
                VacationsPager.WithRelativeHeight(ContentView, 0.3f),
                VacationsPager.WithSameWidth(ContentView));

            this.AddConstraints(
                VacationPageControl.WithSameCenterX(ContentView),
                VacationPageControl.Below(VacationsPager, AppDimens.Inset1X),
                VacationPageControl.WithSameWidth(ContentView),
                VacationPageControl.Height().EqualTo(AppDimens.Inset2X));

            this.AddConstraints(
                AboveDateSeparator.AtLeftOf(ContentView),
                AboveDateSeparator.Below(VacationPageControl, AppDimens.Inset1X),
                AboveDateSeparator.AtRightOf(ContentView),
                AboveDateSeparator.Height().EqualTo(AppDimens.SeparatorSize));

            this.AddConstraints(
                DateBeginView.Below(AboveDateSeparator, AppDimens.Inset1X),
                DateBeginView.AtLeftOf(ContentView),
                DateBeginView.WithRelativeWidth(ContentView, 0.5f),
                DateBeginView.Height().EqualTo(AppDimens.Inset9X));

            this.AddConstraints(
                DateEndView.ToRightOf(DateBeginView),
                DateEndView.Below(AboveDateSeparator),
                DateEndView.WithRelativeWidth(ContentView, 0.5f),
                DateEndView.Height().EqualTo(AppDimens.Inset9X));

            this.AddConstraints(
                BelowDateSeparator.AtLeftOf(ContentView),
                BelowDateSeparator.Below(DateBeginView, AppDimens.Inset1X),
                BelowDateSeparator.AtRightOf(ContentView),
                BelowDateSeparator.Height().EqualTo(AppDimens.SeparatorSize));

            this.AddConstraints(
                StatusSegmentedControl.Below(BelowDateSeparator, AppDimens.Inset4X),
                StatusSegmentedControl.WithSameCenterX(ContentView));

            _toolbarBottom                  = DatePickerToolbar.AtBottomOf(this);
            _toolbarAboveStartPicker        = DatePickerToolbar.Above(StartDatePicker);
            _toolbarAboveStartPicker.Active = false;
            _toolbarAboveEndPicker          = DatePickerToolbar.Above(EndDatePicker);
            _toolbarAboveEndPicker.Active   = false;

            _datePickerToolbarCollapsed       = DatePickerToolbar.Height().EqualTo(0);
            _datePickerToolbarExpanded        = DatePickerToolbar.Height().EqualTo(AppDimens.ToolbarSize);
            _datePickerToolbarExpanded.Active = false;

            this.AddConstraints(
                DatePickerToolbar.AtLeftOf(this),
                DatePickerToolbar.AtRightOf(this),
                _toolbarBottom,
                _toolbarAboveStartPicker,
                _toolbarAboveEndPicker,
                _datePickerToolbarCollapsed,
                _datePickerToolbarExpanded);

            _datePickerStartCollapsed       = StartDatePicker.Height().EqualTo(0);
            _datePickerStartExpanded        = StartDatePicker.Height().EqualTo(AppDimens.DatePickerSize);
            _datePickerStartExpanded.Active = false;

            this.AddConstraints(
                StartDatePicker.AtLeftOf(this),
                StartDatePicker.AtBottomOf(this),
                StartDatePicker.AtRightOf(this),
                _datePickerStartCollapsed,
                _datePickerStartExpanded);

            _datePickerEndCollapsed       = EndDatePicker.Height().EqualTo(0);
            _datePickerEndExpanded        = EndDatePicker.Height().EqualTo(AppDimens.DatePickerSize);
            _datePickerEndExpanded.Active = false;

            this.AddConstraints(
                EndDatePicker.AtLeftOf(this),
                EndDatePicker.AtBottomOf(this),
                EndDatePicker.AtRightOf(this),
                _datePickerEndCollapsed,
                _datePickerEndExpanded);

            this.AddConstraints(
                ActivityIndicator.WithSameCenterX(this),
                ActivityIndicator.WithSameCenterY(this));
        }
        void ReleaseDesignerOutlets()
        {
            if (AttachmentContentView != null)
            {
                AttachmentContentView.Dispose();
                AttachmentContentView = null;
            }

            if (checkButton != null)
            {
                checkButton.Dispose();
                checkButton = null;
            }

            if (ConteinerObservationView != null)
            {
                ConteinerObservationView.Dispose();
                ConteinerObservationView = null;
            }

            if (CreateButton != null)
            {
                CreateButton.Dispose();
                CreateButton = null;
            }

            if (DateTextField != null)
            {
                DateTextField.Dispose();
                DateTextField = null;
            }

            if (DetailTextView != null)
            {
                DetailTextView.Dispose();
                DetailTextView = null;
            }

            if (HeightAttachmentContentConstraint != null)
            {
                HeightAttachmentContentConstraint.Dispose();
                HeightAttachmentContentConstraint = null;
            }

            if (ObservationTextView != null)
            {
                ObservationTextView.Dispose();
                ObservationTextView = null;
            }

            if (PlaceTextField != null)
            {
                PlaceTextField.Dispose();
                PlaceTextField = null;
            }

            if (ReferenceTextField != null)
            {
                ReferenceTextField.Dispose();
                ReferenceTextField = null;
            }

            if (SectionEventTextField != null)
            {
                SectionEventTextField.Dispose();
                SectionEventTextField = null;
            }

            if (StatusConteinerView != null)
            {
                StatusConteinerView.Dispose();
                StatusConteinerView = null;
            }

            if (StatusSegmentedControl != null)
            {
                StatusSegmentedControl.Dispose();
                StatusSegmentedControl = null;
            }

            if (TagTextField != null)
            {
                TagTextField.Dispose();
                TagTextField = null;
            }

            if (TitleTextView != null)
            {
                TitleTextView.Dispose();
                TitleTextView = null;
            }

            if (TopAttachmentContentConstraint != null)
            {
                TopAttachmentContentConstraint.Dispose();
                TopAttachmentContentConstraint = null;
            }

            if (TopCreateButtonConstraint != null)
            {
                TopCreateButtonConstraint.Dispose();
                TopCreateButtonConstraint = null;
            }

            if (TopTagConstraint != null)
            {
                TopTagConstraint.Dispose();
                TopTagConstraint = null;
            }

            if (TypeTextField != null)
            {
                TypeTextField.Dispose();
                TypeTextField = null;
            }

            if (UploadFileButton != null)
            {
                UploadFileButton.Dispose();
                UploadFileButton = null;
            }
        }
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            // TODO
            var halfWidth = UIScreen.MainScreen.Bounds.Width / 2;

            this.AddConstraints(
                VacationsPager.AtLeftOf(this),
                VacationsPager.AtTopOf(this),
                VacationsPager.AtRightOf(this),
                VacationsPager.WithRelativeHeight(this, (nfloat)0.45));

            this.AddConstraints(
                VacationPageControl.AtBottomOf(VacationsPager),
                VacationPageControl.WithSameCenterX(VacationsPager));

            this.AddConstraints(
                AboveDatesSeparator.AtLeftOf(this),
                AboveDatesSeparator.Below(VacationPageControl, AppDimens.Inset1X),
                AboveDatesSeparator.AtRightOf(this),
                AboveDatesSeparator.Height().EqualTo(AppDimens.DefaultSeparatorSize));

            this.AddConstraints(
                StartDayView.AtLeftOf(this),
                StartDayView.Below(AboveDatesSeparator),
                StartDayView.Width().EqualTo(halfWidth));

            this.AddConstraints(
                StartDayLabel.AtLeftOf(StartDayView, AppDimens.Inset1X),
                StartDayLabel.AtTopOf(StartDayView),
                StartDayLabel.AtBottomOf(StartDayView));

            this.AddConstraints(
                StartMonthLabel.ToRightOf(StartDayLabel, AppDimens.InsetHalf),
                StartMonthLabel.AtTopOf(StartDayLabel, AppDimens.Inset1X));

            this.AddConstraints(
                StartYearLabel.WithSameRight(StartMonthLabel),
                StartYearLabel.AtBottomOf(StartDayLabel, AppDimens.Inset1X));

            this.AddConstraints(
                EndDayView.ToRightOf(StartDayView),
                EndDayView.WithSameTop(StartDayView),
                EndDayView.AtRightOf(this),
                EndDayView.WithSameBottom(StartDayView));

            this.AddConstraints(
                EndDayLabel.ToLeftOf(EndMonthLabel, AppDimens.InsetHalf),
                EndDayLabel.WithSameTop(StartDayLabel),
                EndDayLabel.WithSameBottom(StartDayLabel));

            this.AddConstraints(
                EndMonthLabel.AtRightOf(EndDayView, AppDimens.Inset1X),
                EndMonthLabel.WithSameTop(StartMonthLabel));

            this.AddConstraints(
                EndYearLabel.WithSameTop(StartYearLabel),
                EndYearLabel.WithSameRight(EndMonthLabel),
                EndYearLabel.AtBottomOf(EndDayLabel, AppDimens.Inset1X));

            this.AddConstraints(
                BelowDatesSeparator.AtLeftOf(this),
                BelowDatesSeparator.Below(EndDayView),
                BelowDatesSeparator.AtRightOf(this),
                BelowDatesSeparator.Height().EqualTo(AppDimens.DefaultSeparatorSize));

            this.AddConstraints(
                StatusSegmentedControl.Below(BelowDatesSeparator, AppDimens.Inset2X),
                StatusSegmentedControl.WithSameCenterX(this));

            this.AddConstraints(
                VacationStartDatePicker.WithRelativeHeight(this, (nfloat)0.25),
                VacationStartDatePicker.AtBottomOf(this));

            this.AddConstraints(
                VacationEndDatePicker.WithRelativeHeight(this, (nfloat)0.25),
                VacationEndDatePicker.AtBottomOf(this));
        }