mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-09 13:54:37 +00:00
[ios] refactor search modes switching
For the expanded iphone mode (in portait) only the searchEverywhere will be used For the halfscreen everywhere + viewport For the iPad the everywhere + viewport is always enabled For the hidden only the viewport Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
6d093a45cf
commit
4cf5ec3c86
@@ -77,7 +77,7 @@ final class ModalPresentationStepsController {
|
||||
}
|
||||
|
||||
let animation: PresentationStepChangeAnimation = abs(velocity.y) > Constants.slowSwipeVelocity ? .slideAndBounce : .slide
|
||||
setStep(nextStep, animation: animation, notifyAboutStepUpdate: true)
|
||||
setStep(nextStep, animation: animation)
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -86,27 +86,23 @@ final class ModalPresentationStepsController {
|
||||
func setStep(_ step: ModalPresentationStep,
|
||||
completion: (() -> Void)? = nil) {
|
||||
guard currentStep != step else { return }
|
||||
setStep(step, animation: .slide, notifyAboutStepUpdate: false, completion: completion)
|
||||
setStep(step, animation: .slide, completion: completion)
|
||||
}
|
||||
|
||||
private func setStep(_ step: ModalPresentationStep,
|
||||
animation: PresentationStepChangeAnimation,
|
||||
notifyAboutStepUpdate: Bool = true,
|
||||
completion: (() -> Void)? = nil) {
|
||||
guard let presentedView else { return }
|
||||
currentStep = step
|
||||
updateMaxAvailableFrame()
|
||||
|
||||
let frame = frame(for: step)
|
||||
didUpdateHandler?(.didUpdateStep(step))
|
||||
didUpdateHandler?(.didUpdateFrame(frame))
|
||||
|
||||
ModalPresentationAnimator.animate(with: animation) {
|
||||
presentedView.frame = frame
|
||||
} completion: { [weak self] _ in
|
||||
guard let self else { return }
|
||||
if notifyAboutStepUpdate {
|
||||
self.didUpdateHandler?(.didUpdateStep(step))
|
||||
}
|
||||
} completion: { _ in
|
||||
completion?()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user