From f40e3ac714c6e4a74eac2ca734cd2eb11f254b0e Mon Sep 17 00:00:00 2001 From: hyunji1203 Date: Tue, 7 Nov 2023 11:13:00 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=EA=B2=BD=EA=B3=A0=20=EB=AC=B8?= =?UTF-8?q?=EA=B5=AC=20=EB=A6=AC=EC=86=8C=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 --- android/app/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 24a77863a..13fb026cb 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -146,6 +146,7 @@ 이 곳에 내용을 작성해주세요! + 내용을 1자 이상 입력해주세요! 전송하기 From 0265a574a6aa5cec0262532c75ff498e8bd46f78 Mon Sep 17 00:00:00 2001 From: hyunji1203 Date: Tue, 7 Nov 2023 11:14:23 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=EC=AA=BD=EC=A7=80=20=EB=82=B4?= =?UTF-8?q?=EC=9A=A9=EC=9D=B4=20=EB=B9=84=EC=96=B4=20=EC=9E=88=EC=9D=84=20?= =?UTF-8?q?=EB=95=8C=20=EB=93=B1=EB=A1=9D=20=ED=95=98=EC=A7=80=20=EB=AA=BB?= =?UTF-8?q?=20=ED=95=98=EB=8F=84=EB=A1=9D=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/common/dialog/LetterSendDialog.kt | 10 +++++++++- .../presentation/onadventure/OnAdventureActivity.kt | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt b/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt index 316b45d34..e792f22a6 100644 --- a/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt +++ b/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt @@ -7,12 +7,14 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.DialogFragment +import com.now.naaga.R import com.now.naaga.databinding.DialogSendLetterBinding import com.now.naaga.util.dpToPx import com.now.naaga.util.getWidthProportionalToDevice class LetterSendDialog( private val onClick: (String) -> Unit, + private val showWarning: (String) -> Unit, ) : DialogFragment() { private lateinit var binding: DialogSendLetterBinding var message: String = "" @@ -42,7 +44,13 @@ class LetterSendDialog( } private fun setClickListener() { - binding.btnDialogLetterSubmit.setOnClickListener { onClick(message) } + binding.btnDialogLetterSubmit.setOnClickListener { + if (message.isEmpty()) { + showWarning(getString(R.string.send_letter_dialog_warning)) + } else { + onClick(message) + } + } } companion object { diff --git a/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt b/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt index 95acee13e..b052ecced 100644 --- a/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt +++ b/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt @@ -103,7 +103,7 @@ class OnAdventureActivity : viewModel.endAdventure() } binding.ivSendLetter.setOnClickListener { - LetterSendDialog(viewModel::sendLetter).show(supportFragmentManager, LetterSendDialog.TAG) + LetterSendDialog(viewModel::sendLetter, ::showToast).show(supportFragmentManager, LetterSendDialog.TAG) } } From ffab36dc035298af4e9814627f4392f8e723cef5 Mon Sep 17 00:00:00 2001 From: hyunji1203 Date: Tue, 7 Nov 2023 13:59:28 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20=EC=A0=84=EC=86=A1=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=EC=97=90=EB=A7=8C=20?= =?UTF-8?q?=EA=B2=BD=EA=B3=A0=20=EB=AC=B8=EA=B5=AC=EA=B0=80=20=EB=9C=A8?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/common/dialog/LetterSendDialog.kt | 10 +--------- .../presentation/onadventure/OnAdventureActivity.kt | 10 +++++++++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt b/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt index e792f22a6..316b45d34 100644 --- a/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt +++ b/android/app/src/main/java/com/now/naaga/presentation/common/dialog/LetterSendDialog.kt @@ -7,14 +7,12 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.DialogFragment -import com.now.naaga.R import com.now.naaga.databinding.DialogSendLetterBinding import com.now.naaga.util.dpToPx import com.now.naaga.util.getWidthProportionalToDevice class LetterSendDialog( private val onClick: (String) -> Unit, - private val showWarning: (String) -> Unit, ) : DialogFragment() { private lateinit var binding: DialogSendLetterBinding var message: String = "" @@ -44,13 +42,7 @@ class LetterSendDialog( } private fun setClickListener() { - binding.btnDialogLetterSubmit.setOnClickListener { - if (message.isEmpty()) { - showWarning(getString(R.string.send_letter_dialog_warning)) - } else { - onClick(message) - } - } + binding.btnDialogLetterSubmit.setOnClickListener { onClick(message) } } companion object { diff --git a/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt b/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt index b052ecced..f483e06ef 100644 --- a/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt +++ b/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt @@ -103,7 +103,7 @@ class OnAdventureActivity : viewModel.endAdventure() } binding.ivSendLetter.setOnClickListener { - LetterSendDialog(viewModel::sendLetter, ::showToast).show(supportFragmentManager, LetterSendDialog.TAG) + LetterSendDialog(::registerLetter).show(supportFragmentManager, LetterSendDialog.TAG) } } @@ -203,6 +203,14 @@ class OnAdventureActivity : } } + private fun registerLetter(message: String) { + if (message.isNotEmpty()) { + viewModel::sendLetter + } else { + showToast(getString(R.string.send_letter_dialog_warning)) + } + } + private fun showGiveUpDialog() { val fragment: Fragment? = supportFragmentManager.findFragmentByTag(GIVE_UP) if (fragment == null) { From 674d51b32f885e53811dfcf919e6953ae485bbea Mon Sep 17 00:00:00 2001 From: hyunji1203 Date: Wed, 8 Nov 2023 10:42:32 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=EC=AA=BD=EC=A7=80=EA=B0=80=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../now/naaga/presentation/onadventure/OnAdventureActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt b/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt index f483e06ef..83b59aa89 100644 --- a/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt +++ b/android/app/src/main/java/com/now/naaga/presentation/onadventure/OnAdventureActivity.kt @@ -205,7 +205,7 @@ class OnAdventureActivity : private fun registerLetter(message: String) { if (message.isNotEmpty()) { - viewModel::sendLetter + viewModel.sendLetter(message) } else { showToast(getString(R.string.send_letter_dialog_warning)) }