Skip to content

Commit

Permalink
Merge pull request #1255 from wakmusic/1252-hide-songs-count-label
Browse files Browse the repository at this point in the history
🔀 :: (#1252) 곡 담기 blur 처리
  • Loading branch information
yongbeomkwak authored Aug 30, 2024
2 parents 451344c + 9411970 commit 14c6463
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 39 deletions.
33 changes: 2 additions & 31 deletions Projects/Features/BaseFeature/Resources/Base.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -152,32 +152,8 @@
<constraint firstAttribute="height" constant="48" id="kg9-Lq-V5o"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="41h-1D-tTT">
<rect key="frame" x="20" y="123" width="353" height="24"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UdW-23-cte">
<rect key="frame" x="0.0" y="2" width="20.666666666666668" height="20.333333333333332"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="곡 선택" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jOU-YU-z2H">
<rect key="frame" x="20.666666666666668" y="2" width="48.666666666666657" height="20.333333333333332"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="jOU-YU-z2H" firstAttribute="leading" secondItem="UdW-23-cte" secondAttribute="trailing" id="53a-ai-dXQ"/>
<constraint firstItem="jOU-YU-z2H" firstAttribute="centerY" secondItem="41h-1D-tTT" secondAttribute="centerY" id="5xm-wY-bsk"/>
<constraint firstItem="UdW-23-cte" firstAttribute="centerY" secondItem="41h-1D-tTT" secondAttribute="centerY" id="8PJ-tX-in6"/>
<constraint firstItem="UdW-23-cte" firstAttribute="leading" secondItem="41h-1D-tTT" secondAttribute="leading" id="9Kc-mc-3at"/>
<constraint firstAttribute="height" constant="24" id="LtX-df-vOP"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="6pV-f7-nxC">
<rect key="frame" x="0.0" y="159" width="393" height="693"/>
<rect key="frame" x="0.0" y="107" width="393" height="745"/>
<color key="backgroundColor" name="gray100"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="CurrentPlaylistTableViewCell" rowHeight="60" id="PfK-35-YMP" customClass="CurrentPlaylistTableViewCell" customModule="BaseFeature">
Expand Down Expand Up @@ -266,25 +242,20 @@
<viewLayoutGuide key="safeArea" id="Kfn-Yf-bFq"/>
<color key="backgroundColor" name="gray100"/>
<constraints>
<constraint firstItem="41h-1D-tTT" firstAttribute="leading" secondItem="Kfn-Yf-bFq" secondAttribute="leading" constant="20" id="09o-Vf-Hi8"/>
<constraint firstItem="uvF-5l-2QF" firstAttribute="leading" secondItem="Kfn-Yf-bFq" secondAttribute="leading" id="7L1-JH-3bA"/>
<constraint firstAttribute="trailing" secondItem="uvF-5l-2QF" secondAttribute="trailing" id="MQm-Cz-SEe"/>
<constraint firstAttribute="bottom" secondItem="6pV-f7-nxC" secondAttribute="bottom" id="Qbj-D5-NOD"/>
<constraint firstItem="V2Y-fc-egg" firstAttribute="centerX" secondItem="tNr-su-wp3" secondAttribute="centerX" id="U3W-E0-KdH"/>
<constraint firstItem="6pV-f7-nxC" firstAttribute="leading" secondItem="Kfn-Yf-bFq" secondAttribute="leading" id="U3X-oS-uhs"/>
<constraint firstItem="6pV-f7-nxC" firstAttribute="top" secondItem="uvF-5l-2QF" secondAttribute="bottom" id="UWZ-gz-9mC"/>
<constraint firstItem="uvF-5l-2QF" firstAttribute="top" secondItem="Kfn-Yf-bFq" secondAttribute="top" id="VCZ-Wj-phy"/>
<constraint firstItem="41h-1D-tTT" firstAttribute="top" secondItem="uvF-5l-2QF" secondAttribute="bottom" constant="16" id="fk0-dc-dsz"/>
<constraint firstItem="Kfn-Yf-bFq" firstAttribute="trailing" secondItem="41h-1D-tTT" secondAttribute="trailing" constant="20" id="ozP-uH-dq2"/>
<constraint firstItem="6pV-f7-nxC" firstAttribute="top" secondItem="41h-1D-tTT" secondAttribute="bottom" constant="12" id="pBE-MW-qHy"/>
<constraint firstItem="Kfn-Yf-bFq" firstAttribute="trailing" secondItem="6pV-f7-nxC" secondAttribute="trailing" id="qwZ-Xk-Ld2"/>
<constraint firstItem="V2Y-fc-egg" firstAttribute="centerY" secondItem="tNr-su-wp3" secondAttribute="centerY" id="uch-vR-wTA"/>
</constraints>
</view>
<connections>
<outlet property="closeButton" destination="haQ-0V-5oI" id="H6w-OW-iVQ"/>
<outlet property="indicator" destination="V2Y-fc-egg" id="nt3-eP-13D"/>
<outlet property="songCountLabel" destination="UdW-23-cte" id="G76-5c-H0g"/>
<outlet property="subTitleLabel" destination="jOU-YU-z2H" id="8U0-Ki-7Lq"/>
<outlet property="tableView" destination="6pV-f7-nxC" id="Wt6-it-odd"/>
<outlet property="titleLabel" destination="YSQ-a0-BSm" id="fYv-i3-6Wz"/>
</connections>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public final class ContainSongsViewController: BaseViewController, ViewControlle
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var indicator: NVActivityIndicatorView!
@IBOutlet weak var songCountLabel: UILabel!
@IBOutlet weak var subTitleLabel: UILabel!

let containerView = UIView(frame: CGRect(x: .zero, y: .zero, width: APP_WIDTH(), height: 48))
let songCountLabel: UILabel = UILabel()
let subTitleLabel: UILabel = UILabel()
var multiPurposePopupFactory: MultiPurposePopupFactory!
var textPopupFactory: TextPopupFactory!

Expand All @@ -30,6 +30,8 @@ public final class ContainSongsViewController: BaseViewController, ViewControlle

override public func viewDidLoad() {
super.viewDidLoad()
addSubviews()
setLayout()
configureUI()
inputBind()
outputBind()
Expand All @@ -53,6 +55,23 @@ public final class ContainSongsViewController: BaseViewController, ViewControlle
}

extension ContainSongsViewController {
private func addSubviews() {
containerView.addSubviews(songCountLabel, subTitleLabel)
tableView.tableHeaderView = containerView
}

private func setLayout() {
subTitleLabel.snp.makeConstraints {
$0.leading.equalTo(songCountLabel.snp.trailing)
$0.centerY.equalTo(songCountLabel.snp.centerY)
}

songCountLabel.snp.makeConstraints {
$0.leading.equalTo(closeButton.snp.leading)
$0.centerY.equalToSuperview()
}
}

private func inputBind() {
tableView.rx.setDelegate(self).disposed(by: disposeBag)

Expand Down Expand Up @@ -182,6 +201,7 @@ extension ContainSongsViewController {
titleLabel.text = "리스트에 담기"
titleLabel.setTextWithAttributes(kernValue: -0.5)

// 24 , 12
songCountLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14)
songCountLabel.textColor = DesignSystemAsset.PrimaryColor.point.color
songCountLabel.text = "\(viewModel.songs.count)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ContainPlaylistHeaderView: UIView {
self.backgroundColor = .clear
superView.backgroundColor = .white.withAlphaComponent(0.4)
superView.layer.cornerRadius = 8
superView.layer.borderColor = DesignSystemAsset.BlueGrayColor.gray200.color.withAlphaComponent(0.7).cgColor
superView.layer.borderColor = DesignSystemAsset.BlueGrayColor.gray200.color.withAlphaComponent(0.4).cgColor
superView.layer.borderWidth = 1

blurEffectViews.layer.cornerRadius = 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private extension PlaylistViewController {
}.store(in: &subscription)

output.playlists
.map { [PlayListSectionModel.init(model: 0, items: $0)] }
.map { [PlaylistSectionModel.init(model: 0, items: $0)] }
.do(afterNext: { [currentSongID, tableView = playlistView.playlistTableView] playListSectionModel in
guard let currentSongID else { return }
guard
Expand Down Expand Up @@ -277,8 +277,8 @@ extension PlaylistViewController {
private func createDatasources(
output: PlaylistViewModel
.Output
) -> RxTableViewSectionedReloadDataSource<PlayListSectionModel> {
let datasource = RxTableViewSectionedReloadDataSource<PlayListSectionModel>(
) -> RxTableViewSectionedReloadDataSource<PlaylistSectionModel> {
let datasource = RxTableViewSectionedReloadDataSource<PlaylistSectionModel>(
configureCell: { [weak self] _, tableView, indexPath, model -> UITableViewCell in
guard let self else { return UITableViewCell() }
guard let cell = tableView.dequeueReusableCell(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import RxRelay
import RxSwift
import Utility

internal typealias PlayListSectionModel = SectionModel<Int, PlaylistItemModel>
internal typealias PlaylistSectionModel = SectionModel<Int, PlaylistItemModel>

final class PlaylistViewModel: ViewModelType {
struct Input {
Expand Down

0 comments on commit 14c6463

Please sign in to comment.