作者 liyan

修改BaseFragment

1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4"> 2 <project version="4">
3 <component name="CompilerConfiguration"> 3 <component name="CompilerConfiguration">
4 - <bytecodeTargetLevel target="11" /> 4 + <bytecodeTargetLevel target="1.8" />
5 </component> 5 </component>
6 </project> 6 </project>
@@ -10,6 +10,7 @@ import androidx.core.content.ContextCompat.getColor @@ -10,6 +10,7 @@ import androidx.core.content.ContextCompat.getColor
10 import androidx.core.graphics.ColorUtils 10 import androidx.core.graphics.ColorUtils
11 import androidx.fragment.app.Fragment 11 import androidx.fragment.app.Fragment
12 import com.br_technology.securitytrain_master.R 12 import com.br_technology.securitytrain_master.R
  13 +import com.br_technology.securitytrain_master.databinding.ActivityAccountLoginBinding.inflate
13 import com.kingja.loadsir.core.LoadService 14 import com.kingja.loadsir.core.LoadService
14 import com.kingja.loadsir.core.LoadSir 15 import com.kingja.loadsir.core.LoadSir
15 import java.util.* 16 import java.util.*
@@ -31,10 +32,11 @@ abstract class BaseFragment : Fragment() { @@ -31,10 +32,11 @@ abstract class BaseFragment : Fragment() {
31 container: ViewGroup?, 32 container: ViewGroup?,
32 savedInstanceState: Bundle? 33 savedInstanceState: Bundle?
33 ): View? { 34 ): View? {
34 - val rootView = inflater.inflate(getLayoutId(), null)  
35 - loadService = LoadSir.getDefault().register(rootView) { reLoad() } 35 + val rootView = inflate(inflater, container,false)
  36 +// loadService = LoadSir.getDefault().register(rootView) { reLoad() }
36 // EventBus.getDefault().register(this) 37 // EventBus.getDefault().register(this)
37 - return loadService.loadLayout 38 +// return loadService.loadLayout
  39 + return rootView.root
38 } 40 }
39 41
40 override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 42 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
1 package com.wjx.android.wanandroidmvvm.base.view 1 package com.wjx.android.wanandroidmvvm.base.view
2 2
3 3
  4 +import android.os.Bundle
4 import android.text.TextUtils 5 import android.text.TextUtils
  6 +import android.view.LayoutInflater
  7 +import android.view.View
  8 +import android.view.ViewGroup
5 import android.widget.Toast 9 import android.widget.Toast
6 import androidx.lifecycle.Observer 10 import androidx.lifecycle.Observer
7 import androidx.lifecycle.ViewModelProvider 11 import androidx.lifecycle.ViewModelProvider
  12 +import androidx.viewbinding.ViewBinding
8 import com.br_technology.securitytrain_master.base.common.CommonUtil 13 import com.br_technology.securitytrain_master.base.common.CommonUtil
9 import com.br_technology.securitytrain_master.base.common.State 14 import com.br_technology.securitytrain_master.base.common.State
10 import com.br_technology.securitytrain_master.base.common.StateType 15 import com.br_technology.securitytrain_master.base.common.StateType
@@ -22,8 +27,21 @@ import com.wjx.android.wanandroidmvvm.common.callback.LoadingCallBack @@ -22,8 +27,21 @@ import com.wjx.android.wanandroidmvvm.common.callback.LoadingCallBack
22 * Time: 16:36 27 * Time: 16:36
23 */ 28 */
24 29
25 -abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() { 30 +abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>,VB : ViewBinding>(private val inflate: (LayoutInflater, ViewGroup?, Boolean) -> VB
  31 +) : BaseFragment() {
26 protected lateinit var mViewModel: VM 32 protected lateinit var mViewModel: VM
  33 + private var _binding: VB? = null
  34 + val binding: VB get() = _binding!!
  35 +
  36 +
  37 + override fun onCreateView(
  38 + inflater: LayoutInflater,
  39 + container: ViewGroup?,
  40 + savedInstanceState: Bundle?
  41 + ): View? {
  42 + _binding = inflate(inflater, container, false)
  43 + return binding.root
  44 + }
27 45
28 override fun initView() { 46 override fun initView() {
29 47
@@ -91,4 +109,9 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() { @@ -91,4 +109,9 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>> : BaseFragment() {
91 super.reLoad() 109 super.reLoad()
92 } 110 }
93 111
  112 + override fun onDestroyView() {
  113 + super.onDestroyView()
  114 + _binding = null
  115 + }
  116 +
94 } 117 }
1 package com.br_technology.securitytrain_master.ui.bank 1 package com.br_technology.securitytrain_master.ui.bank
2 2
3 import com.br_technology.securitytrain_master.R 3 import com.br_technology.securitytrain_master.R
  4 +import com.br_technology.securitytrain_master.databinding.FragmentBankBinding
4 import com.br_technology.securitytrain_master.ui.bank.viewmodel.BankViewModel 5 import com.br_technology.securitytrain_master.ui.bank.viewmodel.BankViewModel
5 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment 6 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
6 7
@@ -9,7 +10,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment @@ -9,7 +10,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
9 * auth:张继 10 * auth:张继
10 * des: 11 * des:
11 */ 12 */
12 -class BankFragment :BaseLifeCycleFragment<BankViewModel>() { 13 +class BankFragment :BaseLifeCycleFragment<BankViewModel,FragmentBankBinding>(FragmentBankBinding::inflate) {
13 override fun initDataObserver() { 14 override fun initDataObserver() {
14 15
15 } 16 }
@@ -11,6 +11,7 @@ import android.widget.TextView @@ -11,6 +11,7 @@ import android.widget.TextView
11 import androidx.fragment.app.Fragment 11 import androidx.fragment.app.Fragment
12 import androidx.recyclerview.widget.RecyclerView 12 import androidx.recyclerview.widget.RecyclerView
13 import com.br_technology.securitytrain_master.R 13 import com.br_technology.securitytrain_master.R
  14 +import com.br_technology.securitytrain_master.databinding.FragmentHomeBinding
14 import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity 15 import com.br_technology.securitytrain_master.ui.home.activity.DatabaseActivity
15 import com.br_technology.securitytrain_master.ui.home.activity.SearchActivity 16 import com.br_technology.securitytrain_master.ui.home.activity.SearchActivity
16 import com.br_technology.securitytrain_master.ui.home.activity.TextCourseActivity 17 import com.br_technology.securitytrain_master.ui.home.activity.TextCourseActivity
@@ -18,9 +19,11 @@ import com.br_technology.securitytrain_master.ui.home.adapter.RecommendDataAdapt @@ -18,9 +19,11 @@ import com.br_technology.securitytrain_master.ui.home.adapter.RecommendDataAdapt
18 import com.br_technology.securitytrain_master.ui.home.adapter.VideoCourseAdapter 19 import com.br_technology.securitytrain_master.ui.home.adapter.VideoCourseAdapter
19 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData 20 import com.br_technology.securitytrain_master.ui.home.pojo.RecommendData
20 import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse 21 import com.br_technology.securitytrain_master.ui.home.pojo.VideoCourse
  22 +import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel
21 import com.bumptech.glide.Glide 23 import com.bumptech.glide.Glide
22 import com.bumptech.glide.load.resource.bitmap.RoundedCorners 24 import com.bumptech.glide.load.resource.bitmap.RoundedCorners
23 import com.bumptech.glide.request.RequestOptions 25 import com.bumptech.glide.request.RequestOptions
  26 +import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
24 import com.youth.banner.Banner 27 import com.youth.banner.Banner
25 import com.youth.banner.adapter.BannerAdapter 28 import com.youth.banner.adapter.BannerAdapter
26 import com.youth.banner.adapter.BannerImageAdapter 29 import com.youth.banner.adapter.BannerImageAdapter
@@ -33,129 +36,129 @@ import com.youth.banner.indicator.CircleIndicator @@ -33,129 +36,129 @@ import com.youth.banner.indicator.CircleIndicator
33 * auth:张继 36 * auth:张继
34 * des: 37 * des:
35 */ 38 */
36 -//class HomeFragment :BaseLifeCycleFragment<MineViewModel>() {  
37 -// override fun initDataObserver() {  
38 -//  
39 -// }  
40 -//  
41 -// override fun getLayoutId(): Int {  
42 -// return R.layout.fragment_home  
43 -// }  
44 -//}  
45 -class HomeFragment : Fragment() {  
46 - override fun onCreateView(  
47 - inflater: LayoutInflater,  
48 - container: ViewGroup?,  
49 - savedInstanceState: Bundle?  
50 - ): View? {  
51 - return inflater.inflate(R.layout.fragment_home, container, false)  
52 - }  
53 -  
54 - override fun onViewCreated(view: View, savedInstanceState: Bundle?) {  
55 - super.onViewCreated(view, savedInstanceState)  
56 -  
57 -  
58 - val banner: Banner<Int, BannerImageAdapter<Int>> = view.findViewById(R.id.banner)  
59 - banner.setAdapter(object : BannerImageAdapter<Int>(  
60 - mutableListOf(  
61 - R.mipmap.banner,  
62 - R.mipmap.banner,  
63 - R.mipmap.banner  
64 - )  
65 - ) {  
66 - override fun onBindView(  
67 - holder: BannerImageHolder,  
68 - data: Int,  
69 - position: Int,  
70 - size: Int  
71 - ) {  
72 - Glide.with(requireActivity())  
73 - .load(data)  
74 - .apply(RequestOptions.bitmapTransform(RoundedCorners(8)))  
75 - .into(holder.imageView)  
76 -  
77 - }  
78 - }).addBannerLifecycleObserver(this)  
79 - .indicator = CircleIndicator(requireContext())  
80 -  
81 - // 共享资料库  
82 - view.findViewById<TextView>(R.id.database).setOnClickListener {  
83 - startActivity(DatabaseActivity::class.java)  
84 - }  
85 -  
86 - // 共享资料库  
87 - view.findViewById<TextView>(R.id.txt_course).setOnClickListener {  
88 - startActivity(TextCourseActivity::class.java)  
89 - }  
90 - // 在线课程  
91 - view.findViewById<TextView>(R.id.online_course).setOnClickListener {  
92 -// startActivity()  
93 - }  
94 -  
95 - // 视频课程  
96 - val videoCourse: RecyclerView = view.findViewById(R.id.video_course)  
97 - videoCourse.addItemDecoration(object : RecyclerView.ItemDecoration() {  
98 - override fun getItemOffsets(  
99 - outRect: Rect,  
100 - view: View,  
101 - parent: RecyclerView,  
102 - state: RecyclerView.State  
103 - ) {  
104 - super.getItemOffsets(outRect, view, parent, state)  
105 - if (parent.getChildAdapterPosition(view) % 2 == 0) {  
106 - outRect.top = 24  
107 - outRect.right = 15  
108 - } else {  
109 - outRect.top = 24  
110 - outRect.left = 15  
111 - }  
112 - }  
113 - })  
114 - val videoCourseAdapter = VideoCourseAdapter()  
115 - val list = mutableListOf(  
116 - VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),  
117 - VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),  
118 - VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),  
119 - VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),  
120 - )  
121 - videoCourse.adapter = videoCourseAdapter  
122 - videoCourseAdapter.addList(list)  
123 -  
124 - val recommendData: RecyclerView = view.findViewById(R.id.recommended_data)  
125 - val recommendDataAdapter = RecommendDataAdapter()  
126 - val recommendList = mutableListOf(  
127 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
128 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
129 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
130 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
131 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
132 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
133 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
134 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
135 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
136 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
137 - RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),  
138 - )  
139 - recommendData.adapter = recommendDataAdapter  
140 - recommendDataAdapter.addList(recommendList)  
141 -  
142 -  
143 - view.findViewById<View>(R.id.search).setOnClickListener {  
144 - val intent = Intent(requireActivity(), SearchActivity::class.java)  
145 - startActivity(intent)  
146 - }  
147 - }  
148 - 39 +class HomeFragment : BaseLifeCycleFragment<MineViewModel,FragmentHomeBinding>(FragmentHomeBinding::inflate) {
  40 + override fun initDataObserver() {
149 41
150 - private fun startActivity(cls: Class<out Activity>) {  
151 - startActivity(cls, null)  
152 } 42 }
153 43
154 - private fun startActivity(cls: Class<out Activity>, bundle: Bundle?) {  
155 - val intent = Intent(requireActivity(), cls)  
156 - if (bundle != null) {  
157 - intent.putExtras(bundle)  
158 - }  
159 - startActivity(intent) 44 + override fun getLayoutId(): Int {
  45 + return R.layout.fragment_home
160 } 46 }
161 -}  
  47 +}
  48 +//class HomeFragment : Fragment() {
  49 +// override fun onCreateView(
  50 +// inflater: LayoutInflater,
  51 +// container: ViewGroup?,
  52 +// savedInstanceState: Bundle?
  53 +// ): View? {
  54 +// return inflater.inflate(R.layout.fragment_home, container, false)
  55 +// }
  56 +//
  57 +// override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  58 +// super.onViewCreated(view, savedInstanceState)
  59 +//
  60 +//
  61 +// val banner: Banner<Int, BannerImageAdapter<Int>> = view.findViewById(R.id.banner)
  62 +// banner.setAdapter(object : BannerImageAdapter<Int>(
  63 +// mutableListOf(
  64 +// R.mipmap.banner,
  65 +// R.mipmap.banner,
  66 +// R.mipmap.banner
  67 +// )
  68 +// ) {
  69 +// override fun onBindView(
  70 +// holder: BannerImageHolder,
  71 +// data: Int,
  72 +// position: Int,
  73 +// size: Int
  74 +// ) {
  75 +// Glide.with(requireActivity())
  76 +// .load(data)
  77 +// .apply(RequestOptions.bitmapTransform(RoundedCorners(8)))
  78 +// .into(holder.imageView)
  79 +//
  80 +// }
  81 +// }).addBannerLifecycleObserver(this)
  82 +// .indicator = CircleIndicator(requireContext())
  83 +//
  84 +// // 共享资料库
  85 +// view.findViewById<TextView>(R.id.database).setOnClickListener {
  86 +// startActivity(DatabaseActivity::class.java)
  87 +// }
  88 +//
  89 +// // 共享资料库
  90 +// view.findViewById<TextView>(R.id.txt_course).setOnClickListener {
  91 +// startActivity(TextCourseActivity::class.java)
  92 +// }
  93 +// // 在线课程
  94 +// view.findViewById<TextView>(R.id.online_course).setOnClickListener {
  95 +//// startActivity()
  96 +// }
  97 +//
  98 +// // 视频课程
  99 +// val videoCourse: RecyclerView = view.findViewById(R.id.video_course)
  100 +// videoCourse.addItemDecoration(object : RecyclerView.ItemDecoration() {
  101 +// override fun getItemOffsets(
  102 +// outRect: Rect,
  103 +// view: View,
  104 +// parent: RecyclerView,
  105 +// state: RecyclerView.State
  106 +// ) {
  107 +// super.getItemOffsets(outRect, view, parent, state)
  108 +// if (parent.getChildAdapterPosition(view) % 2 == 0) {
  109 +// outRect.top = 24
  110 +// outRect.right = 15
  111 +// } else {
  112 +// outRect.top = 24
  113 +// outRect.left = 15
  114 +// }
  115 +// }
  116 +// })
  117 +// val videoCourseAdapter = VideoCourseAdapter()
  118 +// val list = mutableListOf(
  119 +// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  120 +// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  121 +// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  122 +// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"),
  123 +// )
  124 +// videoCourse.adapter = videoCourseAdapter
  125 +// videoCourseAdapter.addList(list)
  126 +//
  127 +// val recommendData: RecyclerView = view.findViewById(R.id.recommended_data)
  128 +// val recommendDataAdapter = RecommendDataAdapter()
  129 +// val recommendList = mutableListOf(
  130 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  131 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  132 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  133 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  134 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  135 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  136 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  137 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  138 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  139 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  140 +// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"),
  141 +// )
  142 +// recommendData.adapter = recommendDataAdapter
  143 +// recommendDataAdapter.addList(recommendList)
  144 +//
  145 +//
  146 +// view.findViewById<View>(R.id.search).setOnClickListener {
  147 +// val intent = Intent(requireActivity(), SearchActivity::class.java)
  148 +// startActivity(intent)
  149 +// }
  150 +// }
  151 +//
  152 +//
  153 +// private fun startActivity(cls: Class<out Activity>) {
  154 +// startActivity(cls, null)
  155 +// }
  156 +//
  157 +// private fun startActivity(cls: Class<out Activity>, bundle: Bundle?) {
  158 +// val intent = Intent(requireActivity(), cls)
  159 +// if (bundle != null) {
  160 +// intent.putExtras(bundle)
  161 +// }
  162 +// startActivity(intent)
  163 +// }
  164 +//}
1 package com.br_technology.securitytrain_master.ui.main 1 package com.br_technology.securitytrain_master.ui.main
2 2
3 import android.os.Bundle 3 import android.os.Bundle
  4 +import androidx.fragment.app.Fragment
4 import androidx.fragment.app.FragmentPagerAdapter 5 import androidx.fragment.app.FragmentPagerAdapter
5 import com.br_technology.securitytrain_master.R 6 import com.br_technology.securitytrain_master.R
6 import com.br_technology.securitytrain_master.databinding.ActivityMainBinding 7 import com.br_technology.securitytrain_master.databinding.ActivityMainBinding
@@ -29,7 +30,7 @@ class MainActivity : @@ -29,7 +30,7 @@ class MainActivity :
29 ) 30 )
30 binding.apply { 31 binding.apply {
31 viewPage.adapter = mainAdapter 32 viewPage.adapter = mainAdapter
32 - mainAdapter.addData(list) 33 + mainAdapter.addData(list as List<Fragment>)
33 viewPage.offscreenPageLimit = 1 34 viewPage.offscreenPageLimit = 1
34 home.isChecked = true 35 home.isChecked = true
35 36
@@ -19,7 +19,7 @@ class MainViewModel:BaseViewModel<MainRepository>() { @@ -19,7 +19,7 @@ class MainViewModel:BaseViewModel<MainRepository>() {
19 } 19 }
20 init { 20 init {
21 val list= listOf(HomeFragment(),BankFragment(),MineFragment()) 21 val list= listOf(HomeFragment(),BankFragment(),MineFragment())
22 - liveData.postValue(list) 22 + liveData.postValue(list as List<Fragment>?)
23 } 23 }
24 24
25 25
1 package com.br_technology.securitytrain_master.ui.home 1 package com.br_technology.securitytrain_master.ui.home
2 2
  3 +import android.app.Fragment
3 import com.br_technology.securitytrain_master.R 4 import com.br_technology.securitytrain_master.R
  5 +import com.br_technology.securitytrain_master.databinding.FragmentMineBinding
4 import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel 6 import com.br_technology.securitytrain_master.ui.home.viewmodel.MineViewModel
5 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment 7 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
6 8
@@ -9,7 +11,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment @@ -9,7 +11,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
9 * auth:张继 11 * auth:张继
10 * des: 12 * des:
11 */ 13 */
12 -class MineFragment :BaseLifeCycleFragment<MineViewModel>() { 14 +class MineFragment :BaseLifeCycleFragment<MineViewModel,FragmentMineBinding>(FragmentMineBinding::inflate) {
13 override fun initDataObserver() { 15 override fun initDataObserver() {
14 16
15 } 17 }