diff --git a/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift b/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift index 6a08f73f..9bcb72df 100644 --- a/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift +++ b/Projects/Features/Falling/Src/Subviews/Cell/FallingUserCollectionViewCell.swift @@ -36,7 +36,7 @@ final class FallingUserCollectionViewCell: UserCardViewCollectionViewCell { $0.height.equalTo(32) } - self.showUserCardDimView() + self.showDimView() } override func prepareForReuse() { @@ -66,13 +66,23 @@ final class FallingUserCollectionViewCell: UserCardViewCollectionViewCell { output.timeStart .drive(with: self, onNext: { owner, _ in - owner.hiddenUserCardDimView() + owner.hiddenDimView() }) .disposed(by: disposeBag) output.timeZero .drive(scrollToNextObserver) .disposed(by: disposeBag) + + output.isTimerActive + .drive(with: self) { owner, value in + if value { + owner.hiddenPauseView() + } else { + owner.showPauseView() + } + } + .disposed(by: disposeBag) profileCarouselView.infoButton.rx.tap.asDriver() .scan(true) { lastValue, _ in diff --git a/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift b/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift index 1f751a6f..261fc691 100644 --- a/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift +++ b/Projects/Features/Falling/Src/Subviews/Cell/FallinguserCollectionViewCellModel.swift @@ -132,6 +132,7 @@ final class FallinguserCollectionViewCellModel: ViewModelType { let timeState: Driver let timeStart: Driver let timeZero: Driver + let isTimerActive: Driver } func transform(input: Input) -> Output { @@ -164,12 +165,14 @@ final class FallinguserCollectionViewCellModel: ViewModelType { let timeState = timer.map { TimeState(rawValue: $0) } let timeStart = timer.filter { $0 == 8.0 }.map { _ in } let timeZero = timer.filter { $0 == 0 }.map { _ in } + let isTimerActive = timerActiveTrigger.asDriver(onErrorJustReturn: true) return Output( user: user, timeState: timeState, timeStart: timeStart, - timeZero: timeZero + timeZero: timeZero, + isTimerActive: isTimerActive ) } }