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

fix: 다이얼로그 중첩 현상 수정 #511

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

hyunji1203
Copy link
Collaborator

📌 관련 이슈

🛠️ 작업 내용

  • 앱을 나갔다 들어왔을 때 다이얼로그가 중첩되지 않도록 수정

🎯 리뷰 포인트

  • 문제가 되었던 힌트, 쪽지, 그만하기 다이얼로그를 앱 나갔다 들어올 시 해당 태그를 갖고 있는 다이얼로그들을 찾아서 삭제해주도록 하였습니다
  • onPause() 에서 해당 로직을 수행하고 있습니다.

⏳ 작업 시간

추정 시간: 1h
실제 시간: 1h

Copy link
Collaborator

@krrong krrong left a comment

Choose a reason for hiding this comment

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

고생했습니다! 뽀또!!
고민해볼만한 코멘트 하나 남겼어요. 확인해주시고 다시 요청주시면 좋을 것 같습니다!

Comment on lines 63 to 71
override fun onPause() {
super.onPause()
supportFragmentManager.fragments.forEach { fragment ->
if (fragment.tag == GIVE_UP || fragment.tag == HINT || fragment.tag == LETTER) {
supportFragmentManager.beginTransaction().remove(fragment).commit()
}
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

[P3]

override fun onPause() {
    super.onPause()
    val tags = listOf(GIVE_UP, HINT, LETTER)
    supportFragmentManager.fragments.forEach { fragment ->
        if (tags.contains(fragment.tag)) {
            supportFragmentManager.beginTransaction().remove(fragment).commit()
        }
    }
}

이렇게 구현해도 좋겠네요. tags는 동반 객체로 옮기고요.
고민해보시라고 남겨봅니다.

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

@krrong krrong left a comment

Choose a reason for hiding this comment

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

빠르게 반영해주어서 감사합니다!
머지하도록 할게요!

@krrong krrong merged commit ce64303 into dev_android Oct 18, 2023
3 checks passed
@krrong krrong deleted the fix/#510_다이얼로그_중첩_현상_수정 branch October 18, 2023 15:37
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