From 7ed68ad7a58bfe7d71ad4a5f0bfb7b0d9c12642a Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Tue, 8 Aug 2023 15:38:41 +0900 Subject: [PATCH 1/6] =?UTF-8?q?#45=20feat:=20RingtoneSelect=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=EC=9D=98=20title=EC=97=90=20=EB=8C=80=ED=95=9C=20Loca?= =?UTF-8?q?lizable=20String=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Localizing/LocalizableString.swift | 3 ++ .../Localizing/en.lproj/Localizable.strings | 2 ++ .../Localizing/ja.lproj/Localizable.strings | 2 ++ .../Localizing/ko.lproj/Localizable.strings | 2 ++ .../Localizing/ru.lproj/Localizable.strings | 30 ++++++++++--------- .../Localizing/vi.lproj/Localizable.strings | 2 ++ .../zh-Hans.lproj/Localizable.strings | 2 ++ 7 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Multimer/Multimer/Localizing/LocalizableString.swift b/Multimer/Multimer/Localizing/LocalizableString.swift index 955812e..1c98188 100644 --- a/Multimer/Multimer/Localizing/LocalizableString.swift +++ b/Multimer/Multimer/Localizing/LocalizableString.swift @@ -39,6 +39,7 @@ enum LocalizableString { case checkNotificationPermissions case allowNotificationAuthorizationAlert case goToSettings + case selectRingtone case alertTones case ringtones case ringtoneName(ringtone: Ringtone) @@ -108,6 +109,8 @@ enum LocalizableString { return String(format: NSLocalizedString("allowNotificationAuthorizationAlert", comment: "")) case .goToSettings: return String(format: NSLocalizedString("goToSettings", comment: "")) + case .selectRingtone: + return String(format: NSLocalizedString("selectRingtone", comment: "")) case .alertTones: return String(format: NSLocalizedString("alertTones", comment: "")) case .ringtones: diff --git a/Multimer/Multimer/Localizing/en.lproj/Localizable.strings b/Multimer/Multimer/Localizing/en.lproj/Localizable.strings index 7ad744a..6b2e471 100644 --- a/Multimer/Multimer/Localizing/en.lproj/Localizable.strings +++ b/Multimer/Multimer/Localizing/en.lproj/Localizable.strings @@ -40,6 +40,8 @@ // MARK: - Ringtones +"selectRingtone" = "Select Alarm Sound"; + "alertTones" = "ALERT TONES"; "ringtones" = "RINGTONES"; diff --git a/Multimer/Multimer/Localizing/ja.lproj/Localizable.strings b/Multimer/Multimer/Localizing/ja.lproj/Localizable.strings index ef28bbf..7606a8b 100644 --- a/Multimer/Multimer/Localizing/ja.lproj/Localizable.strings +++ b/Multimer/Multimer/Localizing/ja.lproj/Localizable.strings @@ -40,6 +40,8 @@ // MARK: - Ringtones +"selectRingtone" = "アラーム音を選択"; + "alertTones" = "ALERT TONES"; "ringtones" = "RINGTONES"; diff --git a/Multimer/Multimer/Localizing/ko.lproj/Localizable.strings b/Multimer/Multimer/Localizing/ko.lproj/Localizable.strings index 585803f..cc4f5d7 100644 --- a/Multimer/Multimer/Localizing/ko.lproj/Localizable.strings +++ b/Multimer/Multimer/Localizing/ko.lproj/Localizable.strings @@ -40,6 +40,8 @@ // MARK: - Ringtones +"selectRingtone" = "알람음 설정"; + "alertTones" = "알림 소리"; "ringtones" = "벨소리"; diff --git a/Multimer/Multimer/Localizing/ru.lproj/Localizable.strings b/Multimer/Multimer/Localizing/ru.lproj/Localizable.strings index 6fd0218..701c5ec 100644 --- a/Multimer/Multimer/Localizing/ru.lproj/Localizable.strings +++ b/Multimer/Multimer/Localizing/ru.lproj/Localizable.strings @@ -40,17 +40,19 @@ // MARK: - Ringtones +"selectRingtone" = "Выберите Звук"; + "alertTones" = "ALERT TONES"; "ringtones" = "RINGTONES"; -"default1" = "звук уведомления 1"; -"default2" = "звук уведомления 2"; -"default3" = "звук уведомления 3"; -"default4" = "звук уведомления 4"; -"default5" = "звук уведомления 5"; -"default6" = "звук уведомления 6"; -"default7" = "звук уведомления 7"; -"default8" = "звук уведомления 8"; +"default1" = "Звук уведомления 1"; +"default2" = "Звук уведомления 2"; +"default3" = "Звук уведомления 3"; +"default4" = "Звук уведомления 4"; +"default5" = "Звук уведомления 5"; +"default6" = "Звук уведомления 6"; +"default7" = "Звук уведомления 7"; +"default8" = "Звук уведомления 8"; "alarm" = "Сигнал тревоги"; "bark" = "Звук лая собаки"; "beacon" = "Маяк"; @@ -58,15 +60,15 @@ "duck" = "Звук утки"; "illuminate" = "Освещение"; "marimba" = "Маримба"; -"oldPhone" = "Мелодия звонка телефона"; -"pianoRiff" = "Фортепианный рифф"; +"oldPhone" = "Мелодия Звонка Телефона"; +"pianoRiff" = "Фортепианный Рифф"; "pinball" = "Пинбол"; "presto" = "Престо"; "radar" = "Радар"; "reflection" = "Отражение"; -"сенча" = "зеленый чай"; +"сенча" = "Зеленый Чай"; "signal" = "Сигнал"; "stargaze" = "Звездочет"; -"strum" = "гитара"; -"trill" = "трель"; -"xylophone" = "ксилофон"; +"strum" = "Гитара"; +"trill" = "Трель"; +"xylophone" = "Ксилофон"; diff --git a/Multimer/Multimer/Localizing/vi.lproj/Localizable.strings b/Multimer/Multimer/Localizing/vi.lproj/Localizable.strings index 7c62b95..72775f1 100644 --- a/Multimer/Multimer/Localizing/vi.lproj/Localizable.strings +++ b/Multimer/Multimer/Localizing/vi.lproj/Localizable.strings @@ -40,6 +40,8 @@ // MARK: - Ringtones +"selectRingtone" = "Chọn Nhạc Chuông"; + "alertTones" = "ALERT TONES"; "ringtones" = "RINGTONES"; diff --git a/Multimer/Multimer/Localizing/zh-Hans.lproj/Localizable.strings b/Multimer/Multimer/Localizing/zh-Hans.lproj/Localizable.strings index f5f8599..f6c7f8b 100644 --- a/Multimer/Multimer/Localizing/zh-Hans.lproj/Localizable.strings +++ b/Multimer/Multimer/Localizing/zh-Hans.lproj/Localizable.strings @@ -40,6 +40,8 @@ // MARK: - Ringtones +"selectRingtone" = "选择警报声"; + "alertTones" = "警报音调"; "ringtones" = "铃声"; From 4470fb9d7e27d95ea457d40b439000174db7f544 Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Tue, 8 Aug 2023 15:40:58 +0900 Subject: [PATCH 2/6] =?UTF-8?q?#45=20feat:=20RingtoneSelectViewController?= =?UTF-8?q?=EC=9D=98=20closeBarButton=20=EB=A1=9C=EC=A7=81=EC=9D=84=20Reac?= =?UTF-8?q?tor=EC=99=80=20=EB=B0=94=EC=9D=B8=EB=94=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RingtoneSelectViewController.swift | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectViewController.swift b/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectViewController.swift index 4218d2b..19248e9 100644 --- a/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectViewController.swift +++ b/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectViewController.swift @@ -12,6 +12,7 @@ import ReactorKit import RxCocoa final class RingtoneSelectViewController: UIViewController, View { + private lazy var tableViewDiffableDataSource = RingtoneSelectTableViewDiffableDataSource(tableView: tableView) private lazy var tableView: UITableView = { let tableView = UITableView(frame: .zero, style: .insetGrouped) @@ -20,7 +21,6 @@ final class RingtoneSelectViewController: UIViewController, View { return tableView }() - private let closeBarButton = UIBarButtonItem(systemItem: .close) private var audioPlayer: AVAudioPlayer? @@ -28,9 +28,8 @@ final class RingtoneSelectViewController: UIViewController, View { override func viewDidLoad() { super.viewDidLoad() - setupTableView() - - navigationItem.rightBarButtonItem = closeBarButton + configureUI() + layoutUI() } func bind(reactor: RingtoneSelectReactor) { @@ -52,6 +51,11 @@ private extension RingtoneSelectViewController { .map { Reactor.Action.ringtoneDidSelect($0) } .bind(to: reactor.action) .disposed(by: disposeBag) + + closeBarButton.rx.tap + .map { Reactor.Action.closeButtonDidTap } + .bind(to: reactor.action) + .disposed(by: disposeBag) } func bindState(reactor: RingtoneSelectReactor) { @@ -74,13 +78,20 @@ private extension RingtoneSelectViewController { // MARK: - UI Layout private extension RingtoneSelectViewController { - func setupTableView() { + func configureUI() { + view.backgroundColor = .systemGray5 + title = LocalizableString.selectRingtone.localized + navigationController?.navigationBar.barTintColor = .systemGray5 + navigationItem.rightBarButtonItem = closeBarButton + } + + func layoutUI() { view.addSubview(tableView) tableView.translatesAutoresizingMaskIntoConstraints = false - tableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 6).isActive = true - tableView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 6).isActive = true - tableView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -6).isActive = true + tableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true + tableView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor).isActive = true + tableView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor).isActive = true tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true } } From 0043a3d4f83790e36e08fec818ae7ee62fcc4d60 Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Tue, 8 Aug 2023 15:41:38 +0900 Subject: [PATCH 3/6] =?UTF-8?q?#45=20feat:=20RingtoneSelectReactor?= =?UTF-8?q?=EC=97=90=20HomeCoordinator=20=EC=9D=98=EC=A1=B4=EC=84=B1=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/RingtoneSelect/RingtoneSelectReactor.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift b/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift index df3f1e9..11ed478 100644 --- a/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift +++ b/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift @@ -26,9 +26,11 @@ final class RingtoneSelectReactor: Reactor { } var initialState = State() + private weak var coordinator: HomeCoordinator? private let selectedRingtoneRelay: BehaviorRelay - init(selectedRingtoneRelay: BehaviorRelay) { + init(coordinator: HomeCoordinator?, selectedRingtoneRelay: BehaviorRelay) { + self.coordinator = coordinator self.selectedRingtoneRelay = selectedRingtoneRelay } From 137a35d01603ffaafd9d943562678c5e1449ec6f Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Tue, 8 Aug 2023 15:42:08 +0900 Subject: [PATCH 4/6] =?UTF-8?q?#45=20feat:=20HomeCoordinatorAction?= =?UTF-8?q?=EC=97=90=20finishRingtoneSelectScene=20=EC=BC=80=EC=9D=B4?= =?UTF-8?q?=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Coordinator/Home/HomeCoordinatorAction.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Multimer/Multimer/Presentation/Coordinator/Home/HomeCoordinatorAction.swift b/Multimer/Multimer/Presentation/Coordinator/Home/HomeCoordinatorAction.swift index 730f7e4..f803ca3 100644 --- a/Multimer/Multimer/Presentation/Coordinator/Home/HomeCoordinatorAction.swift +++ b/Multimer/Multimer/Presentation/Coordinator/Home/HomeCoordinatorAction.swift @@ -14,4 +14,5 @@ enum HomeCoordinatorAction { case showRingtoneSelectScene(selectedRingtoneRelay: BehaviorRelay) case finishTimerCreateScene case finishTimerEditScene + case finishRingtoneSelectScene } From edc51c24db92ac1536c329ea6bc682712a0938ff Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Tue, 8 Aug 2023 15:43:50 +0900 Subject: [PATCH 5/6] =?UTF-8?q?#45=20feat:=20finishRingtoneSelectScene?= =?UTF-8?q?=EC=97=90=20=EB=8C=80=ED=95=9C=20HomeCoordinator=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80=ED=95=98=EC=97=AC=20RingtoneSele?= =?UTF-8?q?ctReactor=EC=9D=98=20closeButtonDidTap=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=EC=97=90=20=EB=B0=94=EC=9D=B8=EB=94=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Coordinator/Home/DefaultHomeCoordinator.swift | 10 ++++++++-- .../RingtoneSelect/RingtoneSelectReactor.swift | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Multimer/Multimer/Presentation/Coordinator/Home/DefaultHomeCoordinator.swift b/Multimer/Multimer/Presentation/Coordinator/Home/DefaultHomeCoordinator.swift index eb3c855..b0e0336 100644 --- a/Multimer/Multimer/Presentation/Coordinator/Home/DefaultHomeCoordinator.swift +++ b/Multimer/Multimer/Presentation/Coordinator/Home/DefaultHomeCoordinator.swift @@ -35,6 +35,8 @@ final class DefaultHomeCoordinator: HomeCoordinator { navigationController.dismiss(animated: true) case .finishTimerEditScene: navigationController.popViewController(animated: true) + case .finishRingtoneSelectScene: + navigationController.dismiss(animated: true) } } } @@ -77,8 +79,12 @@ private extension DefaultHomeCoordinator { func presentRingtoneSelectViewController(selectedRingtoneRelay: BehaviorRelay) { let ringtoneSelectViewController = RingtoneSelectViewController() - let ringtoneSelectReactor = RingtoneSelectReactor(selectedRingtoneRelay: selectedRingtoneRelay) + let ringtoneSelectReactor = RingtoneSelectReactor( + coordinator: self, + selectedRingtoneRelay: selectedRingtoneRelay + ) ringtoneSelectViewController.reactor = ringtoneSelectReactor - navigationController.visibleViewController?.present(ringtoneSelectViewController, animated: true) + let containerNavigationController = UINavigationController(rootViewController: ringtoneSelectViewController) + navigationController.visibleViewController?.present(containerNavigationController, animated: true) } } diff --git a/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift b/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift index 11ed478..675570c 100644 --- a/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift +++ b/Multimer/Multimer/Presentation/RingtoneSelect/RingtoneSelectReactor.swift @@ -13,6 +13,7 @@ final class RingtoneSelectReactor: Reactor { enum Action { case viewDidLoad case ringtoneDidSelect(IndexPath) + case closeButtonDidTap } enum Mutation { @@ -51,6 +52,9 @@ final class RingtoneSelectReactor: Reactor { .just(.selectRingtone(selectedRingtone)), acceptSelectedRingtone(selectedRingtone) ) + + case .closeButtonDidTap: + return finishScene() } } @@ -73,6 +77,11 @@ private extension RingtoneSelectReactor { selectedRingtoneRelay.accept(ringtone) return .empty() } + + func finishScene() -> Observable { + coordinator?.coordinate(by: .finishRingtoneSelectScene) + return .empty() + } } // MARK: - Supporting Methods From c168f4c14ba66210697abba6d8c2037df3df3209 Mon Sep 17 00:00:00 2001 From: sanghyeok-kim Date: Wed, 9 Aug 2023 19:01:17 +0900 Subject: [PATCH 6/6] =?UTF-8?q?#45=20refactor:=20NavigationBar=EC=9D=98=20?= =?UTF-8?q?default=20barTintColor=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Multimer/Multimer/Application/SceneDelegate.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Multimer/Multimer/Application/SceneDelegate.swift b/Multimer/Multimer/Application/SceneDelegate.swift index d210e08..f5f2432 100644 --- a/Multimer/Multimer/Application/SceneDelegate.swift +++ b/Multimer/Multimer/Application/SceneDelegate.swift @@ -16,6 +16,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { guard let windowScene = (scene as? UIWindowScene) else { return } window = UIWindow(windowScene: windowScene) + configureDefaultNavigationBarAppearance() + let rootNavigationController = UINavigationController() homeCoordinator = DefaultHomeCoordinator(navigationController: rootNavigationController) homeCoordinator?.start() @@ -24,3 +26,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window?.makeKeyAndVisible() } } + +private extension SceneDelegate { + func configureDefaultNavigationBarAppearance() { + UINavigationBar.appearance().barTintColor = .systemBackground + } +}