Skip to content

Commit

Permalink
[MOD] #253 뒤로가기 logic 함수화
Browse files Browse the repository at this point in the history
- 반복 사용되는 logic을 함수화함
  • Loading branch information
unam98 committed Nov 10, 2023
1 parent a3d8582 commit 7534adf
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class MyDrawDetailActivity :
deleteButton()
}

private fun finishViewAnimLeftRight() {
finish()
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right)
}

private fun deletingDialog() {
val (dialog, dialogLayout) = setActivityDialog(
layoutInflater = layoutInflater,
Expand All @@ -58,8 +63,7 @@ class MyDrawDetailActivity :
putExtra(EXTRA_FRAGMENT_REPLACEMENT_DIRECTION, "fromDeleteMyDrawDetail")
}
startActivity(intent)
finish()
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right)
finishViewAnimLeftRight()
}
this.btn_delete_no.setOnClickListener {
dialog.dismiss()
Expand All @@ -76,15 +80,13 @@ class MyDrawDetailActivity :

private fun backButton() { //png가 imgBtn으로 하면 잘리길래 어차피 임시로 해놓는 거니까 imgView로 component를 추가해줬음
binding.imgBtnBack.setOnClickListener {
finish()
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right)
finishViewAnimLeftRight()
}
}

private val backPressedCallback = object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
finish()
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right)
finishViewAnimLeftRight()
}
}

Expand Down

0 comments on commit 7534adf

Please sign in to comment.