-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [FC-0047] Full-Bleed Header + Top Navigation #385
Merged
volodymyr-chekyrta
merged 14 commits into
openedx:develop
from
raccoongang:feat/FC_47_add_course_home_header
Apr 23, 2024
Merged
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1e5fd7e
feat: add course home header and upgrade ScrollSlidingTabBar
IvanStepanok 734bd54
feat: remove old ui components from config file
IvanStepanok cf24267
feat: code review
IvanStepanok 9ceed72
test: add org value to CourseStructure models
IvanStepanok e107933
style: adjust code formatting for consistency
IvanStepanok 9484891
feat: update collapsing logic to TopHeaderView
IvanStepanok c1a999d
feat: add new icons and remove deprecated ones. Rename course to home
IvanStepanok 2dfcbd3
Merge branch 'develop' into feat/FC_47_add_course_home_header
IvanStepanok b8409f3
fix: correct missing commas in tests
IvanStepanok f3c0839
Merge branch 'develop' into feat/FC_47_add_course_home_header
IvanStepanok e70d42f
fix: enhance UI consistency and resolve multiple bugs following produ…
IvanStepanok 624a4a8
feat: fixes after code review
IvanStepanok 8aad98f
feat: fixes after @forgotvas code review
IvanStepanok 7f3c285
fix: move back button to default position
IvanStepanok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,57 @@ | ||
// | ||
// ResponsiveView.swift | ||
// Core | ||
// | ||
// Created by Stepanok Ivan on 26.03.2024. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct ResponsiveView: View { | ||
|
||
private let padHeight: CGFloat = 290 | ||
private let collapsedHorizontalHeight: CGFloat = 120 | ||
private let collapsedVerticalHeight: CGFloat = 90 | ||
private let expandedHeight: CGFloat = 240 | ||
private let coordinateBoundaryLower: CGFloat = -115 | ||
private let coordinateBoundaryUpper: CGFloat = 40 | ||
|
||
@Binding private var coordinate: CGFloat | ||
@Binding private var collapsed: Bool | ||
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom } | ||
@Environment(\.isHorizontal) private var isHorizontal | ||
|
||
public init(coordinate: Binding<CGFloat>, collapsed: Binding<Bool>) { | ||
self._coordinate = coordinate | ||
self._collapsed = collapsed | ||
} | ||
|
||
public var body: some View { | ||
VStack { | ||
}.frame( | ||
height: idiom == .pad | ||
? padHeight | ||
: (collapsed ? ( isHorizontal ? collapsedHorizontalHeight : collapsedVerticalHeight) : expandedHeight) | ||
) | ||
.overlay( | ||
GeometryReader { geometry -> Color in | ||
guard idiom != .pad else { | ||
return Color.clear | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Color is redundant, you can directly use .clear. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Fixed |
||
} | ||
guard !isHorizontal else { | ||
coordinate = coordinateBoundaryLower | ||
return Color.clear | ||
} | ||
DispatchQueue.main.async { | ||
let minY = geometry.frame(in: .global).minY | ||
if minY >= coordinateBoundaryLower && minY <= coordinateBoundaryUpper { | ||
coordinate = minY | ||
} else if minY <= coordinateBoundaryLower { | ||
coordinate = coordinateBoundaryLower | ||
} | ||
} | ||
return Color.clear | ||
} | ||
) | ||
} | ||
} |
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,21 @@ | ||
// | ||
// VisualEffectView.swift | ||
// Core | ||
// | ||
// Created by Stepanok Ivan on 29.03.2024. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct VisualEffectView: UIViewRepresentable { | ||
private var effect: UIVisualEffect? | ||
|
||
public init(effect: UIVisualEffect? = nil) { | ||
self.effect = effect | ||
} | ||
|
||
public func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView { UIVisualEffectView() } | ||
public func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) { | ||
uiView.effect = effect | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to give it a meaningful name as every view is by default responsive view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to DynamicOffsetView. Good?