Commit c315a47a authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 284aa6af
...@@ -383,11 +383,22 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -383,11 +383,22 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
super.onHiddenChanged(hidden) super.onHiddenChanged(hidden)
if (isHidden) { // if (isHidden) {
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onPause() // vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onPause()
} else { // } else {
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onResume() // vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onResume()
} // }
}
override fun onFragmentResume(firstResume: Boolean) {
super.onFragmentResume(firstResume)
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onResume()
}
override fun onPause() {
super.onPause()
vpAdapter?.getFragments()?.get(mSelectTabIndex)?.onPause()
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment