Commit c3d60e98 authored by wanglei's avatar wanglei

...

parent 884ede83
......@@ -56,7 +56,10 @@ abstract class BaseFragment<VB : ViewBinding>(
open fun onResumeOneShoot() = Unit
private var onResumeOneShootI = 0
private var onResumeI = 0
override fun onResume() {
onResumeI++
LogEx.logDebug(TAG, "lifecycle $tagNo onResume ${javaClass.simpleName} $onResumeI")
if (!fragmentInit) {
onResumeOneShoot()
onResumeOneShootI++
......@@ -75,6 +78,13 @@ abstract class BaseFragment<VB : ViewBinding>(
LogEx.logDebug(TAG, "lifecycle $tagNo onDestroyView ${javaClass.simpleName} $onDestroyViewI")
}
private var onPauseI = 0
override fun onPause() {
super.onPause()
onPauseI++
LogEx.logDebug(TAG, "lifecycle $tagNo onPause ${javaClass.simpleName} $onPauseI")
}
private var onStopI = 0
override fun onStop() {
super.onStop()
......
......@@ -45,12 +45,30 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
super.initView()
binding.flTop.updatePadding(top = BarUtils.getStatusBarHeight())
}
override fun onResume() {
super.onResume()
immersionBar {
statusBarColor("#FFFFFFFF")
statusBarDarkFont(true)
}
if (adsConfigBean.historyShowNative) {
if (viewModel.showHistoryTabNative()) {
binding.flAd.visibility = View.VISIBLE
AdsMgr.showNative(binding.flAd, R.layout.layout_admob_item)
} else {
binding.flAd.visibility = View.GONE
}
} else {
binding.flAd.visibility = View.GONE
}
}
override fun onResumeOneShoot() {
super.onResumeOneShoot()
initAdapter()
viewModel.initData()
}
private fun initAdapter() {
......@@ -210,17 +228,6 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
val activity = requireActivity() as MainActivity?
activity?.runOnUiThread {
uiRefresh.invoke()
if (adsConfigBean.historyShowNative) {
if (viewModel.showHistoryTabNative()) {
binding.flAd.visibility = View.VISIBLE
AdsMgr.showNative(binding.flAd, R.layout.layout_admob_item)
} else {
binding.flAd.visibility = View.GONE
}
} else {
binding.flAd.visibility = View.GONE
}
}
}
}
......@@ -253,13 +260,6 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
return createList
}
override fun onResume() {
super.onResume()
immersionBar {
statusBarColor("#FFFFFFFF")
statusBarDarkFont(true)
}
}
companion object {
......
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