-
Notifications
You must be signed in to change notification settings - Fork 3
[Feat] EmptyView 및 LoadingView 추가 & 세부레이아웃 수정 #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5dfb3f3
f590445
fcbf0e6
d833ec0
ea0ba30
87897ff
984e56e
4f4b955
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 { | ||
|
|
||
| // 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 |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ | |
| // Created by 김수연 on 2022/12/04. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| import Domain | ||
| import RD_Core | ||
|
|
||
|
|
@@ -28,6 +30,7 @@ public class DreamDetailViewModel: ViewModelType { | |
|
|
||
| public struct Output { | ||
| var fetchedDetailData = BehaviorRelay<DreamDetailEntity?>(value: nil) | ||
| var loadingStatus = BehaviorRelay<Bool>(value: true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 비해비어 릴레이로 하신 이유가 있을까요??
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @L-j-h-c 처음에 초기값을 지정해주지 않으니 상세뷰 띄울때 로딩뷰가 잘 안떠서요..! PublishRelay로 해줘도 잘 되셨나용?? 그러면.. 이 문제가 아니엇던 것일까요,,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Suyeon9911 아뇨~! 다시 보니까 이 방법이 좋은 것 같습니다~ publishRelay로 하면 viewController에서는 output이 transform된 이후에 구독하는거라 로딩이 안 뜨는 것 같네요! |
||
| } | ||
|
|
||
| // MARK: - Coordination | ||
|
|
@@ -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) | ||
|
|
@@ -61,6 +66,7 @@ extension DreamDetailViewModel { | |
|
|
||
| detailDreamData.compactMap { $0 } | ||
| .subscribe(onNext: { entity in | ||
| output.loadingStatus.accept(false) | ||
| output.fetchedDetailData.accept(entity) | ||
| }).disposed(by: disposeBag) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,6 +124,7 @@ public final class DreamRecordViewController: UIViewController { | |
| } | ||
|
|
||
| self.contentLabel.text = content | ||
| contentLabel.addLabelSpacing(kernValue: -0.14) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아마 paragraphStyle이 다시 적용되고 있어서 그런 것 같은데, 이 메서드 내부에서 style.linebreakMode를 다시 적용하면 달라질 수도 있을 것 같네요~!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @L-j-h-c 아 그렇네요 !! 바로 적용했습니다 감사합니다 ~~ |
||
| } | ||
|
|
||
| private func setAudioPlayer() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. retain Cycle 방지해주세요~
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1차 QA 우선 반영을 위해 따로 이슈 파서 해결하도록 하겠습니다 !! |
||
| }).disposed(by: disposeBag) | ||
|
|
||
|
|
@@ -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 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘 쓸게욤 ㅎㅅㅎ