-
Notifications
You must be signed in to change notification settings - Fork 57
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: 🎸 [JIRA:HCPSDKFIORIUIKIT-2707] SwiftUI RatingControl Enhancement #794
Changes from all commits
5dbc06e
b7471ff
a6bc4f4
5b5e5bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,3 +339,36 @@ protocol _AvatarsTitleComponent { | |
// sourcery: @ViewBuilder | ||
var avatarsTitle: AttributedString? { get } | ||
} | ||
|
||
// sourcery: BaseComponent | ||
protocol _ReviewCountLabelComponent { | ||
// sourcery: @ViewBuilder | ||
var reviewCountLabel: AttributedString? { get } | ||
} | ||
|
||
// sourcery: BaseComponent | ||
// sourcery: importFrameworks = ["FioriThemeManager"] | ||
protocol _OnStarImageComponent { | ||
/// The image to be used for "On" rating star. | ||
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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) |
||
// sourcery: @ViewBuilder | ||
// sourcery: defaultValue = "FioriIcon.actions.favorite.renderingMode(.template).resizable()" | ||
var onStarImage: Image { get } | ||
} | ||
|
||
// sourcery: BaseComponent | ||
// sourcery: importFrameworks = ["FioriThemeManager"] | ||
protocol _OffStarImageComponent { | ||
//// The image to be used for "Off" rating star. | ||
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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) |
||
// sourcery: @ViewBuilder | ||
// sourcery: defaultValue = "FioriIcon.actions.unfavorite.renderingMode(.template).resizable()" | ||
var offStarImage: Image { get } | ||
} | ||
|
||
// sourcery: BaseComponent | ||
// sourcery: importFrameworks = ["FioriThemeManager"] | ||
protocol _HalfStarImageComponent { | ||
//// The image to be used for "half" rating star. | ||
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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) 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. Orphaned Doc Comment Violation: A doc comment should be attached to a declaration. (orphaned_doc_comment) |
||
// sourcery: @ViewBuilder | ||
// sourcery: defaultValue = "FioriIcon.actions.halfStar.renderingMode(.template).resizable()" | ||
var halfStarImage: Image { get } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import FioriThemeManager | ||
import Foundation | ||
import SwiftUI | ||
|
||
// Base Layout style | ||
public struct HalfStarImageBaseStyle: HalfStarImageStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: HalfStarImageConfiguration) -> some View { | ||
// Add default layout here | ||
configuration.halfStarImage | ||
} | ||
} | ||
|
||
// Default fiori styles | ||
public struct HalfStarImageFioriStyle: HalfStarImageStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: HalfStarImageConfiguration) -> some View { | ||
HalfStarImage(configuration) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import FioriThemeManager | ||
import Foundation | ||
import SwiftUI | ||
|
||
// Base Layout style | ||
public struct OffStarImageBaseStyle: OffStarImageStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: OffStarImageConfiguration) -> some View { | ||
// Add default layout here | ||
configuration.offStarImage | ||
} | ||
} | ||
|
||
// Default fiori styles | ||
public struct OffStarImageFioriStyle: OffStarImageStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: OffStarImageConfiguration) -> some View { | ||
OffStarImage(configuration) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import FioriThemeManager | ||
import Foundation | ||
import SwiftUI | ||
|
||
// Base Layout style | ||
public struct OnStarImageBaseStyle: OnStarImageStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: OnStarImageConfiguration) -> some View { | ||
// Add default layout here | ||
configuration.onStarImage | ||
} | ||
} | ||
|
||
// Default fiori styles | ||
public struct OnStarImageFioriStyle: OnStarImageStyle { | ||
@ViewBuilder | ||
public func makeBody(_ configuration: OnStarImageConfiguration) -> some View { | ||
OnStarImage(configuration) | ||
} | ||
} |
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.
I'd like to use the
Bool
variableisLarge
with the UIKitFUIRatingControl
. By default, it is set tofalse
for the read-only state and alwaystrue
for the editable and disabled states. This approach is more simple to me when a smaller size is needed for the editable or disabled states, or for any new states that may be introduced in the future. For us, this means that we do not need to add too many styles, and for the App team, it makes it easy to understand that there are two sizes for each state.I just want to let you know about the difference between your API and mine. However, I am definitely okay with your implementation for these two new styles here for SWiftUI Rating Control.
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.
@JunSong-SH I was originally using the isLarge property. However, later I removed it to reduce the number of properties. I think there are too many properties already.