diff --git a/Projects/Domains/UserDomain/Interface/Entity/PlaylistEntity.swift b/Projects/Domains/UserDomain/Interface/Entity/PlaylistEntity.swift index 2468db8bf..023dcd975 100644 --- a/Projects/Domains/UserDomain/Interface/Entity/PlaylistEntity.swift +++ b/Projects/Domains/UserDomain/Interface/Entity/PlaylistEntity.swift @@ -8,11 +8,13 @@ public struct PlaylistEntity: Equatable { image: String, songCount: Int, userId: String, + private: Bool, isSelected: Bool = false ) { self.key = key self.title = title self.image = image + self.private = `private` self.isSelected = isSelected self.songCount = songCount self.userId = userId @@ -20,5 +22,5 @@ public struct PlaylistEntity: Equatable { public let key, title, image, userId: String public let songCount: Int - public var isSelected: Bool + public var `private`, isSelected: Bool } diff --git a/Projects/Domains/UserDomain/Sources/ResponseDTO/PlaylistResponseDTO.swift b/Projects/Domains/UserDomain/Sources/ResponseDTO/PlaylistResponseDTO.swift index 249d42c2f..4250207fe 100644 --- a/Projects/Domains/UserDomain/Sources/ResponseDTO/PlaylistResponseDTO.swift +++ b/Projects/Domains/UserDomain/Sources/ResponseDTO/PlaylistResponseDTO.swift @@ -16,6 +16,7 @@ public struct PlaylistResponseDTO: Decodable { public let user: PlaylistResponseDTO.User public let imageUrl: String public let songCount: Int + public let `private`: Bool public struct User: Decodable { public let handle: String @@ -30,7 +31,8 @@ public extension PlaylistResponseDTO { title: title, image: imageUrl, songCount: songCount, - userId: user.handle + userId: user.handle, + private: `private` ) } } diff --git a/Projects/Domains/UserDomain/Testing/FetchPlaylistUseCaseStub.swift b/Projects/Domains/UserDomain/Testing/FetchPlaylistUseCaseStub.swift index 530fe9e9f..eb31b2137 100644 --- a/Projects/Domains/UserDomain/Testing/FetchPlaylistUseCaseStub.swift +++ b/Projects/Domains/UserDomain/Testing/FetchPlaylistUseCaseStub.swift @@ -4,15 +4,36 @@ import UserDomainInterface public struct FetchPlaylistUseCaseStub: FetchPlaylistUseCase { let items: [PlaylistEntity] = [ - .init(key: "123", title: "우중충한 장마철 여름에 듣기 좋은 일본 시티팝 플레이리스트", image: "", songCount: 0, userId: ""), - .init(key: "1234", title: "비내리는 도시, 세련된 무드 감각적인 팝송☔️ 분위기 있는 노래 모음", image: "", songCount: 1, userId: ""), - .init(key: "1424", title: "[𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭] 여름 밤, 퇴근길에 꽂는 플레이리스트🚃", image: "", songCount: 200, userId: ""), + .init( + key: "123", + title: "우중충한 장마철 여름에 듣기 좋은 일본 시티팝 플레이리스트", + image: "", + songCount: 0, + userId: "", + private: true + ), + .init( + key: "1234", + title: "비내리는 도시, 세련된 무드 감각적인 팝송☔️ 분위기 있는 노래 모음", + image: "", + songCount: 1, + userId: "", + private: true + ), + .init( + key: "1424", + title: "[𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭] 여름 밤, 퇴근길에 꽂는 플레이리스트🚃", + image: "", + songCount: 200, + userId: "", + private: false + ), .init( key: "1324", title: "𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭 벌써 여름이야? 내 방을 청량한 캘리포니아 해변으로 신나는 여름 팝송 𝐒𝐮𝐦𝐦𝐞𝐫 𝐢𝐬 𝐜𝐨𝐦𝐢𝐧𝐠 🌴", image: "", songCount: 1000, - userId: "" + userId: "", private: true ) ] diff --git a/Projects/Features/PlaylistFeature/Sources/Reactors/MyPlaylistDetailReactor.swift b/Projects/Features/PlaylistFeature/Sources/Reactors/MyPlaylistDetailReactor.swift index a667feaf6..b20103107 100644 --- a/Projects/Features/PlaylistFeature/Sources/Reactors/MyPlaylistDetailReactor.swift +++ b/Projects/Features/PlaylistFeature/Sources/Reactors/MyPlaylistDetailReactor.swift @@ -347,7 +347,8 @@ private extension MyPlaylistDetailReactor { return updateTitleAndPrivateUseCase.execute(key: key, title: nil, isPrivate: prev.private) .andThen(.concat([ .just(.updateHeader(prev)), - .just(.showToast(message)) + .just(.showToast(message)), + .just(.postNotification(.shouldRefreshPlaylist)) ])) .catch { error in diff --git a/Projects/Features/StorageFeature/Sources/Views/ListStorageTableViewCell.swift b/Projects/Features/StorageFeature/Sources/Views/ListStorageTableViewCell.swift index 9e8657257..b24e9adf8 100644 --- a/Projects/Features/StorageFeature/Sources/Views/ListStorageTableViewCell.swift +++ b/Projects/Features/StorageFeature/Sources/Views/ListStorageTableViewCell.swift @@ -35,12 +35,6 @@ class ListStorageTableViewCell: UITableViewCell { $0.lineBreakMode = .byTruncatingTail } - private let countLabel = WMLabel( - text: "", - textColor: DesignSystemAsset.BlueGrayColor.blueGray300.color, - font: .t7(weight: .light), - kernValue: -0.5 - ) private let verticalStackView = UIStackView().then { $0.axis = .vertical } @@ -57,6 +51,20 @@ class ListStorageTableViewCell: UITableViewCell { ) } + private let lockImageView: UIImageView = UIImageView().then { + $0.image = DesignSystemAsset.Storage.storageClose.image + $0.isHidden = true + } + + private let countLabel = WMLabel( + text: "", + textColor: DesignSystemAsset.BlueGrayColor.blueGray300.color, + font: .t7(weight: .light), + kernValue: -0.5 + ) + + private let countContainerView: UIView = UIView() + private let cellSelectButton = UIButton() private let listSelectButton = UIButton() @@ -85,10 +93,8 @@ extension ListStorageTableViewCell { cellSelectButton, listSelectButton ) - verticalStackView.addArrangedSubviews( - nameLabel, - countLabel - ) + verticalStackView.addArrangedSubviews(nameLabel, countContainerView) + countContainerView.addSubviews(countLabel, lockImageView) } func setLayout() { @@ -128,6 +134,14 @@ extension ListStorageTableViewCell { countLabel.snp.makeConstraints { $0.height.equalTo(18) + $0.top.bottom.equalToSuperview() + $0.leading.equalToSuperview() + } + + lockImageView.snp.makeConstraints { + $0.leading.equalTo(countLabel.snp.trailing) + $0.width.height.equalTo(16) + $0.bottom.equalToSuperview().offset(-1) } } @@ -160,6 +174,7 @@ extension ListStorageTableViewCell { self.cellSelectButton.isHidden = !isEditing self.listSelectButton.isHidden = isEditing self.playButton.isHidden = isEditing + self.lockImageView.isHidden = !model.private self.playButton.snp.updateConstraints { $0.right.equalToSuperview().inset(isEditing ? -24 : 20) diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/Contents.json b/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/Contents.json new file mode 100644 index 000000000..0bf04a3c9 --- /dev/null +++ b/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_16_close@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_16_close@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/ic_16_close@2x.png b/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/ic_16_close@2x.png new file mode 100644 index 000000000..9d6d046cd Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/ic_16_close@2x.png differ diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/ic_16_close@3x.png b/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/ic_16_close@3x.png new file mode 100644 index 000000000..9f71e86af Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Image/Storage.xcassets/storage_close.imageset/ic_16_close@3x.png differ