Commit 13124cb9 authored by wanglei's avatar wanglei

...

parent 574d1f45
...@@ -52,14 +52,16 @@ class MyApplication : BaseApplication() { ...@@ -52,14 +52,16 @@ class MyApplication : BaseApplication() {
} }
} }
fun initApp(isFirst:Boolean=false) {
fun initApp() { if (!isFirst){
val topic = ConfigHelper.packageName + "_push" val topic = ConfigHelper.packageName + "_push"
FCMManager.initFirebase(this) FCMManager.initFirebase(this)
FCMManager.subscribeToTopic(topic) FCMManager.subscribeToTopic(topic)
LogEx.logDebug(TAG, "topic=${topic}") LogEx.logDebug(TAG, "topic=${topic}")
ScreenStatusReceiver.setupScreenStatusListener(this) ScreenStatusReceiver.setupScreenStatusListener(this)
InstallHelps.init() InstallHelps.init()
}
if (ifAgreePrivacy) { if (ifAgreePrivacy) {
AdmobMaxHelper.initAdmobMaxAd() AdmobMaxHelper.initAdmobMaxAd()
MainScope().launch(Dispatchers.Main) { MainScope().launch(Dispatchers.Main) {
......
...@@ -32,8 +32,10 @@ import com.base.datarecovery.help.BaseActivity ...@@ -32,8 +32,10 @@ import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.KotlinExt.toFormatSize import com.base.datarecovery.help.KotlinExt.toFormatSize
import com.base.datarecovery.utils.BarUtils import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.utils.AppPreferences import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.LogEx
class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() { class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
private val TAG = "ResultActivity"
override val binding: ActivityLayoutResultBinding by lazy { override val binding: ActivityLayoutResultBinding by lazy {
ActivityLayoutResultBinding.inflate(layoutInflater) ActivityLayoutResultBinding.inflate(layoutInflater)
...@@ -93,11 +95,11 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() { ...@@ -93,11 +95,11 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
adapter.updateListPosition() adapter.updateListPosition()
adapter.notifyDataSetChanged() adapter.notifyDataSetChanged()
val from = intent.getStringExtra("from") val from = intent.extras?.getString("from")
LogEx.logDebug(TAG, "from=$from")
when (from) { when (from) {
JUNK_CLEANER -> { JUNK_CLEANER -> {
if (intent.getLongExtra("clean_size", 0L) > 0) { if (intent.getLongExtra("clean_size", 0L) > 0) {
val size = intent.getLongExtra("clean_size", 0L).toFormatSize(1) val size = intent.getLongExtra("clean_size", 0L).toFormatSize(1)
binding.tvInfo.text = "Cleaned up $size" binding.tvInfo.text = "Cleaned up $size"
} else { } else {
...@@ -132,7 +134,7 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() { ...@@ -132,7 +134,7 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
binding.ivBack.setOnClickListener { binding.ivBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed() onBackPressedDispatcher.onBackPressed()
} }
AdmobMaxHelper.admobMaxShowNativeAd(this@ResultActivity,binding.flAd) AdmobMaxHelper.admobMaxShowNativeAd(this@ResultActivity, binding.flAd)
} }
override fun onDestroy() { override fun onDestroy() {
......
...@@ -204,7 +204,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() { ...@@ -204,7 +204,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
} }
oneClickStart = true oneClickStart = true
ifAgreePrivacy = true ifAgreePrivacy = true
(application as MyApplication).initApp() (application as MyApplication).initApp(true)
AdmobMaxHelper.preloadAd(this) AdmobMaxHelper.preloadAd(this)
binding.llStart.visibility = View.GONE binding.llStart.visibility = View.GONE
binding.llProgress.visibility = View.VISIBLE binding.llProgress.visibility = View.VISIBLE
......
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