Ejemplo n.º 1
0
        private void setupTapToEditOnboardingStep()
        {
            tapToEditPopup = PopupWindowFactory.PopupWindowWithText(
                Context,
                Resource.Layout.TooltipWithLeftTopArrow,
                Resource.Id.TooltipText,
                Resource.String.OnboardingTapToEdit);

            editTimeEntryOnboardingStep = new EditTimeEntryOnboardingStep(
                ViewModel.OnboardingStorage, Observable.Return(false));

            var showTapToEditOnboardingStepObservable =
                Observable.CombineLatest(
                    editTimeEntryOnboardingStep.ShouldBeVisible,
                    mainRecyclerViewChangesObservable,
                    ViewModel.SyncProgressState,
                    (shouldShowStep, unit, syncState) => shouldShowStep && syncState == SyncProgress.Synced);

            showTapToEditOnboardingStepObservable
            .Where(shouldShowStep => shouldShowStep)
            .Select(_ => findOldestTimeEntryView())
            .ObserveOn(SynchronizationContext.Current)
            .Subscribe(updateTapToEditOnboardingStep)
            .DisposedBy(DisposeBag);
        }
        private void setupTapToEditOnboardingStep()
        {
            tapToEditPopup = PopupWindowFactory.PopupWindowWithText(
                Context,
                Resource.Layout.TooltipWithLeftTopArrow,
                Resource.Id.TooltipText,
                Shared.Resources.TapToEditIt);

            editTimeEntryOnboardingStep = new EditTimeEntryOnboardingStep(
                ViewModel.OnboardingStorage, Observable.Return(false));

            var showTapToEditOnboardingStepObservable =
                Observable.CombineLatest(
                    editTimeEntryOnboardingStep.ShouldBeVisible,
                    mainRecyclerViewChangesObservable,
                    ViewModel.SyncProgressState,
                    (shouldShowStep, unit, syncState) => shouldShowStep && syncState == SyncProgress.Synced);

            showTapToEditOnboardingStepObservable
            .Where(shouldShowStep => shouldShowStep)
            .Select(_ => findOldestTimeEntryView())
            .ObserveOn(AndroidDependencyContainer.Instance.SchedulerProvider.MainScheduler)
            .Subscribe(updateTapToEditOnboardingStep)
            .DisposedBy(DisposeBag);
        }
Ejemplo n.º 3
0
        private void updateTapToEditPopupWindow(View firstTimeEntry)
        {
            if (editTimeEntryOnboardingStepDisposable != null)
            {
                editTimeEntryOnboardingStepDisposable.Dispose();
                editTimeEntryOnboardingStepDisposable = null;
            }

            if (tapToEditPopup != null)
            {
                tapToEditPopup.Dismiss();
            }

            tapToEditPopup = tapToEditPopup
                             ?? PopupWindowFactory.PopupWindowWithText(
                this,
                Resource.Layout.TooltipWithLeftTopArrow,
                Resource.Id.TooltipText,
                Resource.String.OnboardingTapToEdit);

            var storage = ViewModel.OnboardingStorage;

            editTimeEntryOnboardingStepDisposable = new EditTimeEntryOnboardingStep(storage, Observable.Return(false))
                                                    .ManageDismissableTooltip(
                tapToEditPopup,
                firstTimeEntry,
                (window, view) => PopupOffsets.FromDp(16, -4, this),
                storage);
        }
Ejemplo n.º 4
0
        private void resetOnboardingOnResume()
        {
            projectTooltip = projectTooltip
                             ?? PopupWindowFactory.PopupWindowWithText(
                this,
                Resource.Layout.TooltipWithLeftTopArrow,
                Resource.Id.TooltipText,
                Resource.String.CategorizeWithProjects);

            prepareOnboarding();
        }
Ejemplo n.º 5
0
        protected override void OnResume()
        {
            base.OnResume();

            projectTooltip = projectTooltip
                             ?? PopupWindowFactory.PopupWindowWithText(
                this,
                Resource.Layout.TooltipWithLeftTopArrow,
                Resource.Id.TooltipText,
                Resource.String.CategorizeWithProjects);

            prepareOnboarding();
        }
Ejemplo n.º 6
0
        private void setupSwipeLeftOnboardingStep()
        {
            var shouldBeVisible = Observable.CombineLatest(
                editTimeEntryOnboardingStep.ShouldBeVisible,
                swipeRightOnboardingStep.ShouldBeVisible,
                (editTimeEntryVisible, swipeRightVisible) => !editTimeEntryVisible && !swipeRightVisible
                );

            var showSwipeLeftOnboardingStep = Observable.CombineLatest(
                shouldBeVisible,
                mainRecyclerViewChangesObservable,
                ViewModel.SyncProgressState,
                (shouldShowStep, unit, syncState) => shouldShowStep && syncState == SyncProgress.Synced);

            swipeLeftPopup = PopupWindowFactory.PopupWindowWithText(
                Context,
                Resource.Layout.TooltipWithRightTopArrow,
                Resource.Id.TooltipText,
                Resource.String.OnboardingSwipeLeft);

            swipeLeftOnboardingStep = new SwipeLeftOnboardingStep(shouldBeVisible, timeEntriesCountSubject.AsObservable())
                                      .ToDismissable(nameof(SwipeLeftOnboardingStep), ViewModel.OnboardingStorage);

            swipeLeftOnboardingStep.DismissByTapping(swipeLeftPopup, () =>
            {
                if (swipeLeftOnboardingAnimationStepDisposable != null)
                {
                    swipeLeftOnboardingAnimationStepDisposable.Dispose();
                    swipeLeftOnboardingAnimationStepDisposable = null;
                }
            });

            swipeToDeleteWasUsedDisposable = mainRecyclerAdapter.DeleteTimeEntrySubject
                                             .Subscribe(_ =>
            {
                swipeLeftOnboardingStep.Dismiss();
                swipeToDeleteWasUsedDisposable.Dispose();
                swipeToDeleteWasUsedDisposable = null;
            });

            showSwipeLeftOnboardingStep
            .Where(shouldShowStep => shouldShowStep)
            .Select(_ => findEarliestTimeEntryView())
            .DistinctUntilChanged()
            .ObserveOn(SynchronizationContext.Current)
            .Subscribe(updateSwipeLeftOnboardingStep)
            .DisposedBy(DisposeBag);
        }
        private void setupStartTimeEntryOnboardingStep()
        {
            clearPreviousOnboardingSetup();

            onboardingPopupWindow = PopupWindowFactory.PopupWindowWithText(
                this,
                Resource.Layout.TooltipWithCenteredBottomArrow,
                Resource.Id.TooltipText,
                Resource.String.OnboardingAddProjectOrTag);

            var storage = ViewModel.OnboardingStorage;

            onboardingDisposable = new AddProjectOrTagOnboardingStep(storage, ViewModel.DataSource)
                                   .ManageDismissableTooltip(
                onboardingPopupWindow,
                selectProjectToolbarButton,
                (popup, anchor) => popup.TopHorizontallyCenteredOffsetsTo(anchor, 8),
                storage);
        }
Ejemplo n.º 8
0
        private void setupStartTimeEntryOnboardingStep()
        {
            if (playButtonTooltipPopupWindow == null)
            {
                playButtonTooltipPopupWindow = PopupWindowFactory.PopupWindowWithText(
                    this,
                    Resource.Layout.TooltipWithRightArrow,
                    Resource.Id.TooltipText,
                    Resource.String.OnboardingTapToStartTimer);
            }

            new StartTimeEntryOnboardingStep(ViewModel.OnboardingStorage)
            .ManageDismissableTooltip(
                playButtonTooltipPopupWindow,
                playButton,
                (popup, anchor) => popup.LeftVerticallyCenteredOffsetsTo(anchor, dpExtraRightMargin: 8),
                ViewModel.OnboardingStorage)
            .DisposedBy(DisposeBag);
        }
Ejemplo n.º 9
0
        private void setupStopTimeEntryOnboardingStep()
        {
            if (stopButtonTooltipPopupWindow == null)
            {
                stopButtonTooltipPopupWindow = PopupWindowFactory.PopupWindowWithText(
                    this,
                    Resource.Layout.TooltipWithRightBottomArrow,
                    Resource.Id.TooltipText,
                    Resource.String.OnboardingTapToStopTimer);
            }

            new StopTimeEntryOnboardingStep(ViewModel.OnboardingStorage, ViewModel.IsTimeEntryRunning)
            .ManageDismissableTooltip(
                stopButtonTooltipPopupWindow,
                stopButton,
                (popup, anchor) => popup.TopRightFrom(anchor, dpExtraBottomMargin: 8),
                ViewModel.OnboardingStorage)
            .DisposedBy(DisposeBag);
        }