Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

다른 유저의 직업/관심사가 보이도록 수정, 메인화면 UI 수정 #184

Merged
merged 5 commits into from
Aug 4, 2022
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
2 changes: 1 addition & 1 deletion Weekand/Weekand/Domain/Enum/Status.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

/// 일정 상태 정보
enum Status: String {
case upcoming = "UNCOMPLETED"
case upcoming = "NOT_YET"
case completed = "COMPLETED"
case incompleted = "INCOMPLETED"
case undetermined = "UNDETERMINED"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class WCategoryTitleLabel: WIconLabel {
self.label.font = WFont.body1()
self.label.textColor = .gray900

self.stack.spacing = 7
self.stack.spacing = 0

icon.snp.makeConstraints { make in
make.height.equalTo(10)
make.height.equalTo(24)
make.width.equalTo(icon.snp.height)
}

Expand All @@ -47,7 +47,13 @@ class WCategoryTitleLabel: WIconLabel {
extension WCategoryTitleLabel {

public func editValue(color: UIColor, title: String) {
self.icon.backgroundColor = color

if let categoryBox = UIImage(named: "box.filled")?.withTintColor(color) {
self.icon.image = categoryBox
} else {
self.icon.backgroundColor = color
}

self.label.text = title
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class WIconLabel: UIView {

lazy var icon = UIImageView().then {
$0.setContentHuggingPriority(.required, for: .vertical)
$0.contentMode = .scaleAspectFit
$0.contentMode = .scaleAspectFill
}
lazy var label = UILabel().then {
$0.textAlignment = .left
Expand All @@ -26,14 +26,14 @@ class WIconLabel: UIView {
$0.addArrangedSubview(label)

icon.snp.makeConstraints { make in
make.height.lessThanOrEqualTo(label.snp.height)
make.width.equalTo(icon.snp.height)
make.centerY.equalToSuperview()
}

$0.axis = .horizontal
$0.distribution = .fill
$0.alignment = .center
$0.spacing = 5
$0.spacing = 10
}

override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class WStatusTimeLabel: WIconLabel {

self.label.font = WFont.body2()
self.label.textColor = .gray400
self.stack.spacing = 0

self.icon.snp.makeConstraints { make in
make.height.equalTo(24)
}
}

init(status: StatusIcon, title: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ class MainViewController: UIViewController {
var headerView = MainViewHeader()
var tableView: UITableView!

lazy var foldButton = UIBarButtonItem(image: UIImage(named: "emptyImage")!, style: .plain, target: self, action: nil)
lazy var foldButton = UIBarButtonItem(image: UIImage(named: "emptyImage")!, style: .plain, target: self, action: nil).then {
let foldButtonImage = UIImage(named: "chevron.up") ?? UIImage(systemName: "chevron.up")
$0.setBackgroundImage(foldButtonImage?.withTintColor(.gray900), for: .normal, barMetrics: .default)
}
lazy var searchButton = UIBarButtonItem(image: UIImage(named: "search") ?? UIImage(systemName: "magnifyingglass"), style: .plain, target: self, action: nil)
lazy var alarmButton = UIBarButtonItem(image: UIImage(named: "alarm") ?? UIImage(systemName: "bell"), style: .plain, target: self, action: nil)
let spacer = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil).then {
$0.width = 4
}


lazy var floatingButton = UIButton().then {
$0.backgroundColor = .mainColor
Expand Down Expand Up @@ -67,10 +74,9 @@ class MainViewController: UIViewController {
private func configureUI() {

// Navigation Bar
let foldButtonImage = UIImage(named: "chevron.up") ?? UIImage(systemName: "chevron.up")
foldButton.setBackgroundImage(foldButtonImage?.withTintColor(.gray900), for: .normal, barMetrics: .default)
navigationItem.leftBarButtonItem = foldButton
navigationItem.rightBarButtonItems = [alarmButton, searchButton]

navigationItem.setLeftBarButtonItems([spacer, foldButton], animated: false)
navigationItem.rightBarButtonItems = [spacer, alarmButton, searchButton]

// Content View
[ collectionView, headerView, tableView ].forEach { self.view.addSubview($0) }
Expand Down Expand Up @@ -409,7 +415,7 @@ extension MainViewController {
}

if let safeImage = buttonImage {
navigationItem.leftBarButtonItem?.setBackgroundImage(safeImage.withTintColor(.gray900), for: .normal, barMetrics: .default)
foldButton.setBackgroundImage(safeImage.withTintColor(.gray900), for: .normal, barMetrics: .default)
}

UIView.animate(withDuration: 0.25) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ProfileViewModel: ViewModelType {
private let profileUseCase: ProfileUseCase
private let disposeBag = DisposeBag()

var userDeatil = BehaviorRelay<UserDetail>(value: UserDetail.defaultData)
var userDeatil = PublishRelay<UserDetail>()
var buttonState = BehaviorRelay<ProfileButtonType>(value: ProfileButtonType.edit)
var errorMessage = BehaviorRelay<String?>(value: nil)

Expand Down Expand Up @@ -169,6 +169,7 @@ extension ProfileViewModel {
}, onFailure: { error in
print("\(#function) Error: \(error)")
self.errorMessage.accept("\(error)")
self.userDeatil.accept(UserDetail.defaultData)
}, onDisposed: nil)
.disposed(by: disposeBag)
}
Expand All @@ -177,7 +178,7 @@ extension ProfileViewModel {
private func followUser(id: String) {

self.profileUseCase.createFollowee(id: id).subscribe(onSuccess: { _ in
BehaviorRelay<ProfileButtonType>.just(.following).bind(to: self.buttonState).disposed(by: self.disposeBag)
self.buttonState.accept(.following)
}, onFailure: { error in
print("\(#function) Error: \(error)")
self.errorMessage.accept("\(error)")
Expand All @@ -190,7 +191,7 @@ extension ProfileViewModel {
private func unfollowUser(id: String) {

self.profileUseCase.deleteFollowee(id: id).subscribe(onSuccess: { _ in
BehaviorRelay<ProfileButtonType>.just(.follow).bind(to: self.buttonState).disposed(by: self.disposeBag)
self.buttonState.accept(.follow)

}, onFailure: { error in
print("\(#function) Error: \(error)")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "rectangle.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"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" : "state.completed.png",
"filename" : "work_completed.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "state.completed2x.png",
"filename" : "work_completed@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "state.completed3x.png",
"filename" : "work_completed@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
Binary file not shown.
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.
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" : "state.hold.png",
"filename" : "work_beforecheck.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "state.hold2x.png",
"filename" : "work_beforecheck@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "state.hold3x.png",
"filename" : "work_beforecheck@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
Binary file not shown.
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.
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" : "state.incomplete.png",
"filename" : "work_uncompleted.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "state.incomplete2x.png",
"filename" : "work_uncompleted@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "state.incomplete3x.png",
"filename" : "work_uncompleted@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "state.proceeding.png",
"filename" : "work_ongoing.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "state.proceeding2x.png",
"filename" : "work_ongoing@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "state.proceeding3x.png",
"filename" : "work_ongoing@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
Binary file not shown.
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.
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" : "state.upcomming.png",
"filename" : "work_prearranged.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "state.upcomming2x.png",
"filename" : "work_prearranged@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "state.upcomming3x.png",
"filename" : "work_prearranged@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"scale" : "1x"
},
{
"filename" : "radio_disabled2x.png",
"filename" : "radio_disabled@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "radio_disabled3x.png",
"filename" : "radio_disabled@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Diff not rendered.
Diff not rendered.