Parents Binding Fragment
Base Fragment with ViewBinding support and single-shot ViewModel event collection.
Manages binding lifecycle safely and resets onDestroyView().
ViewBinding 지원과 단일 ViewModel 이벤트 수집을 제공하는 기본 Fragment입니다.
바인딩 생명주기를 안전하게 관리하고 onDestroyView()에서 초기화합니다.
Key points:
Call super.onCreateView() and super.onViewCreated().
onEventVmCollect() is invoked once after binding initialization.
In Fragment, keeping the default
falsefor isAttachToParent is recommended unless there is a verified special case.
핵심 포인트:super.onCreateView()와 super.onViewCreated()를 반드시 호출하세요.
onEventVmCollect()는 바인딩 초기화 이후 1회 호출됩니다.
Fragment에서는 특별한 경우가 아니라면 isAttachToParent의 기본값
false사용을 권장합니다.
Parameters
The type of ViewBinding to be used.
사용할 ViewBinding 타입.
Whether to attach the inflated view to the parent container.
레이아웃을 부모 컨테이너에 attach할지 여부.
Fragment에서는 특별한 경우가 아니라면 false 유지가 안전합니다.
Inheritors
Properties
Functions
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를 아직 사용할 수 없습니다.
Cleans up binding and resets helper state.
Always call super.onDestroyView().
바인딩을 정리하고 헬퍼 상태를 초기화합니다.
반드시 super.onDestroyView()를 호출하세요.
Called to start collecting ViewModel events.
Typically invoked once per lifecycle (e.g., onCreate or onViewCreated).
ViewModel 이벤트 수집을 시작할 때 호출됩니다.
보통 생명주기 당 1회(onCreate 또는 onViewCreated) 호출됩니다.
Called when the binding is initialized in onViewCreated().
Implement setup logic that requires binding here.
onViewCreated에서 바인딩이 초기화된 후 호출됩니다.
바인딩이 필요한 초기화 로직을 여기서 수행하세요.
Requests permissions using the delegate.
Call only after the Fragment is attached (isAdded == true).
델리게이트를 사용하여 권한을 요청합니다.
Fragment가 attach된 이후(isAdded == true)에만 호출하세요.
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이면 에러를 로깅합니다.
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이면 에러를 로깅합니다.
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이면 에러를 로깅합니다.
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이면 에러를 로깅합니다.
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이면 에러를 로깅합니다.
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을 반환하고 에러를 로깅합니다.
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을 반환하고 에러를 로깅합니다.