Commit 665c2166 authored by wanglei's avatar wanglei

...

parent c3d60e98
...@@ -91,7 +91,7 @@ object MyNotificationManager { ...@@ -91,7 +91,7 @@ object MyNotificationManager {
val next = actionIdList[0] val next = actionIdList[0]
actionIdList.removeAt(0) actionIdList.removeAt(0)
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
return ACTION_ID_WEATHER_2 return ACTION_ID_EARTHQUAKE
} }
return next return next
} }
......
...@@ -45,6 +45,7 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind ...@@ -45,6 +45,7 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
super.initView() super.initView()
binding.flTop.updatePadding(top = BarUtils.getStatusBarHeight()) binding.flTop.updatePadding(top = BarUtils.getStatusBarHeight())
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
immersionBar { immersionBar {
...@@ -52,16 +53,6 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind ...@@ -52,16 +53,6 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
statusBarDarkFont(true) 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
}
} }
...@@ -218,7 +209,19 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind ...@@ -218,7 +209,19 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
val createList = viewModel.historyList.filter { it.createType == qrState } val createList = viewModel.historyList.filter { it.createType == qrState }
binding.llEmpty.isVisible = createList.isEmpty() binding.llEmpty.isVisible = createList.isEmpty()
val sortList = sortList(createList) val sortList = sortList(createList)
adapter?.submitList(sortList.addStepElements { AdScanBean() }) val adBeanList = sortList.addStepElements { AdScanBean() }
adapter?.submitList(adBeanList)
if (adsConfigBean.historyShowNative) {
if (adBeanList.any { it is AdScanBean }) {
binding.flAd.visibility = View.GONE
} else {
binding.flAd.visibility = View.VISIBLE
AdsMgr.showNative(binding.flAd, R.layout.layout_admob_item)
}
} else {
binding.flAd.visibility = View.GONE
}
} }
if (viewModel.dataRefreshFinish.get()) { if (viewModel.dataRefreshFinish.get()) {
uiRefresh.invoke() uiRefresh.invoke()
...@@ -261,7 +264,6 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind ...@@ -261,7 +264,6 @@ class HistoryFragment : BaseFragment<FragmentHistoryBinding>(FragmentHistoryBind
} }
companion object { companion object {
var tab: Int = 0 // create=0 scan=1 var tab: Int = 0 // create=0 scan=1
const val SORT_NAME = "sort_name" const val SORT_NAME = "sort_name"
......
...@@ -26,12 +26,6 @@ class HistoryViewModel() : ViewModel() { ...@@ -26,12 +26,6 @@ class HistoryViewModel() : ViewModel() {
var historyList = arrayListOf<ScanBean>() var historyList = arrayListOf<ScanBean>()
fun showHistoryTabNative(): Boolean {
return historyList.filter { it.createType == CREATE_TYPE_USER }.size < 3 &&
historyList.filter { it.createType == CREATE_TYPE_SCAN }.size < 3
}
var dataRefreshFinish = AtomicBoolean(false) var dataRefreshFinish = AtomicBoolean(false)
var dataRefreshBack: (() -> Unit)? = null var dataRefreshBack: (() -> Unit)? = null
......
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