diff --git a/app/src/main/java/org/android/go/sopt/util/base/BindingDialogFragment.kt b/app/src/main/java/org/android/go/sopt/util/base/BindingDialogFragment.kt new file mode 100644 index 0000000..68641d0 --- /dev/null +++ b/app/src/main/java/org/android/go/sopt/util/base/BindingDialogFragment.kt @@ -0,0 +1,43 @@ +package org.android.go.sopt.util.base + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.WindowManager +import androidx.annotation.LayoutRes +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding +import androidx.fragment.app.DialogFragment +import org.android.go.sopt.R + +abstract class BindingDialogFragment(@LayoutRes private val layoutRes: Int) : + DialogFragment() { + private var _binding: B? = null + val binding get() = requireNotNull(_binding!!) { "${this::class.java.simpleName}에서 에러가 발생했습니다." } + + override fun onStart() { + super.onStart() + dialog?.window?.apply { + setLayout( + WindowManager.LayoutParams.MATCH_PARENT, + WindowManager.LayoutParams.WRAP_CONTENT, + ) + setBackgroundDrawableResource(R.color.transparent) + } + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle?, + ): View { + _binding = DataBindingUtil.inflate(inflater, layoutRes, container, false) + return binding.root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_sign_up.xml b/app/src/main/res/layout/activity_sign_up.xml index 8c8707c..9a2985e 100644 --- a/app/src/main/res/layout/activity_sign_up.xml +++ b/app/src/main/res/layout/activity_sign_up.xml @@ -3,7 +3,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - #64ffda #1de9b6 #00bfa5 + + #00FFFFFF \ No newline at end of file