package com.rehome.sgbaxj.base

/**
 *   Create By HuangWenFei
 *   创建日期：2023-07-25 14:14
 *   描述：
 */

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

abstract class BaseFragmentKotlinViewBinding<T : ViewBinding?> : Fragment() {
    protected var binding: T? = null
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = getBinding(inflater, container)
        return binding!!.root
    }

    protected abstract fun getBinding(inflater: LayoutInflater?, container: ViewGroup?): T
    override fun onDestroyView() {
        super.onDestroyView()
        binding = null
    }
}