package com.develop.base.mvvm

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding

abstract class BaseBindingFragment<T : ViewBinding> : BaseFragment() {

    protected lateinit var binding: T

    abstract fun createViewBinding(inflater: LayoutInflater, container: ViewGroup?): T

    open fun onPostCreateView() {}

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = createViewBinding(inflater, container)
        onPostCreateView()
        return binding.root
    }
}