Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions FLINT/Domain/Sources/Entity/Content/OTTPlatform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public enum OTTPlatform: String, CaseIterable, Hashable {
}

// MARK: - URL

#warning("TODO: - ์„œ๋ฒ„ ์—ฐ๋™ ์‹œ ์„œ๋ฒ„ ๊ฐ’์œผ๋กœ ๋Œ€์ฒด")

public var webURL: URL {
let urlString: String = {
switch self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public final class OTTBottomSheetView: BaseView {
// MARK: - Public Event

public var onTapDim: (() -> Void)?
public var onTapOpen: ((OTTPlatform) -> Void)?

// MARK: - UI

Expand All @@ -30,9 +29,15 @@ public final class OTTBottomSheetView: BaseView {
public let containerView = UIView().then {
$0.backgroundColor = .flintGray800
$0.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
$0.layer.cornerRadius = 16
$0.clipsToBounds = true
}

private let titleLabel = UILabel().then {
$0.attributedText = .pretendard(.head3_sb_18, text: "์ด ์ž‘ํ’ˆ์„ ๋ณผ ์ˆ˜ ์žˆ๋Š” OTT", color: .flintWhite)
$0.numberOfLines = 1
}

private let stackView = UIStackView().then {
$0.axis = .vertical
$0.spacing = 8
Expand All @@ -42,7 +47,9 @@ public final class OTTBottomSheetView: BaseView {

private let rowHeight: CGFloat = 48
private let rowSpacing: CGFloat = 8
private let sheetTopInset: CGFloat = 36
private let sheetTopInset: CGFloat = 24
private let titleHeight: CGFloat = 24
private let titleBottomSpacing: CGFloat = 16
private let sheetBottomInset: CGFloat = 32

private var platforms: [OTTPlatform] = []
Expand All @@ -51,7 +58,7 @@ public final class OTTBottomSheetView: BaseView {
let count = platforms.count
let rowsHeight = CGFloat(count) * rowHeight
let spacingsHeight = CGFloat(max(count - 1, 0)) * rowSpacing
return sheetTopInset + rowsHeight + spacingsHeight + sheetBottomInset
return sheetTopInset + titleHeight + titleBottomSpacing + rowsHeight + spacingsHeight + sheetBottomInset
}

// MARK: - Public API
Expand All @@ -71,6 +78,7 @@ public final class OTTBottomSheetView: BaseView {
addSubview(dimView)
addSubview(containerView)

containerView.addSubview(titleLabel)
containerView.addSubview(stackView)

setAction()
Expand All @@ -86,10 +94,15 @@ public final class OTTBottomSheetView: BaseView {
$0.height.equalTo(sheetHeight)
}

stackView.snp.makeConstraints {
titleLabel.snp.makeConstraints {
$0.top.equalToSuperview().inset(sheetTopInset)
$0.leading.equalToSuperview()
$0.trailing.equalToSuperview()
$0.leading.trailing.equalToSuperview().inset(20)
$0.height.equalTo(titleHeight)
}

stackView.snp.makeConstraints {
$0.top.equalTo(titleLabel.snp.bottom).offset(titleBottomSpacing)
$0.leading.trailing.equalToSuperview().inset(20)
$0.bottom.equalToSuperview().inset(sheetBottomInset)
}
}
Expand All @@ -113,9 +126,6 @@ public final class OTTBottomSheetView: BaseView {
platforms.forEach { platform in
let row = OTTPlatformRowView()
row.configure(platform: platform)
row.onTapOpen = { [weak self] in
self?.onTapOpen?(platform)
}
stackView.addArrangedSubview(row)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public final class OTTListView: BaseView {
platforms.forEach { platform in
let row = OTTPlatformRowView()
row.configure(platform: platform)
row.onTapOpen = { [weak self] in
row.onTap = { [weak self] in
self?.onSelectPlatform?(platform)
}
stackView.addArrangedSubview(row)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,77 +13,62 @@ import Then
import Domain

public final class OTTPlatformRowView: BaseView {

// MARK: - Public Event

public var onTapOpen: (() -> Void)?

public var onTap: (() -> Void)?
// MARK: - UI

private let iconImageView = UIImageView().then {
$0.contentMode = .scaleAspectFit
$0.clipsToBounds = true
$0.layer.cornerRadius = 22
}

private let titleLabel = UILabel().then {
$0.numberOfLines = 1
}

private let openButton = BasicButton(
title: "๋ฐ”๋กœ ๋ณด๋Ÿฌ๊ฐ€๊ธฐ",
titleStyle: .body2_m_14
)


// MARK: - Public API

public func configure(platform: OTTPlatform) {
iconImageView.image = platform.icon
titleLabel.attributedText = .pretendard(.body1_sb_16, text: platform.title , color: .flintWhite)
titleLabel.attributedText = .pretendard(.body1_sb_16, text: platform.title, color: .flintWhite)
}

// MARK: - BaseView

public override func setUI() {
addSubview(iconImageView)
addSubview(titleLabel)
addSubview(openButton)

setAction()

isUserInteractionEnabled = true
let tap = UITapGestureRecognizer(target: self, action: #selector(didTap))
addGestureRecognizer(tap)
}

public override func setLayout() {
iconImageView.snp.makeConstraints {
$0.leading.equalToSuperview()
$0.centerY.equalToSuperview()
$0.size.equalTo(44)
}

titleLabel.snp.makeConstraints {
$0.leading.equalTo(iconImageView.snp.trailing).offset(12)
$0.centerY.equalToSuperview()

}

openButton.snp.makeConstraints {
$0.trailing.equalToSuperview()
$0.centerY.equalToSuperview()
$0.width.equalTo(98)
$0.height.equalTo(32)
}

snp.makeConstraints {
$0.height.equalTo(48)
}
}

// MARK: - Action

private func setAction() {
openButton.addTarget(self, action: #selector(didTapOpen), for: .touchUpInside)
}

@objc private func didTapOpen() {
onTapOpen?()

@objc private func didTap() {
onTap?()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class CollectionFolderCollectionViewCell: BaseCollectionViewCell {
}

private let profileImageVIew = UIImageView().then {
$0.contentMode = .scaleAspectFit
$0.contentMode = .scaleAspectFill
$0.clipsToBounds = true
$0.layer.cornerRadius = 14
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "collection_bg1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "collection_bg1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "collection_bg1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "imgFolder.png",
"filename" : "Vector 2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Vector.png",
"filename" : "Vector@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Vector 1.png",
"filename" : "Vector@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ public final class CollectionFolderListView: BaseView {
return UICollectionView(frame: .zero, collectionViewLayout: layout)
}()

private let bottomGradientView = GradientView().then {
$0.colors = [
DesignSystem.Color.background.withAlphaComponent(0),
DesignSystem.Color.background
]
$0.locations = [0.0, 1.0]
$0.startPoint = CGPoint(x: 0.5, y: 0)
$0.endPoint = CGPoint(x: 0.5, y: 1)
}

public override func setUI() {
backgroundColor = .flintBackground

Expand All @@ -44,7 +54,7 @@ public final class CollectionFolderListView: BaseView {
}

public override func setHierarchy() {
addSubviews(countLabel, collectionView)
addSubviews(countLabel, collectionView, bottomGradientView)
}

public override func setLayout() {
Expand All @@ -57,5 +67,10 @@ public final class CollectionFolderListView: BaseView {
$0.top.equalTo(countLabel.snp.bottom).offset(14)
$0.horizontalEdges.bottom.equalToSuperview()
}

bottomGradientView.snp.makeConstraints {
$0.horizontalEdges.bottom.equalToSuperview()
$0.height.equalTo(195)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,12 @@ public final class HomeGreetingTableViewCell: BaseTableViewCell {
private let backgroundImageView = UIImageView().then {
$0.contentMode = .scaleAspectFill
$0.clipsToBounds = true
$0.isUserInteractionEnabled = false
$0.image = UIImage.imgBackgroundHeader
}

private let blackOverlayView = UIView().then {
$0.backgroundColor = .black.withAlphaComponent(0.3)
$0.isUserInteractionEnabled = false
$0.clipsToBounds = true
}

private let innerShadowLayer = CAShapeLayer()

private let innerShadowOverlayView = UIView().then {
$0.backgroundColor = .clear
$0.isUserInteractionEnabled = false
$0.clipsToBounds = true
private let logoImageView = UIImageView().then {
$0.contentMode = .scaleAspectFit
$0.image = DesignSystem.Icon.flintLogo
}

private let greetingLabel = UILabel().then {
Expand All @@ -41,64 +32,29 @@ public final class HomeGreetingTableViewCell: BaseTableViewCell {
// MARK: - Setup

public override func setHierarchy() {
contentView.addSubviews(backgroundImageView,blackOverlayView, innerShadowOverlayView, greetingLabel)
contentView.addSubviews(backgroundImageView, logoImageView, greetingLabel)
}

public override func setLayout() {
backgroundImageView.snp.makeConstraints {
$0.edges.equalToSuperview()
}

blackOverlayView.snp.makeConstraints {
$0.edges.equalToSuperview()
}

innerShadowOverlayView.snp.makeConstraints {
$0.edges.equalToSuperview()
logoImageView.snp.makeConstraints {
$0.top.equalToSuperview().inset(18)
$0.size.equalTo(CGSize(width: 90, height: 20))
}


greetingLabel.snp.makeConstraints {
$0.top.equalToSuperview().inset(174)
$0.horizontalEdges.equalToSuperview().inset(16)
$0.bottom.equalToSuperview().inset(30)
$0.bottom.equalToSuperview().inset(20)
}
}

public override func setStyle() {
backgroundColor = .clear
contentView.backgroundColor = .clear
backgroundImageView.image = UIImage.imgBackgroundGradiantMiddle

innerShadowLayer.shadowColor = UIColor.flintBackground.cgColor
innerShadowLayer.shadowOffset = CGSize(width: 0, height: 30)
innerShadowLayer.shadowOpacity = 0.35
innerShadowLayer.shadowRadius = 40
innerShadowLayer.fillRule = .evenOdd
innerShadowLayer.fillColor = UIColor.black.cgColor

if innerShadowLayer.superlayer == nil {
innerShadowOverlayView.layer.addSublayer(innerShadowLayer)
}
}

public override func layoutSubviews() {
super.layoutSubviews()
updateInnerShadowPath()
}


private func updateInnerShadowPath() {
let bounds = innerShadowOverlayView.bounds
guard bounds.width > 0, bounds.height > 0 else { return }

let inset = -innerShadowLayer.shadowRadius * 2.0

let outerPath = UIBezierPath(rect: bounds.insetBy(dx: inset, dy: inset))
let innerPath = UIBezierPath(rect: bounds)

outerPath.append(innerPath)
innerShadowLayer.path = outerPath.cgPath
innerShadowLayer.frame = bounds
}

// MARK: - Configure
Expand Down
Loading