From 44087f990ed1c409581e86a8608570d0eded4bdf Mon Sep 17 00:00:00 2001 From: hyeseon Date: Wed, 3 Jul 2024 20:17:28 +0900 Subject: [PATCH] =?UTF-8?q?[MOD]=20#285=20=EC=95=A1=ED=8B=B0=EB=B9=84?= =?UTF-8?q?=ED=8B=B0=20kotlin=20ext=20->=20viewBinding=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mypage/history/MyHistoryActivity.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/runnect/runnect/presentation/mypage/history/MyHistoryActivity.kt b/app/src/main/java/com/runnect/runnect/presentation/mypage/history/MyHistoryActivity.kt index 7cfb31a0..bc489156 100644 --- a/app/src/main/java/com/runnect/runnect/presentation/mypage/history/MyHistoryActivity.kt +++ b/app/src/main/java/com/runnect/runnect/presentation/mypage/history/MyHistoryActivity.kt @@ -33,6 +33,7 @@ import timber.log.Timber class MyHistoryActivity : BindingActivity(R.layout.activity_my_history), OnMyHistoryItemClick { private val viewModel: MyHistoryViewModel by viewModels() + private lateinit var deleteDialogDeleteBinding: CustomDialogDeleteBinding private lateinit var adapter: MyHistoryAdapter private lateinit var dialog: AlertDialog @@ -66,18 +67,18 @@ class MyHistoryActivity : BindingActivity(R.layout.act } private fun initDialog() { - val binding = CustomDialogDeleteBinding.inflate(layoutInflater) + deleteDialogDeleteBinding = CustomDialogDeleteBinding.inflate(layoutInflater) dialog = setCustomDialog( - binding = binding, + binding = deleteDialogDeleteBinding, description = DIALOG_DESC, yesBtnText = DELETE_BTN ) } - private fun setDialogClickEvent(binding: CustomDialogDeleteBinding) { - dialog.setDialogButtonClickListener(binding) { which -> + private fun setDialogClickEvent() { + dialog.setDialogButtonClickListener(deleteDialogDeleteBinding) { which -> when (which) { - binding.btnDeleteYes -> viewModel.deleteHistory() + deleteDialogDeleteBinding.btnDeleteYes -> viewModel.deleteHistory() } } } @@ -112,8 +113,7 @@ class MyHistoryActivity : BindingActivity(R.layout.act private fun handleDeleteButtonClicked(it: View) { if (it.isEnabled) { - val binding = CustomDialogDeleteBinding.inflate(LayoutInflater.from(it.context)) - setDialogClickEvent(binding) + setDialogClickEvent() dialog.show() } }