Skip to content
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

#91/enhancement/jsp/app enhancement #96

Merged
merged 11 commits into from
Jun 2, 2023

Conversation

pknujsp
Copy link
Collaborator

@pknujsp pknujsp commented Jun 1, 2023

📌 관련 이슈

#91

✨ 과제 내용

  1. 검색 목록 저장/로드/삭제 로직 구현 완료, Room사용, core:database모듈
  2. BaseNavArgs개선 인자를 전달받지 않은 경우에도 오류없이 도착지에서 처리가능
  3. 댓글 전송 버튼 클릭 시 BindingAdapter로 ViewModel에 데이터 전달하여 댓글 전송 로직 동작
  4. 로딩 다이얼로그 레이아웃 개선
  5. HomeFragmentRecentPenaltiesFragment에서 NewsScreen으로 이동가능
  6. AI 카메라 Fragment 오류 수정, 로직 최적화하였고, 캡처된 이미지 클릭 시 이미지가 표시됨
  7. 위의 이미지에 확대/축소 기능 추가하기 위해서 PhotoView라이브러리 추가

📸 스크린샷(선택)

📚 레퍼런스 (또는 새로 알게 된 내용) 혹은 궁금한 사항들

@@ -60,10 +61,26 @@ class MainActivity :
viewModel = activityViewModel.apply {
repeatOnStarted { eventFlow.collect { handleEvent(it) } }
}

root.viewTreeObserver.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

MainActivity의 루트 레이아웃이 Coordinator이라서 FragmentContainer의 높이가 MATCH_PARENT가 되어 BottomNav와 겹치는데 이 문제를 수정하기 위한 코드입니다. FragmentContainer의 높이를 수정합니다

Copy link
Member

Choose a reason for hiding this comment

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

뭐할때 호출되는 리스너인가요?.?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mainactivity의 뷰가 그려지기 직전에 호출되고 BottomNav높이를 가져와서 fragmentcontainerview높이 설정해줍니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

일단 만들어놨는데 아직 쓰질 않았네요

*/
@BindingAdapter("onClickSend", "inputText")
@JvmStatic
fun setOnClick(view: View, iSendText: ISendText, editText: EditText) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

댓글 전송 버튼 클릭 시 돌아가는 코드입니다.
editText의 값을 비우고,
ViewModel에 ISentText인터페이스를 구현하여 직접 ViewModel을 참조하지 않도록 했습니다.
iSendText.onClickedSendButton()을 호출하면 댓글을 전송하는 코드를 ViewModel에서 돌립니다.

Copy link
Member

@tgyuuAn tgyuuAn Jun 2, 2023

Choose a reason for hiding this comment

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

오 뷰모델을 직접 안넣어주고 인터페이스로 쓰면 편리하네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

로딩 다이얼로그 레이아웃 모서리가 사각형이 되어서 라운드로 되게 머티리얼 다이얼로그로 바꿨습니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

여기에서 페이징 상태에 따라 리스트뷰, 텍스트뷰, 로딩 바 보여줄지 여부를 처리합니다



fun NavController.deepNavigate(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

deepNavigate로 새로 만들었고,
기존에는 Argument가 XML에 실제로 붙여지면서 처리되는 거였는데,
이번에는 XMLd에 Argument를 추가하지 않고 딥링크를 새로 추가해서 돌립니다.
데이터 전달 안받는 프래그먼트에서도 오류없이 잘 돌아가네요.
by navArgs로 하면됩니다.

Copy link
Member

Choose a reason for hiding this comment

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

이건 실제로 써봐야 알 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

댓글 처리하는 유스케이스입니다.
내 댓글 목록 처리나 댓글 등록 등 관련한 모든 작업은 이걸로 하면 될거 같습니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

캡처된 사진을 보여주는 다이얼로그의 레이아웃 입니다.
뒤로가기 버튼, 확대, 축소 버튼 구성입니다

* @property NONE 초기 상태
*/
@Suppress("ClassName")
sealed class CommentActionState {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

댓글 관련 처리 로직 상태입니다.
좋아요 버튼 클릭 댓글 등록 버튼 클릭 등의 처리를 flow에 저장합니다

@@ -60,10 +61,26 @@ class MainActivity :
viewModel = activityViewModel.apply {
repeatOnStarted { eventFlow.collect { handleEvent(it) } }
}

root.viewTreeObserver.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener {
Copy link
Member

Choose a reason for hiding this comment

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

뭐할때 호출되는 리스너인가요?.?

*/
@BindingAdapter("onClickSend", "inputText")
@JvmStatic
fun setOnClick(view: View, iSendText: ISendText, editText: EditText) {
Copy link
Member

@tgyuuAn tgyuuAn Jun 2, 2023

Choose a reason for hiding this comment

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

오 뷰모델을 직접 안넣어주고 인터페이스로 쓰면 편리하네요



fun NavController.deepNavigate(
Copy link
Member

Choose a reason for hiding this comment

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

이건 실제로 써봐야 알 것 같아요!

@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
Copy link
Member

Choose a reason for hiding this comment

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

유닛테스트 해보신거에욬ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

안했는데 자동으로 만들어졌나보네욬ㅋ

topAppBar.removeOnOffsetChangedListener(null)
// smoothly hide medicinePrimaryInfoViewgroup when collapsing toolbar
topAppBar.addOnOffsetChangedListener { appBarLayout, verticalOffset ->
// 스크롤 할 때 마다 medicinePrimaryInfoViewgroup의 투명도 조정
Copy link
Member

Choose a reason for hiding this comment

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

setOnSCrollChangedListner랑 addOnOffsetChangedListner랑 뭐가 다른거죠?.?

Copy link
Collaborator Author

@pknujsp pknujsp Jun 2, 2023

Choose a reason for hiding this comment

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

addOnOffsetChangedListner이거는 스크롤될때마다 topAppBar가 최초 원래 y좌표에서 얼마나 멀어지거나 가까워지는지를 받는 리스너인데 이거 쓰면 리스너를 단 뷰의 높이 등을 바꿀수 있어요.

onScroll은 스크롤 할때마다 최초 스크롤 좌표랑 현재 스크롤 중인 좌표를 받을수있는데 이거는 화면 스크롤 하면 FAB버튼이 사라졌다 나타났다 같은 기능을 만들수 있습니다. 이거는 아마 스크롤 뷰같은거에만 달수 있는걸로 알고있는데 암튼 이런 차이가 있습니당

@pknujsp pknujsp merged commit 7e18ba4 into android_develop Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants