-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#26] Add Survey Detail with navigation
- Loading branch information
Showing
28 changed files
with
509 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Constants+Animation.swift | ||
// Survey | ||
// | ||
// Created by Bliss on 6/1/23. | ||
// Copyright © 2023 Nimble. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension Animation { | ||
|
||
/// ease in 500 ms | ||
static var easeInViewTransition: Self { .easeIn(duration: .viewTransition) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
iosApp/Survey/Sources/Presentation/Coordinator/RouterCoordinator+WithoutAnimation.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// RouterCoordinator+WithoutAnimation.swift | ||
// Survey | ||
// | ||
// Created by Bliss on 6/1/23. | ||
// Copyright © 2023 Nimble. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension RouteCoordinator { | ||
|
||
func withoutAnimation(action: @escaping () -> Void) { | ||
var transaction = Transaction() | ||
transaction.disablesAnimations = true | ||
withTransaction(transaction) { | ||
action() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
iosApp/Survey/Sources/Presentation/Coordinator/Screens/ScreenParameters.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// ScreenParameters.swift | ||
// Survey | ||
// | ||
// Created by Bliss on 6/1/23. | ||
// Copyright © 2023 Nimble. All rights reserved. | ||
// | ||
|
||
import Shared | ||
|
||
enum ScreenParameters { | ||
|
||
struct SurveyDetail { | ||
|
||
let survey: SurveyUiModel | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
iosApp/Survey/Sources/Presentation/Modules/SurveyDetail/SurveyDetailImage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// SurveyDetailImage.swift | ||
// Survey | ||
// | ||
// Created by Bliss on 6/1/23. | ||
// Copyright © 2023 Nimble. All rights reserved. | ||
// | ||
|
||
import Shared | ||
import SwiftUI | ||
|
||
struct SurveyDetailImage: View { | ||
|
||
@Binding var isAnimating: Bool | ||
|
||
let survey: SurveyUiModel | ||
let scaleEffect = 1.42 | ||
|
||
var body: some View { | ||
ZStack { | ||
|
||
GeometryReader { geometry in | ||
Image.url(survey.largeImageUrl) | ||
.resizable() | ||
.aspectRatio(contentMode: .fill) | ||
.frame(width: geometry.size.width, height: geometry.size.height) | ||
.scaleEffect(isAnimating ? 1.0 : scaleEffect, anchor: .topTrailing) | ||
.accessibility(.surveyDetail(.mainImage)) | ||
} | ||
.ignoresSafeArea() | ||
|
||
SurveyItemOverlayView() | ||
.ignoresSafeArea() | ||
} | ||
.accessibilityElement(children: .contain) | ||
} | ||
} |
Oops, something went wrong.