Skip to content

Commit

Permalink
[Feat/#43] 회원 탈퇴 Dialog 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
ss99x2002 committed Jul 11, 2023
1 parent 83f0e73 commit 39289b9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ class DeleteAccountActivity :
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
setClickEvent()
}

private fun setClickEvent() {
with(binding) {
btnDeleteAccount.setOnClickListener {
DeleteAccountDialogFragment()
.show(supportFragmentManager, "DeleteAccountDialog")
}
}
}

override fun onClick(view: View?) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.sopt.umbba_android.presentation.setting

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.fragment.app.DialogFragment
import com.sopt.umbba_android.databinding.FragemntDeleteAccountDialogBinding


class DeleteAccountDialogFragment : DialogFragment() {

private var _binding: FragemntDeleteAccountDialogBinding? = null
private val binding get() = requireNotNull(_binding) { "DeleteAccountDialogFragment is null" }

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragemntDeleteAccountDialogBinding.inflate(inflater, container, false)
return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
backgroundDesign()
setBtnClickEvent()
}

private fun backgroundDesign() {
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
}

private fun setBtnClickEvent(){
with(binding){
btnCancel.setOnClickListener {
dismiss()
}
btnConfirm.setOnClickListener {
// TODO(탈퇴 API 연결 로직 넣기)
}
}
}

override fun onResume() {
super.onResume()
dialog?.window?.setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
}

override fun onDestroy() {
super.onDestroy()
_binding = null
}
}

0 comments on commit 39289b9

Please sign in to comment.