Skip to content

Commit

Permalink
Fix/chatroom keyboard (#63)
Browse files Browse the repository at this point in the history
* [#57]Update: 이미지 추가 및 폴더명 변경

* Refactor: dim view 색상 및 접근 범위 수정

* [#57]Feat: UserCardViewCollectionViewCell 커스텀

- 각 셀이 그려진 후에 올리기 위해서 cell 자체를 커스텀해서 dimView, pauseView를 따로 만들어줌

* [#57]Feat: 멈춤 화면 구현

- UIVisualEffectView로 blur 뷰 구현
- 해당 뷰 contentiView에 텍스트와 정지 이미지 추가
- 피그마 디자인과 유사하게 하기 위해서 alpha값 추가함

* [#57]Feat: 타이머가 활성화 중인지 유무 확인 변수 output.isTimerActive 구독

- output.isTimerActive가 true일 때 pause view를 hidden하고 false일 때 보여주기

* [#57]Refactor: viewWillAppearTrigger 트리거 제거

- 기존에는 Falling 화면에 진입했을 때, 타이머를 멈추도록 구현했는데, 더블 클릭을 했을 때만 멈추도록 수정

* [#59]Enhance: 멈춤 뷰 add, remove에서 hidden으로 수정

- 이벤트가 자주 발생할 수 있어서 바꿈
- 필요없는 코드 삭제
- pauseview를 collection view cell에 직접 추가
- isTimerActive를 hidden과 바인딩

Fix: convert notification to keyboardLayoutGuide

Revert "Fix: convert notification to keyboardLayoutGuide"

This reverts commit 2b1647182c8121d199344d8ed7ed2d81f11dbfa9.

Revert "Fix: convert notification to keyboardLayoutGuide"

This reverts commit 2b1647182c8121d199344d8ed7ed2d81f11dbfa9.

---------

Co-authored-by: LeeSeungmin <[email protected]>
  • Loading branch information
ibcylon and Minny27 authored Feb 2, 2024
1 parent 60163fa commit 73a4f3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
9 changes: 3 additions & 6 deletions Projects/Features/Chat/Src/Room/ChatRoomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import UIKit

import Core
import DSKit

final class ChatRoomView: TFBaseView {
Expand All @@ -18,8 +17,6 @@ final class ChatRoomView: TFBaseView {
lazy var topicBar = TFTopicBannerView()
private(set) lazy var chatInputView = ChatInputView()

var bottomConstraint: NSLayoutConstraint?

lazy var collectionView: UICollectionView = {
let layout = UICollectionViewCompositionalLayout.listLayoutAutomaticHeight(withEstimatedHeight: 50)
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
Expand All @@ -40,14 +37,14 @@ final class ChatRoomView: TFBaseView {

collectionView.snp.makeConstraints {
$0.top.equalTo(topicBar.snp.bottom)
$0.leading.trailing.bottom.equalToSuperview()
$0.leading.trailing.equalToSuperview()
}
chatInputView.snp.makeConstraints {
$0.top.equalTo(collectionView.snp.bottom)
$0.leading.trailing.equalToSuperview()
$0.height.equalTo(50).priority(.low)
}
bottomConstraint = chatInputView.bottomAnchor.constraint(equalTo: self.safeAreaLayoutGuide.bottomAnchor)
bottomConstraint?.isActive = true
chatInputView.bottomAnchor.constraint(equalTo: self.keyboardLayoutGuide.topAnchor).isActive = true
}

func topicBind(_ title: String, _ content: String) {
Expand Down
18 changes: 0 additions & 18 deletions Projects/Features/Chat/Src/Room/ChatRoomViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ final class ChatRoomViewController: TFBaseViewController {
private let viewModel: ChatRoomViewModel
private var dataSource: DataSource!

private lazy var keyboardHandler: KeyboardHandler = DefaultKeyboardHandler(
parentVC: self,
bottomConstraint: self.mainView.bottomConstraint
)

init(viewModel: ChatRoomViewModel) {
self.viewModel = viewModel
super.init(nibName: nil, bundle: nil)
Expand All @@ -41,19 +36,6 @@ final class ChatRoomViewController: TFBaseViewController {
navigationItem.rightBarButtonItems = [self.mainView.reportButton, self.mainView.exitButton]
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

keyboardHandler.start()
}

override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)

keyboardHandler.stop()
}


override func bindViewModel() {
self.setupDataSource()

Expand Down

0 comments on commit 73a4f3c

Please sign in to comment.