private void prepareSwipeGesturesOnboarding(IOnboardingStorage storage) { timeEntriesCountSubject.OnNext(ViewModel.TimeEntriesCount); timeEntriesCountDisposable = ViewModel.WeakSubscribe(() => ViewModel.TimeEntriesCount, onTimeEntriesCountChanged); swipeRightStep = new SwipeRightOnboardingStep(timeEntriesCountSubject.AsObservable()) .ToDismissable(nameof(SwipeRightOnboardingStep), storage); swipeLeftStep = new SwipeLeftOnboardingStep(timeEntriesCountSubject.AsObservable(), swipeRightStep.ShouldBeVisible) .ToDismissable(nameof(SwipeLeftOnboardingStep), storage); swipeLeftStep.DismissByTapping(SwipeLeftBubbleView); swipeLeftOnboardingDisposable = swipeLeftStep.ManageVisibilityOf(SwipeLeftBubbleView); swipeLeftAnimationDisposable = swipeLeftStep.ManageSwipeActionAnimationOf(firstTimeEntry, Direction.Left); swipeRightStep.DismissByTapping(SwipeRightBubbleView); swipeRightOnboardingDisposable = swipeRightStep.ManageVisibilityOf(SwipeRightBubbleView); swipeRightAnimationDisposable = swipeRightStep.ManageSwipeActionAnimationOf(firstTimeEntry, Direction.Right); swipeToContinueWasUsedDisposable = Observable.FromEventPattern(source, nameof(MainTableViewSource.SwipeToContinueWasUsed)) .Subscribe(_ => { swipeRightStep.Dismiss(); swipeToContinueWasUsedDisposable?.Dispose(); swipeToContinueWasUsedDisposable = null; }); updateSwipeDismissGestures(firstTimeEntry); }
private void updateSwipeLeftOnboardingStep(MainLogCellViewHolder lastTimeEntry) { swipeLeftPopup?.Dismiss(); if (lastTimeEntry == null) { return; } if (swipeLeftOnboardingStepDisposable != null) { swipeLeftOnboardingStepDisposable.Dispose(); swipeLeftOnboardingStepDisposable = null; } swipeLeftOnboardingStepDisposable = swipeLeftOnboardingStep .ManageVisibilityOf( visibilityChanged, swipeLeftPopup, lastTimeEntry.ItemView, (window, view) => window.BottomRightOffsetsTo(view, -16, -4)); if (swipeLeftOnboardingAnimationStepDisposable != null) { swipeLeftOnboardingAnimationStepDisposable.Dispose(); swipeLeftOnboardingAnimationStepDisposable = null; } swipeLeftOnboardingAnimationStepDisposable = swipeLeftOnboardingStep .ManageSwipeActionAnimationOf(mainRecyclerView, lastTimeEntry, AnimationSide.Left); }
private void updateSwipeRightOnboardingStep(MainLogCellViewHolder lastTimeEntry) { swipeRightPopup?.Dismiss(); if (lastTimeEntry == null) { return; } if (swipeRightOnboardingStepDisposable != null) { swipeRightOnboardingStepDisposable.Dispose(); swipeRightOnboardingStepDisposable = null; } swipeRightOnboardingStepDisposable = swipeRightOnboardingStep .ManageVisibilityOf( swipeRightPopup, lastTimeEntry.ItemView, (window, view) => PopupOffsets.FromDp(16, -4, this)); if (swipeRightOnboardingAnimationStepDisposable != null) { swipeRightOnboardingAnimationStepDisposable.Dispose(); swipeRightOnboardingAnimationStepDisposable = null; } swipeRightOnboardingAnimationStepDisposable = swipeRightOnboardingStep .ManageSwipeActionAnimationOf(mainRecyclerView, lastTimeEntry, AnimationSide.Right); }
private void prepareSwipeGesturesOnboarding(IOnboardingStorage storage, IObservable <bool> tapToEditStepIsVisible) { var timeEntriesCount = ViewModel.TimeEntriesCount; var swipeRightCanBeShown = UIDevice.CurrentDevice.CheckSystemVersion(11, 0) ? tapToEditStepIsVisible.Select(isVisible => !isVisible) : Observable.Return(false); swipeRightStep = new SwipeRightOnboardingStep(swipeRightCanBeShown, timeEntriesCount) .ToDismissable(nameof(SwipeRightOnboardingStep), storage); var swipeLeftCanBeShown = Observable.CombineLatest( tapToEditStepIsVisible, swipeRightStep.ShouldBeVisible, (tapToEditIsVisible, swipeRightIsVisble) => !tapToEditIsVisible && !swipeRightIsVisble); swipeLeftStep = new SwipeLeftOnboardingStep(swipeLeftCanBeShown, timeEntriesCount) .ToDismissable(nameof(SwipeLeftOnboardingStep), storage); swipeLeftStep.DismissByTapping(SwipeLeftBubbleView); swipeLeftStep.ManageVisibilityOf(SwipeLeftBubbleView).DisposedBy(disposeBag); swipeLeftAnimationDisposable = swipeLeftStep.ManageSwipeActionAnimationOf(firstTimeEntryCell, Direction.Left); swipeRightStep.DismissByTapping(SwipeRightBubbleView); swipeRightStep.ManageVisibilityOf(SwipeRightBubbleView).DisposedBy(disposeBag); swipeRightAnimationDisposable = swipeRightStep.ManageSwipeActionAnimationOf(firstTimeEntryCell, Direction.Right); updateSwipeDismissGestures(firstTimeEntryCell); }
private void prepareSwipeGesturesOnboarding(IOnboardingStorage storage, IObservable <bool> tapToEditStepIsVisible) { timeEntriesCountSubject.OnNext(ViewModel.TimeEntriesCount); timeEntriesCountDisposable = ViewModel.WeakSubscribe(() => ViewModel.TimeEntriesCount, onTimeEntriesCountChanged); var swipeRightCanBeShown = UIDevice.CurrentDevice.CheckSystemVersion(11, 0) ? tapToEditStepIsVisible.Select(isVisible => !isVisible) : Observable.Return(false); swipeRightStep = new SwipeRightOnboardingStep(swipeRightCanBeShown, timeEntriesCountSubject.AsObservable()) .ToDismissable(nameof(SwipeRightOnboardingStep), storage); var swipeLeftCanBeShown = Observable.CombineLatest( tapToEditStepIsVisible, swipeRightStep.ShouldBeVisible, (tapToEditIsVisible, swipeRightIsVisble) => !tapToEditIsVisible && !swipeRightIsVisble); swipeLeftStep = new SwipeLeftOnboardingStep(swipeLeftCanBeShown, timeEntriesCountSubject.AsObservable()) .ToDismissable(nameof(SwipeLeftOnboardingStep), storage); swipeLeftStep.DismissByTapping(SwipeLeftBubbleView); swipeLeftOnboardingDisposable = swipeLeftStep.ManageVisibilityOf(SwipeLeftBubbleView); swipeLeftAnimationDisposable = swipeLeftStep.ManageSwipeActionAnimationOf(firstTimeEntry, Direction.Left); swipeRightStep.DismissByTapping(SwipeRightBubbleView); swipeRightOnboardingDisposable = swipeRightStep.ManageVisibilityOf(SwipeRightBubbleView); swipeRightAnimationDisposable = swipeRightStep.ManageSwipeActionAnimationOf(firstTimeEntry, Direction.Right); swipeToContinueWasUsedDisposable = Observable.FromEventPattern(source, nameof(MainTableViewSource.SwipeToContinueWasUsed)) .VoidSubscribe(() => { swipeRightStep.Dismiss(); swipeToContinueWasUsedDisposable?.Dispose(); swipeToContinueWasUsedDisposable = null; }); swipeToDeleteWasUsedDisposable = Observable.FromEventPattern(source, nameof(MainTableViewSource.SwipeToDeleteWasUsed)) .VoidSubscribe(() => { swipeLeftStep.Dismiss(); swipeToDeleteWasUsedDisposable?.Dispose(); swipeToDeleteWasUsedDisposable = null; }); updateSwipeDismissGestures(firstTimeEntry); }
private void prepareOnboarding() { var storage = ViewModel.OnboardingStorage; var timelineIsEmpty = ViewModel.LogEmpty; new StartTimeEntryOnboardingStep(storage) .ManageDismissableTooltip(StartTimeEntryOnboardingBubbleView, storage) .DisposedBy(disposeBag); new StopTimeEntryOnboardingStep(storage, ViewModel.IsTimeEntryRunning) .ManageDismissableTooltip(StopTimeEntryOnboardingBubbleView, storage) .DisposedBy(disposeBag); tapToEditStep = new EditTimeEntryOnboardingStep(storage, timelineIsEmpty) .ToDismissable(nameof(EditTimeEntryOnboardingStep), storage); tapToEditStep.DismissByTapping(TapToEditBubbleView); tapToEditStep.ManageVisibilityOf(TapToEditBubbleView).DisposedBy(disposeBag); }
private void prepareOnboarding() { var storage = ViewModel.OnboardingStorage; isRunningSubject.OnNext(ViewModel.CurrentTimeEntryId.HasValue); isEmptySubject.OnNext(ViewModel.IsLogEmpty); isEmptyDisposable = ViewModel.WeakSubscribe(() => ViewModel.IsLogEmpty, onEmptyChanged); startButtonOnboardingDisposable = new StartTimeEntryOnboardingStep(storage) .ManageDismissableTooltip(StartTimeEntryOnboardingBubbleView, storage); stopButtonOnboardingDisposable = new StopTimeEntryOnboardingStep(storage, isRunningSubject.AsObservable()) .ManageDismissableTooltip(StopTimeEntryOnboardingBubbleView, storage); tapToEditStep = new EditTimeEntryOnboardingStep(storage, isEmptySubject.AsObservable()) .ToDismissable(nameof(EditTimeEntryOnboardingStep), storage); tapToEditStep.DismissByTapping(TapToEditBubbleView); tapToEditDisposable = tapToEditStep.ManageVisibilityOf(TapToEditBubbleView); prepareSwipeGesturesOnboarding(storage, tapToEditStep.ShouldBeVisible); scrollDisposable = tapToEditStep.ShouldBeVisible .CombineLatest( swipeLeftStep.ShouldBeVisible, swipeRightStep.ShouldBeVisible, (tapToEdit, swipeLeft, swipeRight) => tapToEdit || swipeLeft || swipeRight) .ObserveOn(SynchronizationContext.Current) .Subscribe(onScrollableTooltipsVisibilityChanged); firstTimeEntryDisposable = source.FirstTimeEntry .Where(nextFirstTimeEntry => nextFirstTimeEntry != firstTimeEntry) .ObserveOn(SynchronizationContext.Current) .Subscribe(onFirstTimeEntryChanged); ViewModel.NavigationService.AfterNavigate += onNavigate; }
private void prepareOnboarding() { var storage = ViewModel.OnboardingStorage; var timelineIsEmpty = Observable.CombineLatest( tableViewSource.FirstCell.Select(cell => cell == null), ViewModel.LogEmpty, CommonFunctions.Or); new StartTimeEntryOnboardingStep(storage) .ManageDismissableTooltip(StartTimeEntryOnboardingBubbleView, storage) .DisposedBy(disposeBag); new StopTimeEntryOnboardingStep(storage, ViewModel.IsTimeEntryRunning) .ManageDismissableTooltip(StopTimeEntryOnboardingBubbleView, storage) .DisposedBy(disposeBag); tapToEditStep = new EditTimeEntryOnboardingStep(storage, timelineIsEmpty) .ToDismissable(nameof(EditTimeEntryOnboardingStep), storage); tapToEditStep.DismissByTapping(TapToEditBubbleView); tapToEditStep.ManageVisibilityOf(TapToEditBubbleView).DisposedBy(disposeBag); }
private void prepareOnboarding() { var storage = ViewModel.OnboardingStorage; var timelineIsEmpty = ViewModel.LogEmpty; new StartTimeEntryOnboardingStep(storage) .ManageDismissableTooltip(StartTimeEntryOnboardingBubbleView, storage) .DisposedBy(disposeBag); new StopTimeEntryOnboardingStep(storage, ViewModel.IsTimeEntryRunning) .ManageDismissableTooltip(StopTimeEntryOnboardingBubbleView, storage) .DisposedBy(disposeBag); tapToEditStep = new EditTimeEntryOnboardingStep(storage, timelineIsEmpty) .ToDismissable(nameof(EditTimeEntryOnboardingStep), storage); tapToEditStep.DismissByTapping(TapToEditBubbleView); tapToEditStep.ManageVisibilityOf(TapToEditBubbleView).DisposedBy(disposeBag); prepareSwipeGesturesOnboarding(storage, tapToEditStep.ShouldBeVisible); ViewModel.NavigationService.AfterNavigate += onNavigate; }