Exemplo n.º 1
0
        void ReleaseDesignerOutlets()
        {
            if (CalendarCollectionView != null)
            {
                CalendarCollectionView.Dispose();
                CalendarCollectionView = null;
            }

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

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

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

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
        public void UpdateContent(int projectId, Action <int> onButtonPress)
        {
            this.projectId      = projectId;
            this.buttonCallback = onButtonPress;

            GetStartedButton.SetTitle(StringResources.projects_ui_get_started_button, UIControlState.Normal);

            GetStartedButton.Layer.BorderWidth = 1.0f;
            GetStartedButton.Layer.BorderColor = Application.MainColour;

            GetStartedButton.TouchUpInside -= ButtonTouched;
            GetStartedButton.TouchUpInside += ButtonTouched;
        }
Exemplo n.º 3
0
        void ReleaseDesignerOutlets()
        {
            if (CalendarCollectionView != null)
            {
                CalendarCollectionView.Dispose();
                CalendarCollectionView = null;
            }

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

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

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

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

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

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

            if (CurrentDateLabel != null)
            {
                CurrentDateLabel.Dispose();
                CurrentDateLabel = null;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            settingsButton.SetImage(UIImage.FromBundle("icSettings"), UIControlState.Normal);

            ViewModel
            .ShouldShowOnboarding
            .FirstAsync()
            .Subscribe(
                shouldShowOnboarding => OnboardingView.Alpha = shouldShowOnboarding ? 1: 0)
            .DisposedBy(DisposeBag);

            this.Bind(ViewModel.ShouldShowOnboarding, OnboardingView.Rx().IsVisibleWithFade());
            this.Bind(GetStartedButton.Rx().Tap(), ViewModel.GetStartedAction);

            var timeService = Mvx.Resolve <ITimeService>();

            dataSource = new CalendarCollectionViewSource(
                CalendarCollectionView,
                ViewModel.Date,
                ViewModel.TimeOfDayFormat,
                ViewModel.CalendarItems);

            layout = new CalendarCollectionViewLayout(timeService, dataSource);

            editItemHelper       = new CalendarCollectionViewEditItemHelper(CalendarCollectionView, dataSource, layout);
            createFromSpanHelper = new CalendarCollectionViewCreateFromSpanHelper(CalendarCollectionView, dataSource, layout);

            CalendarCollectionView.SetCollectionViewLayout(layout, false);
            CalendarCollectionView.Delegate     = dataSource;
            CalendarCollectionView.DataSource   = dataSource;
            CalendarCollectionView.ContentInset = new UIEdgeInsets(20, 0, 20, 0);

            this.Bind(dataSource.ItemTapped, ViewModel.OnItemTapped);
            this.Bind(settingsButton.Rx().Tap(), ViewModel.SelectCalendars);
            this.Bind(editItemHelper.EditCalendarItem, ViewModel.OnUpdateTimeEntry);
            this.Bind(ViewModel.SettingsAreVisible, settingsButton.Rx().IsVisible());
            this.Bind(createFromSpanHelper.CreateFromSpan, ViewModel.OnDurationSelected);

            CalendarCollectionView.LayoutIfNeeded();
            var currentTimeY     = layout.FrameForCurrentTime().Y;
            var scrollPointY     = currentTimeY - View.Frame.Height / 2;
            var currentTimePoint = new CGPoint(0, scrollPointY.Clamp(0, CalendarCollectionView.ContentSize.Height));

            CalendarCollectionView.SetContentOffset(currentTimePoint, false);
        }
Exemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (GetStartedButton != null)
            {
                GetStartedButton.Dispose();
                GetStartedButton = null;
            }

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

            if (CalendarCollectionView != null)
            {
                CalendarCollectionView.Dispose();
                CalendarCollectionView = null;
            }
        }
Exemplo n.º 6
0
        void ReleaseDesignerOutlets()
        {
            if (Description != null)
            {
                Description.Dispose();
                Description = null;
            }

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

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

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

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

            if (Title != null)
            {
                Title.Dispose();
                Title = null;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ExtendedNavbarView.BackgroundColor = NavigationController.NavigationBar.BackgroundColor;
            TimeTrackedTodayLabel.Font         = TimeTrackedTodayLabel.Font.GetMonospacedDigitFont();

            TitleLabel.Text       = Resources.Welcome;
            DescriptionLabel.Text = Resources.CalendarFeatureDescription;
            GetStartedButton.SetTitle(Resources.GetStarted, UIControlState.Normal);

            settingsButton.SetImage(UIImage.FromBundle("icSettings"), UIControlState.Normal);

            ViewModel
            .ShouldShowOnboarding
            .FirstAsync()
            .Subscribe(
                shouldShowOnboarding => OnboardingView.Alpha = shouldShowOnboarding ? 1: 0)
            .DisposedBy(DisposeBag);

            ViewModel.ShouldShowOnboarding
            .Subscribe(OnboardingView.Rx().IsVisibleWithFade())
            .DisposedBy(DisposeBag);

            GetStartedButton.Rx()
            .BindAction(ViewModel.GetStarted)
            .DisposedBy(DisposeBag);

            ViewModel.TimeTrackedToday
            .Subscribe(TimeTrackedTodayLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.CurrentDate
            .Subscribe(CurrentDateLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            dataSource = new CalendarCollectionViewSource(
                timeService,
                CalendarCollectionView,
                ViewModel.TimeOfDayFormat,
                ViewModel.CalendarItems);

            layout = new CalendarCollectionViewLayout(timeService, dataSource);

            editItemHelper       = new CalendarCollectionViewEditItemHelper(CalendarCollectionView, timeService, dataSource, layout);
            createFromSpanHelper = new CalendarCollectionViewCreateFromSpanHelper(CalendarCollectionView, dataSource, layout);
            zoomHelper           = new CalendarCollectionViewZoomHelper(CalendarCollectionView, layout);

            CalendarCollectionView.SetCollectionViewLayout(layout, false);
            CalendarCollectionView.Delegate     = dataSource;
            CalendarCollectionView.DataSource   = dataSource;
            CalendarCollectionView.ContentInset = new UIEdgeInsets(20, 0, 20, 0);

            dataSource.ItemTapped
            .Subscribe(ViewModel.OnItemTapped.Inputs)
            .DisposedBy(DisposeBag);

            settingsButton.Rx()
            .BindAction(ViewModel.SelectCalendars)
            .DisposedBy(DisposeBag);

            editItemHelper.EditCalendarItem
            .Subscribe(ViewModel.OnUpdateTimeEntry.Inputs)
            .DisposedBy(DisposeBag);

            editItemHelper.LongPressCalendarEvent
            .Subscribe(ViewModel.OnCalendarEventLongPressed.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.SettingsAreVisible
            .Subscribe(settingsButton.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            createFromSpanHelper.CreateFromSpan
            .Subscribe(ViewModel.OnDurationSelected.Inputs)
            .DisposedBy(DisposeBag);

            CalendarCollectionView.LayoutIfNeeded();
        }