-
Notifications
You must be signed in to change notification settings - Fork 0
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 [#50] 투명도 퍼센트에 따른 UI 변경 완료 #53
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ final class MyPageProfileView: UIView { | |
|
||
// MARK: - Properties | ||
|
||
let transparencyValue: Int = -85 | ||
|
||
// MARK: - UI Components | ||
|
||
private let profileImageView: UIImageView = { | ||
|
@@ -39,7 +41,7 @@ final class MyPageProfileView: UIView { | |
|
||
let userIntroduction: UILabel = { | ||
let label = UILabel() | ||
label.setTextWithLineHeight(text: "안녕하세요반가와요우히히안녕하세요반가와요우히히안녕하세요반가와요우히히안녕하세요반가와요우히히히히", lineHeight: 20.adjusted) | ||
label.setTextWithLineHeight(text: "안녕하세요반가와요우히히안녕하세요반가와요우히히안녕하세요반가와요우히히안녕하세요반가와요우히히히히", lineHeight: 20.adjusted, alignment: .center) | ||
label.textColor = .donGray7 | ||
label.textAlignment = .center | ||
label.font = .font(.caption2) | ||
|
@@ -65,14 +67,20 @@ final class MyPageProfileView: UIView { | |
private let emptyTransparencyPercentage: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.image = ImageLiterals.MyPage.emptyPercentage | ||
imageView.contentMode = .scaleAspectFit | ||
imageView.contentMode = .left | ||
imageView.clipsToBounds = true | ||
imageView.layer.cornerRadius = 5.adjusted | ||
imageView.layer.masksToBounds = true | ||
Comment on lines
+70
to
+73
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. p3 |
||
return imageView | ||
}() | ||
|
||
private let fullTransparencyPercentage: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.image = ImageLiterals.MyPage.fullPercentage | ||
imageView.contentMode = .scaleAspectFit | ||
imageView.contentMode = .left | ||
imageView.clipsToBounds = true | ||
imageView.layer.cornerRadius = 5.adjusted | ||
imageView.layer.masksToBounds = true | ||
return imageView | ||
}() | ||
|
||
|
@@ -100,8 +108,6 @@ final class MyPageProfileView: UIView { | |
setUI() | ||
setHierarchy() | ||
setLayout() | ||
setAddTarget() | ||
setRegisterCell() | ||
} | ||
|
||
@available(*, unavailable) | ||
|
@@ -115,6 +121,7 @@ final class MyPageProfileView: UIView { | |
extension MyPageProfileView { | ||
private func setUI() { | ||
self.backgroundColor = .donBlack | ||
self.transparencyLabel.text = "\(self.transparencyValue)%" | ||
} | ||
|
||
private func setHierarchy() { | ||
|
@@ -157,7 +164,7 @@ extension MyPageProfileView { | |
} | ||
|
||
percentageBox.snp.makeConstraints { | ||
$0.trailing.equalToSuperview().inset(16.adjusted) | ||
$0.trailing.equalToSuperview().offset(((CGFloat(self.transparencyValue) * (UIScreen.main.bounds.width - 32.adjusted)) / 100) - 16.adjusted) | ||
$0.bottom.equalTo(fullTransparencyPercentage.snp.top).offset(-4.adjusted) | ||
$0.height.equalTo(28.adjusted) | ||
} | ||
|
@@ -174,26 +181,15 @@ extension MyPageProfileView { | |
} | ||
|
||
fullTransparencyPercentage.snp.makeConstraints { | ||
$0.top.equalTo(userIntroduction.snp.bottom).offset(48.adjusted) | ||
$0.leading.trailing.equalToSuperview().inset(16.adjusted) | ||
$0.height.equalTo(10.adjusted) | ||
$0.top.equalTo(emptyTransparencyPercentage) | ||
$0.leading.equalToSuperview().inset(16.adjusted) | ||
$0.trailing.equalTo(percentageBox.snp.trailing) | ||
$0.height.equalTo(emptyTransparencyPercentage) | ||
} | ||
|
||
transparencyInfoButton.snp.makeConstraints { | ||
$0.top.equalTo(fullTransparencyPercentage.snp.bottom).offset(6.adjusted) | ||
$0.leading.equalTo(fullTransparencyPercentage.snp.leading).offset(-10.adjusted) | ||
} | ||
} | ||
|
||
private func setAddTarget() { | ||
|
||
} | ||
|
||
private func setRegisterCell() { | ||
|
||
} | ||
|
||
private func setDataBind() { | ||
|
||
} | ||
} | ||
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. 아래는 코드 패치에 대한 간단한 코드 리뷰입니다. 버그 위험 및 개선 제안 사항을 환영합니다:
기타 코드 리뷰는 주어진 코드 스니펫에서 파악하기 어렵습니다. 전체 클래스와 관련된 다른 부분도 고려되어야 합니다. |
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.
이 코드 패치는 MyPageViewController 클래스의 setUI() 메서드에 대한 수정입니다.
개선 제안:
버그 위험:
장기적인 버그 위험이나 잠재적인 오류는 보이지 않습니다. 그러나 donBlack 색상이 어떻게 정의되어 있는지, 적합한지 확인해야 합니다.
전반적으로 코드 작성자의 의도와 스타일 가이드를 고려해 적절한 수정이 필요할 수 있습니다.