-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/sopt/umbba_android/presentation/setting/DeleteAccountDialogFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |