ParentBindingViewDialogFragment

Base DialogFragment with ViewBinding support and single-shot ViewModel event collection.
Manages binding lifecycle safely and resets onDestroyView().

ViewBinding 지원과 단일 ViewModel 이벤트 수집을 제공하는 기본 DialogFragment입니다.
바인딩 생명주기를 안전하게 관리하고 onDestroyView()에서 초기화합니다.

Key points:

  • Call super.onViewCreated().

  • onEventVmCollect() is invoked once after binding initialization.

  • In DialogFragment, keeping the default false for isAttachToParent is recommended unless there is a verified special case.

    핵심 포인트:

  • super.onViewCreated()를 반드시 호출하세요.

  • onEventVmCollect()는 바인딩 초기화 이후 1회 호출됩니다.

  • DialogFragment에서는 특별한 경우가 아니라면 isAttachToParent의 기본값 false 사용을 권장합니다.

Parameters

BINDING

The type of ViewBinding to be used.

사용할 ViewBinding 타입.

Inheritors

Constructors

Link copied to clipboard
constructor()
constructor(isAttachToParent: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val context: Context?
Link copied to clipboard
open val dialog: Dialog?
Link copied to clipboard
Link copied to clipboard
open var exitTransition: Any?
Link copied to clipboard
Link copied to clipboard
val host: Any?
Link copied to clipboard
val id: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tag: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val theme: Int
Link copied to clipboard
Link copied to clipboard
open val view: View?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun consumeOrphanedDeniedResults(): List<OrphanedDeniedRequestResult>

Returns and clears denied results that lost their callbacks after process restore.
Call this in onCreate to handle results from requests that were interrupted by process kill.

프로세스 복원 후 콜백을 잃은 거부 결과를 반환하고 비웁니다.
프로세스 킬로 중단된 요청의 결과를 처리하려면 onCreate에서 호출하세요.

Link copied to clipboard
open fun dismiss()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun dump(@NonNull prefix: String, @Nullable fd: FileDescriptor?, @NonNull writer: PrintWriter, @Nullable args: Array<out String?>??)
Link copied to clipboard
fun getString(@StringRes resId: Int, @Nullable vararg formatArgs: Any?): String
Link copied to clipboard
Link copied to clipboard
open fun onActivityCreated(@Nullable savedInstanceState: Bundle?)
Link copied to clipboard
open fun onActivityResult(requestCode: Int, resultCode: Int, @Nullable data: Intent?)
Link copied to clipboard
open fun onAttach(@NonNull context: Context)
Link copied to clipboard
open fun onAttachFragment(@NonNull childFragment: Fragment)
Link copied to clipboard
open fun onBindingCreated(binding: BINDING, savedInstanceState: Bundle?)

Called immediately after the binding object is created, inside onCreateView().
Use only for binding variable assignment (e.g. binding.vm = vm).
Do NOT access viewLifecycleOwner, start collectors, or call lifecycle-aware APIs here — viewLifecycleOwner is not yet available at this point.

onCreateView() 내부에서 바인딩 객체가 생성된 직후 호출됩니다.
바인딩 변수 할당(예: binding.vm = vm)에만 사용하세요.
viewLifecycleOwner 접근, collector 시작, lifecycle-aware API 호출은 금지입니다 — 이 시점에서는 viewLifecycleOwner를 아직 사용할 수 없습니다.

Link copied to clipboard
open fun onCancel(@NonNull dialog: DialogInterface)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onCreate(savedInstanceState: Bundle?)
Link copied to clipboard
open fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation?
Link copied to clipboard
open fun onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int): Animator?
Link copied to clipboard
open override fun onCreateDialog(savedInstanceState: Bundle?): Dialog
Link copied to clipboard
Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onDestroyView()

Cleans up binding and resets helper state.
Always call super.onDestroyView().

바인딩을 정리하고 헬퍼 상태를 초기화합니다.
반드시 super.onDestroyView()를 호출하세요.

Link copied to clipboard
open fun onDetach()
Link copied to clipboard
open fun onDismiss(@NonNull dialog: DialogInterface)
Link copied to clipboard
open fun onEventVmCollect(binding: BINDING)

Called to start collecting ViewModel events.
Typically invoked once per lifecycle (e.g., onCreate or onViewCreated).

ViewModel 이벤트 수집을 시작할 때 호출됩니다.
보통 생명주기 당 1회(onCreate 또는 onViewCreated) 호출됩니다.

Link copied to clipboard
open fun onGetLayoutInflater(@Nullable savedInstanceState: Bundle?): LayoutInflater
Link copied to clipboard
Link copied to clipboard
open fun onInflate(@NonNull activity: Activity, @NonNull attrs: AttributeSet, @Nullable savedInstanceState: Bundle?)
open fun onInflate(@NonNull context: Context, @NonNull attrs: AttributeSet, @Nullable savedInstanceState: Bundle?)
Link copied to clipboard
Link copied to clipboard
open fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun onPrimaryNavigationFragmentChanged(isPrimaryNavigationFragment: Boolean)
Link copied to clipboard
open fun onRequestPermissionsResult(requestCode: Int, @NonNull permissions: Array<out String?>, @NonNull grantResults: IntArray)
Link copied to clipboard
Link copied to clipboard
open override fun onSaveInstanceState(outState: Bundle)
Link copied to clipboard
open fun onStart()
Link copied to clipboard
open fun onStop()
Link copied to clipboard
open fun onViewCreated(binding: BINDING, savedInstanceState: Bundle?)

Called when the binding is initialized in onViewCreated().
Implement setup logic that requires binding here.

onViewCreated에서 바인딩이 초기화된 후 호출됩니다.
바인딩이 필요한 초기화 로직을 여기서 수행하세요.

open override fun onViewCreated(view: View, savedInstanceState: Bundle?)
Link copied to clipboard
open fun onViewStateRestored(@Nullable savedInstanceState: Bundle?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun requestPermissions(@NonNull permissions: Array<out String?>, requestCode: Int)

override fun requestPermissions(permissions: List<String>, onDeniedResult: (List<PermissionDeniedItem>) -> Unit)

Requests permissions using the delegate.
Call only after the Fragment is attached (isAdded == true).

델리게이트를 사용하여 권한을 요청합니다.
Fragment가 attach된 이후(isAdded == true)에만 호출하세요.

override fun requestPermissions(permissions: List<String>, onDeniedResult: (List<PermissionDeniedItem>) -> Unit, onRationaleNeeded: (PermissionRationaleRequest) -> Unit?, onNavigateToSettings: (PermissionSettingsRequest) -> Unit?)

Requests multiple permissions and returns denied results via callback.

여러 권한을 요청하고 거부 결과를 콜백으로 반환합니다.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Safely dismisses the dialog with exception handling.
Catches any exceptions that may occur during dismissal.

예외 처리와 함께 다이얼로그를 안전하게 닫습니다.
닫는 동안 발생할 수 있는 모든 예외를 잡습니다.

Link copied to clipboard
fun safeShow(fragmentManager: FragmentManager, tag: String)

Safely shows the dialog with exception handling.
Catches any exceptions that may occur during showing.

예외 처리와 함께 다이얼로그를 안전하게 표시합니다.
표시하는 동안 발생할 수 있는 모든 예외를 잡습니다.

Link copied to clipboard

Sets the custom animation style for dialog appearance/disappearance.
Applied immediately if dialog is already showing.

다이얼로그 나타남/사라짐에 대한 커스텀 애니메이션 스타일을 설정합니다.
다이얼로그가 이미 표시 중인 경우 즉시 적용됩니다.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setCancelableDialog(cancelable: Boolean)

Sets whether the dialog can be canceled by pressing back button or touching outside.
Applied immediately if dialog is already showing.

뒤로 가기 버튼을 누르거나 외부를 터치하여 다이얼로그를 취소할 수 있는지 설정합니다.
다이얼로그가 이미 표시 중인 경우 즉시 적용됩니다.

Link copied to clipboard
fun setDialogGravity(gravity: Int)

Sets the position of the dialog on screen.
Applied immediately if dialog is already showing.

화면에서 다이얼로그의 위치를 설정합니다.
다이얼로그가 이미 표시 중인 경우 즉시 적용됩니다.

Link copied to clipboard
open fun setHasOptionsMenu(hasMenu: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun setMenuVisibility(menuVisible: Boolean)
Link copied to clipboard
open fun setStyle(style: Int, @StyleRes theme: Int)
Link copied to clipboard
open fun setTargetFragment(@Nullable fragment: Fragment?, requestCode: Int)
Link copied to clipboard
Link copied to clipboard
open fun show(@NonNull manager: FragmentManager, @Nullable tag: String?)
open fun show(@NonNull transaction: FragmentTransaction, @Nullable tag: String?): Int
Link copied to clipboard
open fun showNow(@NonNull manager: FragmentManager, @Nullable tag: String?)
Link copied to clipboard
fun Fragment.snackBarShowIndefinite(msg: CharSequence, snackBarOption: SnackBarOption? = null)

Creates and shows an indefinite duration Snackbar from a Fragment.
Logs an error if the Fragment's view is null.

Fragment에서 무제한 시간 Snackbar를 생성하고 표시합니다.
Fragment의 view가 null이면 에러를 로깅합니다.

Link copied to clipboard
fun Fragment.snackBarShowLong(msg: CharSequence, snackBarOption: SnackBarOption? = null)

Creates and shows a long duration Snackbar from a Fragment.
Logs an error if the Fragment's view is null.

Fragment에서 긴 시간 Snackbar를 생성하고 표시합니다.
Fragment의 view가 null이면 에러를 로깅합니다.

Link copied to clipboard
fun Fragment.snackBarShowShort(msg: CharSequence, snackBarOption: SnackBarOption? = null)

Creates and shows a short duration Snackbar from a Fragment.
Logs an error if the Fragment's view is null.

Fragment에서 짧은 시간 Snackbar를 생성하고 표시합니다.
Fragment의 view가 null이면 에러를 로깅합니다.

Link copied to clipboard
open fun startActivity(intent: Intent?)
open fun startActivity(intent: Intent?, @Nullable options: Bundle?)
Link copied to clipboard
open fun startActivityForResult(intent: Intent?, requestCode: Int)
open fun startActivityForResult(intent: Intent?, requestCode: Int, @Nullable options: Bundle?)
Link copied to clipboard
open fun startIntentSenderForResult(intent: IntentSender?, requestCode: Int, @Nullable fillInIntent: Intent?, flagsMask: Int, flagsValues: Int, extraFlags: Int, @Nullable options: Bundle?)
Link copied to clipboard
Link copied to clipboard

Creates and shows a long duration Toast message from a Fragment.
Logs an error if the Fragment's context is null.

Fragment에서 긴 시간 Toast 메시지를 생성하고 표시합니다.
Fragment의 context가 null이면 에러를 로깅합니다.

Link copied to clipboard

Creates and shows a short duration Toast message from a Fragment.
Logs an error if the Fragment's context is null.

Fragment에서 짧은 시간 Toast 메시지를 생성하고 표시합니다.
Fragment의 context가 null이면 에러를 로깅합니다.

Link copied to clipboard
Link copied to clipboard
inline fun Fragment.withContext(errorMessage: String = "Fragment context is null", block: (Context) -> Unit): Boolean

Executes the given block if the Fragment's context is not null.
Logs an error if the context is null.

Fragment의 context가 null이 아닌 경우 주어진 블록을 실행합니다.
context가 null이면 에러를 로깅합니다.

Link copied to clipboard
inline fun <T> Fragment.withContextResult(errorMessage: String = "Fragment context is null", block: (Context) -> T): T?

Executes the given block and returns a result if the Fragment's context is not null.
Returns null and logs an error if the context is null.

Fragment의 context가 null이 아닌 경우 주어진 블록을 실행하고 결과를 반환합니다.
context가 null이면 null을 반환하고 에러를 로깅합니다.

Link copied to clipboard
inline fun Fragment.withView(errorMessage: String = "Fragment view is null", block: (View) -> Unit): Boolean

Executes the given block if the Fragment's view is not null.
Logs an error if the view is null.

Fragment의 view가 null이 아닌 경우 주어진 블록을 실행합니다.
view가 null이면 에러를 로깅합니다.

Link copied to clipboard
inline fun <T> Fragment.withViewResult(errorMessage: String = "Fragment view is null", block: (View) -> T): T?

Executes the given block and returns a result if the Fragment's view is not null.
Returns null and logs an error if the view is null.

Fragment의 view가 null이 아닌 경우 주어진 블록을 실행하고 결과를 반환합니다.
view가 null이면 null을 반환하고 에러를 로깅합니다.