[6.0.0] 1、删除无用类
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
package com.mogo.och.taxi.base
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/7/24
|
||||
*/
|
||||
abstract class BaseTaxiUIFragment : Fragment() {
|
||||
private var mRootView: View? = null
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
if (mRootView == null) {
|
||||
mRootView = inflater.inflate(getLayoutId(), container, false)
|
||||
} else {
|
||||
val viewGroup = mRootView!!.parent as ViewGroup
|
||||
viewGroup?.removeView(mRootView)
|
||||
}
|
||||
mRootView?.let { initViews(it) }
|
||||
initViews(savedInstanceState)
|
||||
return mRootView
|
||||
}
|
||||
|
||||
/**
|
||||
* 布局资源
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected abstract fun getLayoutId(): Int
|
||||
protected abstract fun initViews(view: View)
|
||||
protected open fun initViews(savedInstanceState: Bundle?) {}
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
mRootView = null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user