Skip to content

Commit 379818f

Browse files
committed
Adjust setup flow animation duration
1 parent f890e4a commit 379818f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetup.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ private struct AnimatedTransitionContainer<Content: View, ID: Equatable>: View {
161161
var body: some View {
162162
visibleContent
163163
.opacity(isVisible ? 1 : 0)
164-
.animation(.easeInOut(duration: animationDuration), value: isVisible)
165164
// First layout pass: constrain content to let scrollView in content to configure itself
166165
.frame(width: maxWidth)
167166
.frame(maxHeight: maxHeight)
@@ -189,15 +188,15 @@ private struct AnimatedTransitionContainer<Content: View, ID: Equatable>: View {
189188
guard newID != previousID else { return }
190189

191190
if hasAppeared {
192-
withAnimation {
191+
withAnimation(.easeInOut(duration: animationDuration / 2)) {
193192
isVisible = false
194193
}
195194

196-
DispatchQueue.main.asyncAfter(deadline: .now() + animationDuration) {
195+
DispatchQueue.main.asyncAfter(deadline: .now() + animationDuration / 2) {
197196
visibleContent = contentBuilder()
198197
previousID = newID
199198

200-
withAnimation {
199+
withAnimation(.easeInOut(duration: animationDuration)) {
201200
isVisible = true
202201
}
203202
}

0 commit comments

Comments
 (0)