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

feat: 빈 쪽지 못남기게 하는 기능 구현 #542

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class OnAdventureActivity :
viewModel.endAdventure()
}
binding.ivSendLetter.setOnClickListener {
LetterSendDialog(viewModel::sendLetter).show(supportFragmentManager, LetterSendDialog.TAG)
LetterSendDialog(::registerLetter).show(supportFragmentManager, LetterSendDialog.TAG)
}
}

Expand Down Expand Up @@ -203,6 +203,14 @@ class OnAdventureActivity :
}
}

private fun registerLetter(message: String) {
if (message.isNotEmpty()) {
viewModel.sendLetter(message)
} else {
showToast(getString(R.string.send_letter_dialog_warning))
}
}

private fun showGiveUpDialog() {
val fragment: Fragment? = supportFragmentManager.findFragmentByTag(GIVE_UP)
if (fragment == null) {
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@

<!-- SendLetterDialog -->
<string name="send_letter_dialog_hint">이 곳에 내용을 작성해주세요!</string>
<string name="send_letter_dialog_warning">내용을 1자 이상 입력해주세요!</string>
<string name="send_letter_dialog_submit">전송하기</string>

<!-- All -->
Expand Down
Loading