From 2e6fc2bdf035cf540888dc804edef134f6cf372a Mon Sep 17 00:00:00 2001 From: Hamp Date: Sat, 31 Aug 2024 12:58:17 +0900 Subject: [PATCH 1/2] =?UTF-8?q?:zap:=20::=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20?= =?UTF-8?q?=EC=9D=B8=EC=85=8B=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Views/MyPlaylistHeaderView.swift | 2 +- .../Views/UnknownPlaylistHeaderView.swift | 69 +++++++++++++------ .../Views/WakmusicPlaylistHeaderView.swift | 2 +- 3 files changed, 50 insertions(+), 23 deletions(-) diff --git a/Projects/Features/PlaylistFeature/Sources/Views/MyPlaylistHeaderView.swift b/Projects/Features/PlaylistFeature/Sources/Views/MyPlaylistHeaderView.swift index ec78c6cb2..8b3a73cf5 100644 --- a/Projects/Features/PlaylistFeature/Sources/Views/MyPlaylistHeaderView.swift +++ b/Projects/Features/PlaylistFeature/Sources/Views/MyPlaylistHeaderView.swift @@ -57,7 +57,7 @@ final class MyPlaylistHeaderView: UIView { let countLabel: WMLabel = WMLabel( text: "", - textColor: DesignSystemAsset.BlueGrayColor.blueGray900.color.withAlphaComponent(0.6), + textColor: DesignSystemAsset.BlueGrayColor.blueGray600.color, font: .t6_1(weight: .light), lineHeight: UIFont.WMFontSystem.t6_1(weight: .light).lineHeight ) diff --git a/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift b/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift index e5d2d4f61..3bd8843e9 100644 --- a/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift +++ b/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift @@ -16,30 +16,47 @@ final class UnknownPlaylistHeaderView: UIView { $0.clipsToBounds = true $0.contentMode = .scaleAspectFill } - - private let containerView: UIView = UIView().then { + + private let scrollView: UIScrollView = UIScrollView().then { $0.backgroundColor = DesignSystemAsset.BlueGrayColor.blueGray25.color.withAlphaComponent(0.4) $0.layer.borderWidth = 1 $0.layer.cornerRadius = 8 $0.layer.borderColor = UIColor.white.cgColor $0.clipsToBounds = true + $0.verticalScrollIndicatorInsets = .init(top: 20, left: .zero, bottom: 12, right: 6) + } + + private let stackView: UIStackView = UIStackView().then { + $0.axis = .vertical } + private let containerView: UIView = UIView() + private let titleLabel: WMLabel = WMLabel( text: "", textColor: DesignSystemAsset.BlueGrayColor.blueGray900.color, font: .t3(weight: .bold), lineHeight: UIFont.WMFontSystem.t3(weight: .bold).lineHeight ).then { - $0.numberOfLines = 0 + $0.numberOfLines = .zero } - let subtitleLabel: WMLabel = WMLabel( + let countLabel: WMLabel = WMLabel( text: "", - textColor: DesignSystemAsset.BlueGrayColor.blueGray900.color.withAlphaComponent(0.6), + textColor: DesignSystemAsset.BlueGrayColor.blueGray600.color, font: .t6_1(weight: .light), lineHeight: UIFont.WMFontSystem.t6_1(weight: .light).lineHeight ) + + let nickNameLabel: WMLabel = WMLabel( + text: "", + textColor: DesignSystemAsset.BlueGrayColor.blueGray600.color, + font: .t6_1(weight: .medium), + lineHeight: UIFont.WMFontSystem.t6(weight: .medium).lineHeight + ).then { + $0.numberOfLines = .zero + } + override init(frame: CGRect) { super.init(frame: frame) @@ -56,8 +73,10 @@ final class UnknownPlaylistHeaderView: UIView { extension UnknownPlaylistHeaderView { private func addView() { - self.addSubviews(thumbnailImageView, containerView) - containerView.addSubviews(titleLabel, subtitleLabel) + self.addSubviews(thumbnailImageView, scrollView) + scrollView.addSubview(stackView) + stackView.addArrangedSubview(containerView) + containerView.addSubviews(titleLabel, countLabel, nickNameLabel) } private func setLayout() { @@ -67,20 +86,36 @@ extension UnknownPlaylistHeaderView { $0.leading.equalToSuperview().inset(20) } - containerView.snp.makeConstraints { + scrollView.snp.makeConstraints { $0.leading.equalTo(thumbnailImageView.snp.trailing).offset(8) - $0.top.bottom.equalToSuperview() + $0.verticalEdges.equalToSuperview() $0.trailing.equalToSuperview().inset(20) } + + stackView.snp.makeConstraints { + $0.verticalEdges.equalToSuperview() + $0.width.equalTo(scrollView.snp.width) + } + + containerView.snp.makeConstraints { + $0.edges.equalToSuperview() + } titleLabel.snp.makeConstraints { $0.top.equalToSuperview().inset(12) $0.horizontalEdges.equalToSuperview().inset(16) } - subtitleLabel.snp.makeConstraints { + countLabel.snp.makeConstraints { $0.top.equalTo(titleLabel.snp.bottom).offset(8) - $0.leading.equalTo(titleLabel.snp.leading) + $0.horizontalEdges.equalTo(titleLabel) + } + + nickNameLabel.snp.makeConstraints { + $0.top.lessThanOrEqualTo(countLabel.snp.bottom).offset(2) + $0.horizontalEdges.equalTo(titleLabel) + $0.bottom.greaterThanOrEqualToSuperview().inset(12) + } } } @@ -89,16 +124,8 @@ extension UnknownPlaylistHeaderView: UnknownPlaylistHeaderStateProtocol { func updateData(_ model: PlaylistDetailHeaderModel) { titleLabel.text = model.title thumbnailImageView.kf.setImage(with: URL(string: model.image)) + countLabel.text = "\(model.songCount)곡" + nickNameLabel.text = model.userName - let attributedString = NSMutableAttributedString(string: "\(model.songCount)곡") - - let padding = NSTextAttachment() - let imageAttachment = NSTextAttachment() - imageAttachment.image = DesignSystemAsset.Playlist.smallGrayDot.image - imageAttachment.bounds = CGRect(x: 0, y: 0, width: 12, height: 12) - attributedString.append(NSAttributedString(attachment: imageAttachment)) - attributedString.append(NSAttributedString(string: model.userName)) - - subtitleLabel.attributedText = attributedString } } diff --git a/Projects/Features/PlaylistFeature/Sources/Views/WakmusicPlaylistHeaderView.swift b/Projects/Features/PlaylistFeature/Sources/Views/WakmusicPlaylistHeaderView.swift index 4d556171d..1b0ac6feb 100644 --- a/Projects/Features/PlaylistFeature/Sources/Views/WakmusicPlaylistHeaderView.swift +++ b/Projects/Features/PlaylistFeature/Sources/Views/WakmusicPlaylistHeaderView.swift @@ -36,7 +36,7 @@ final class WakmusicPlaylistHeaderView: UIView { let subtitleLabel: WMLabel = WMLabel( text: "", - textColor: DesignSystemAsset.BlueGrayColor.blueGray900.color.withAlphaComponent(0.6), + textColor: DesignSystemAsset.BlueGrayColor.blueGray600.color, font: .t6_1(weight: .light), lineHeight: UIFont.WMFontSystem.t6_1(weight: .light).lineHeight ) From ced0e6b8716ef29a52df41e9a7fe18a3f11b30c5 Mon Sep 17 00:00:00 2001 From: yongbeomkwak Date: Sat, 31 Aug 2024 12:58:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Views/UnknownPlaylistHeaderView.swift | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift b/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift index 3bd8843e9..d1d1eb8db 100644 --- a/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift +++ b/Projects/Features/PlaylistFeature/Sources/Views/UnknownPlaylistHeaderView.swift @@ -16,7 +16,7 @@ final class UnknownPlaylistHeaderView: UIView { $0.clipsToBounds = true $0.contentMode = .scaleAspectFill } - + private let scrollView: UIScrollView = UIScrollView().then { $0.backgroundColor = DesignSystemAsset.BlueGrayColor.blueGray25.color.withAlphaComponent(0.4) $0.layer.borderWidth = 1 @@ -25,13 +25,13 @@ final class UnknownPlaylistHeaderView: UIView { $0.clipsToBounds = true $0.verticalScrollIndicatorInsets = .init(top: 20, left: .zero, bottom: 12, right: 6) } - + private let stackView: UIStackView = UIStackView().then { $0.axis = .vertical } private let containerView: UIView = UIView() - + private let titleLabel: WMLabel = WMLabel( text: "", textColor: DesignSystemAsset.BlueGrayColor.blueGray900.color, @@ -47,7 +47,7 @@ final class UnknownPlaylistHeaderView: UIView { font: .t6_1(weight: .light), lineHeight: UIFont.WMFontSystem.t6_1(weight: .light).lineHeight ) - + let nickNameLabel: WMLabel = WMLabel( text: "", textColor: DesignSystemAsset.BlueGrayColor.blueGray600.color, @@ -56,7 +56,6 @@ final class UnknownPlaylistHeaderView: UIView { ).then { $0.numberOfLines = .zero } - override init(frame: CGRect) { super.init(frame: frame) @@ -91,7 +90,7 @@ extension UnknownPlaylistHeaderView { $0.verticalEdges.equalToSuperview() $0.trailing.equalToSuperview().inset(20) } - + stackView.snp.makeConstraints { $0.verticalEdges.equalToSuperview() $0.width.equalTo(scrollView.snp.width) @@ -110,12 +109,11 @@ extension UnknownPlaylistHeaderView { $0.top.equalTo(titleLabel.snp.bottom).offset(8) $0.horizontalEdges.equalTo(titleLabel) } - + nickNameLabel.snp.makeConstraints { $0.top.lessThanOrEqualTo(countLabel.snp.bottom).offset(2) $0.horizontalEdges.equalTo(titleLabel) $0.bottom.greaterThanOrEqualToSuperview().inset(12) - } } } @@ -126,6 +124,5 @@ extension UnknownPlaylistHeaderView: UnknownPlaylistHeaderStateProtocol { thumbnailImageView.kf.setImage(with: URL(string: model.image)) countLabel.text = "\(model.songCount)곡" nickNameLabel.text = model.userName - } }