Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ public enum RDDSKitAsset {
}
public enum Images {
public static let icnMicTitle = RDDSKitImages(name: "icn_mic_title")
public static let instaBackground = RDDSKitImages(name: "instaBackground")
public static let instaCardBlue = RDDSKitImages(name: "insta_card_blue")
public static let instaCardPink = RDDSKitImages(name: "insta_card_pink")
public static let instaCardPurple = RDDSKitImages(name: "insta_card_purple")
public static let instaCardRed = RDDSKitImages(name: "insta_card_red")
public static let instaCardWhite = RDDSKitImages(name: "insta_card_white")
public static let instaCardYellow = RDDSKitImages(name: "insta_card_yellow")
public static let instaRogo = RDDSKitImages(name: "insta_rogo")
public static let kakaotalk = RDDSKitImages(name: "Kakaotalk")
public static let icnEdit = RDDSKitImages(name: "icn_edit")
public static let icnMypage = RDDSKitImages(name: "icn_mypage")
Expand Down Expand Up @@ -128,15 +136,6 @@ public enum RDDSKitAsset {
public static let rdSplashLogo = RDDSKitImages(name: "rd_splash_logo")
public static let rdgoroMark = RDDSKitImages(name: "rdgoro_mark")
public static let splashBackground = RDDSKitImages(name: "splash_background")

public static let instaLogo = RDDSKitImages(name: "insta_rogo")
public static let instaBackground = RDDSKitImages(name: "instaBackground")
public static let instaCardBlue = RDDSKitImages(name: "insta_card_blue")
public static let instaCardPink = RDDSKitImages(name: "insta_card_pink")
public static let instaCardPurple = RDDSKitImages(name: "insta_card_purple")
public static let instaCardRed = RDDSKitImages(name: "insta_card_red")
public static let instaCardWhite = RDDSKitImages(name: "insta_card_white")
public static let instaCardYellow = RDDSKitImages(name: "insta_card_yellow")
}
}
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// VoiceNoticeView.swift
// RD-DSKit
//
// Created by 김수연 on 2023/01/08.
// Copyright © 2023 RecorDream-iOS. All rights reserved.
//

import UIKit

import SnapKit
import RxSwift
import RxCocoa

public final class VoiceNoticeView: UIView {

Comment on lines +15 to +16
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 쓸게욤 ㅎㅅㅎ

// MARK: - UI Components

private let micImage = UIImageView(image: RDDSKitAsset.Images.icnMic.image)

private let onlyVoiceExistLabel: UILabel = {
let label = UILabel()
label.text = "음성만 기록되어 있어요"
label.font = RDDSKitFontFamily.Pretendard.regular.font(size: 12)
label.textColor = RDDSKitAsset.Colors.white02.color
return label
}()

private enum Metric {
static let micSize = 24.f
static let contentSpacing = 4.f

static let voiceLabelTopBottom = 3.f
}

// MARK: - View Life Cycle

override init(frame: CGRect) {
super.init(frame: frame)
setUI()
setLayout()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: - UI & Layouts

private func setUI() {
self.backgroundColor = .none
}

private func setLayout() {
self.addSubviews(micImage, onlyVoiceExistLabel)

micImage.snp.makeConstraints {
$0.top.leading.equalToSuperview()
$0.height.width.equalTo(Metric.micSize)
}

onlyVoiceExistLabel.snp.makeConstraints {
$0.leading.equalTo(micImage.snp.trailing).inset(Metric.contentSpacing)
$0.top.bottom.equalToSuperview().inset(Metric.voiceLabelTopBottom)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by 김수연 on 2022/12/04.
//

import Foundation

import Domain
import RD_Core

Expand All @@ -28,6 +30,7 @@ public class DreamDetailViewModel: ViewModelType {

public struct Output {
var fetchedDetailData = BehaviorRelay<DreamDetailEntity?>(value: nil)
var loadingStatus = BehaviorRelay<Bool>(value: true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비해비어 릴레이로 하신 이유가 있을까요??

Copy link
Copy Markdown
Member Author

@Suyeon9911 Suyeon9911 Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@L-j-h-c 처음에 초기값을 지정해주지 않으니 상세뷰 띄울때 로딩뷰가 잘 안떠서요..! PublishRelay로 해줘도 잘 되셨나용?? 그러면.. 이 문제가 아니엇던 것일까요,,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Suyeon9911 아뇨~! 다시 보니까 이 방법이 좋은 것 같습니다~ publishRelay로 하면 viewController에서는 output이 transform된 이후에 구독하는거라 로딩이 안 뜨는 것 같네요!

}

// MARK: - Coordination
Expand All @@ -44,11 +47,13 @@ extension DreamDetailViewModel {
self.bindOutput(output: output, disposeBag: disposeBag)

input.viewDidLoad.subscribe(onNext: { _ in
output.loadingStatus.accept(true)
self.useCase.fetchDetailRecord(recordId: self.dreamId)
}).disposed(by: disposeBag)

input.isModifyDismissed.subscribe(onNext: { isDismissed in
if isDismissed {
output.loadingStatus.accept(true)
self.useCase.fetchDetailRecord(recordId: self.dreamId)
}
}).disposed(by: disposeBag)
Expand All @@ -61,6 +66,7 @@ extension DreamDetailViewModel {

detailDreamData.compactMap { $0 }
.subscribe(onNext: { entity in
output.loadingStatus.accept(false)
output.fetchedDetailData.accept(entity)
}).disposed(by: disposeBag)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ final class DetailRecordPageViewController: UIView {
extension DetailRecordPageViewController {
func setTabContentsItem(contentPages: [UIViewController]) {
self.contentPages = contentPages
movePage(from: 0, to: 0, animated: true)
movePage(from: 0, to: 0, animated: false)
}
}

Expand All @@ -100,7 +100,7 @@ extension DetailRecordPageViewController {
currentIndex < targetIndex ? .forward : .reverse

self.pageViewController
.setViewControllers([targetPage], direction: direction, animated: true)
.setViewControllers([targetPage], direction: direction, animated: animated)
{ isCompleted in }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ extension DreamDetailVC {
.bind { (owner, entity) in
owner.fetchDetailDreamData(model: entity)
}.disposed(by: self.disposeBag)

output.loadingStatus
.bind(to: self.rx.isLoading)
.disposed(by: self.disposeBag)
}

private func fetchDetailDreamData(model: DreamDetailEntity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public final class DreamRecordViewController: UIViewController {
}

self.contentLabel.text = content
contentLabel.addLabelSpacing(kernValue: -0.14)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아마 paragraphStyle이 다시 적용되고 있어서 그런 것 같은데, 이 메서드 내부에서 style.linebreakMode를 다시 적용하면 달라질 수도 있을 것 같네요~!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@L-j-h-c 아 그렇네요 !! 바로 적용했습니다 감사합니다 ~~

}

private func setAudioPlayer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class DreamShareVC: UIViewController {
// MARK: - UI Components

private let backgroundView = UIImageView(image: RDDSKitAsset.Images.instaBackground.image)
private let instaLogoView = UIImageView(image: RDDSKitAsset.Images.instaLogo.image)
private let instaLogoView = UIImageView(image: RDDSKitAsset.Images.instaRogo.image)

private let cardView = UIImageView(image: RDDSKitAsset.Images.instaCardRed.image)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class HomeViewModel: ViewModelType {

public struct Output {
var fetchedHomeData = BehaviorRelay<HomeEntity?>(value: nil)
var loadingStatus = BehaviorRelay<Bool>(value: true)
}

// MARK: - Coordination
Expand All @@ -45,6 +46,7 @@ extension HomeViewModel: DreamCardCollectionViewAdapterDataSource {
self.bindOutput(output: output, disposeBag: disposeBag)

input.viewWillAppear.subscribe(onNext: { _ in
output.loadingStatus.accept(true)
self.useCase.fetchDreamRecord()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retain Cycle 방지해주세요~

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1차 QA 우선 반영을 위해 따로 이슈 파서 해결하도록 하겠습니다 !!

}).disposed(by: disposeBag)

Expand All @@ -57,6 +59,7 @@ extension HomeViewModel: DreamCardCollectionViewAdapterDataSource {
homeData
.compactMap { $0 }
.subscribe(onNext: { entity in
output.loadingStatus.accept(false)
output.fetchedHomeData.accept(entity)

let count = entity.records.count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,22 @@ final class DreamCardCVC: UICollectionViewCell, UICollectionViewRegisterable {
static var isFromNib: Bool = false

private enum Metric {
static let emotionImageSize = 85.f
static let emotionImageWidth = 85.adjustedWidth
static let emotionImageHeight = 85.adjustedH

static let emotionImageTop = 37.f
static let dateLabelTop = 18.f
static let contentSpacing = 8.f
static let contentLeadingTrailing = 22.f
static let emotionImageTop = 37.adjustedH
static let dateLabelTop = 18.adjustedH
static let contentSpacing = 8.adjustedH
static let contentLeadingTrailing = 22.adjustedWidth
static let dateLabelHeight = 17.f

static let genreStackSpacing = 4.f
static let genreStackHeight = 21.f
static let noteLabelHeight = 114.f
static let genreStackHeight = 21.adjustedH
static let noteLabelHeight = 114.adjustedH

static let voiceNoticeViewWidth = 137.adjustedWidth
static let voiceTopSpacing = 9.adjustedH
static let voiceNoticeViewHeight = 24.adjustedH
}


Expand Down Expand Up @@ -76,6 +82,7 @@ final class DreamCardCVC: UICollectionViewCell, UICollectionViewRegisterable {
return label
}()

private var voiceNoticeView = VoiceNoticeView()

// MARK: - View Life Cycles

Expand All @@ -98,8 +105,6 @@ final class DreamCardCVC: UICollectionViewCell, UICollectionViewRegisterable {

private func setUI() {
self.backgroundColor = .none
titleLabel.addLabelSpacing(kernValue: -0.28)
noteLabel.addLabelSpacing(kernValue: -0.12)
}

private func setLayout() {
Expand All @@ -112,12 +117,14 @@ final class DreamCardCVC: UICollectionViewCell, UICollectionViewRegisterable {
emotionImageView.snp.makeConstraints {
$0.top.equalToSuperview().inset(Metric.emotionImageTop)
$0.centerX.equalToSuperview()
$0.size.equalTo(Metric.emotionImageSize)
$0.height.equalTo(Metric.emotionImageHeight)
$0.width.equalTo(Metric.emotionImageWidth)
}

dateLabel.snp.makeConstraints {
$0.top.equalTo(emotionImageView.snp.bottom).offset(Metric.dateLabelTop)
$0.centerX.equalToSuperview()
$0.height.equalTo(Metric.dateLabelHeight)
}

titleLabel.snp.makeConstraints {
Expand All @@ -136,7 +143,6 @@ final class DreamCardCVC: UICollectionViewCell, UICollectionViewRegisterable {
$0.leading.trailing.equalToSuperview().inset(Metric.contentLeadingTrailing)
$0.height.equalTo(Metric.noteLabelHeight)
}

}

func setData(model: HomeEntity.Record) {
Expand All @@ -152,6 +158,8 @@ final class DreamCardCVC: UICollectionViewCell, UICollectionViewRegisterable {
genreStackView.addArrangedSubview(DreamGenreTagView(type: .home, genre: $0))
}
}
titleLabel.addLabelSpacing(kernValue: -0.28)
noteLabel.addLabelSpacing(kernValue: -0.12)
}

func setAttributesForReuse() {
Expand Down Expand Up @@ -181,4 +189,15 @@ final class DreamCardCVC: UICollectionViewCell, UICollectionViewRegisterable {
return [RDDSKitAsset.Images.cardMWhite.image, RDDSKitAsset.Images.feelingLBlank.image]
}
}

private func setOnlyVoiceView() {
self.addSubview(voiceNoticeView)

voiceNoticeView.snp.makeConstraints {
$0.top.equalTo(genreStackView.snp.bottom).offset(Metric.contentSpacing)
$0.leading.equalToSuperview().inset(Metric.contentLeadingTrailing)
$0.height.equalTo(Metric.voiceNoticeViewHeight)
$0.width.equalTo(Metric.voiceNoticeViewWidth)
}
}
}
Loading