Skip to content

Commit

Permalink
[Feat/#19] Challenge - adjusted 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Jan 6, 2024
1 parent f572d97 commit a5206e2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppListCollectionViewCell: UICollectionViewCell {

let appImageView = UIImageView().then {
$0.backgroundColor = .blue
$0.makeCornerRound(radius: 8)
$0.makeCornerRound(radius: 8.adjusted)
}

let appNameLabel = UILabel().then {
Expand Down Expand Up @@ -47,25 +47,25 @@ class AppListCollectionViewCell: UICollectionViewCell {
private func setViewHierarchy() {
self.backgroundColor = .clear
contentView.backgroundColor = .gray7
contentView.makeCornerRound(radius: 6)
contentView.makeCornerRound(radius: 6.adjusted)
contentView.addSubviews(appImageView, appNameLabel, timeLabel)
}

private func setConstraints() {

appImageView.snp.makeConstraints {
$0.size.equalTo(40)
$0.leading.equalToSuperview().offset(17)
$0.size.equalTo(40.adjusted)
$0.leading.equalToSuperview().offset(17.adjustedWidth)
$0.centerY.equalToSuperview()
}

appNameLabel.snp.makeConstraints {
$0.leading.equalTo(appImageView.snp.trailing).offset(14)
$0.leading.equalTo(appImageView.snp.trailing).offset(14.adjustedWidth)
$0.centerY.equalToSuperview()
}

timeLabel.snp.makeConstraints {
$0.trailing.equalToSuperview().inset(27)
$0.trailing.equalToSuperview().inset(27.adjustedWidth)
$0.centerY.equalToSuperview()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DateCollectionViewCell: UICollectionViewCell {

let imageView = UIImageView().then {
$0.backgroundColor = .background
$0.makeCornerRound(radius: 8)
$0.makeCornerRound(radius: 8.adjusted)
}

override init(frame: CGRect) {
Expand All @@ -48,9 +48,9 @@ class DateCollectionViewCell: UICollectionViewCell {
}

imageView.snp.makeConstraints {
$0.top.equalTo(dateLabel.snp.bottom).offset(6)
$0.top.equalTo(dateLabel.snp.bottom).offset(6.adjustedHeight)
$0.centerX.equalToSuperview()
$0.size.equalTo(40)
$0.size.equalTo(40.adjusted)
}
}

Expand Down
14 changes: 7 additions & 7 deletions HMH_iOS/HMH_iOS/Presentation/Challenge/Views/ChallengeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ extension ChallengeView: UICollectionViewDataSource {

extension ChallengeView {
func createDateLayout() -> NSCollectionLayoutSection {
let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(40),
heightDimension: .absolute(63))
let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(40.adjustedWidth),
heightDimension: .absolute(63.adjustedHeight))
let item = NSCollectionLayoutItem(layoutSize: itemSize)

let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .estimated(63))
heightDimension: .estimated(63.adjustedHeight))
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize,
repeatingSubitem: item,
count: 7)
Expand All @@ -140,8 +140,8 @@ extension ChallengeView {

let section = NSCollectionLayoutSection(group: group)
section.orthogonalScrollingBehavior = .groupPagingCentered
section.interGroupSpacing = 19
section.contentInsets = .init(top: 0, leading: 0, bottom: 35, trailing:0)
section.interGroupSpacing = 19.adjustedHeight
section.contentInsets = .init(top: 0, leading: 0, bottom: 35.adjustedHeight, trailing:0)


let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(145.adjustedHeight))
Expand All @@ -166,9 +166,9 @@ extension ChallengeView {

func createAppListLayout() -> NSCollectionLayoutSection {
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .absolute(68))
heightDimension: .absolute(68.adjustedHeight))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
item.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 20, bottom: 0, trailing: 20)
item.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 20.adjustedWidth, bottom: 0, trailing: 20.adjustedWidth)

let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .fractionalHeight(0.5))
Expand Down

0 comments on commit a5206e2

Please sign in to comment.