package com.develop.food.base.ui

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

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

    protected lateinit var binding: T

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

    abstract fun onPostCreateView()

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