Commit 28de76c7 authored by leichao.gao's avatar leichao.gao

update

parent 5e06a16d
......@@ -102,12 +102,21 @@ class MyApplication : BaseApplication() {
val topActivity: Activity? = ActivityManagerUtils.getInstance().topActivity
val flag = if (topActivity == null) {
var flag = if (topActivity == null) {
true
} else {
ConfigHelper.noLoadingActivities.all { !topActivity.localClassName.contains(it, true) }
ConfigHelper.noLoadingActivities.all {
!topActivity.localClassName.contains(
it,
true
)
}
}
if (activity.localClassName.contains("AppLovinFullscreenActivity")) {
flag = false
}
LogEx.logDebug(TAG, "flag=$flag")
LogEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName)
if (flag) {
if (AdmobMaxHelper.isOpenAdLoaded()) {
......
......@@ -130,6 +130,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
progressFlow.collectLatest {
if (it >= 100) {
job?.cancel()
LogEx.logDebug(TAG,"jumpNext")
jumpNext()
this.cancel()
}
......@@ -138,6 +139,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
}
private fun jumpNext() {
LogEx.logDebug(TAG," when (actionId) {:jumpNext: "+actionId )
when (actionId) {
ID_JUNK_CLEAN_PUSH -> {
......@@ -233,13 +235,18 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
val value = binding.pb.progress + 2
binding.pb.setProgress(value, true)
progress.emit(value)
LogEx.logDebug(TAG, "startProgress:"+isActive+" progress.emit(value)")
val delayTime = 450L
delay(delayTime)
LogEx.logDebug(TAG, "startProgress:"+isActive+" delay(delayTime)")
processTime += delayTime
LogEx.logDebug(TAG, "startProgress:"+isActive+" processTime += delayTime")
if (processTime >= Random.nextLong(3000, 4000)) {
LogEx.logDebug(TAG, "startProgress:"+isActive+" Random.nextLong(3000, 4000)")
if (!outTimeAdStart) {
outTimeAdStart = true
LogEx.logDebug(TAG, "outTimeAd:"+isActive)
outTimeAd()
}
}
......
package com.base.datarecovery.ads.max
import android.content.Context
import android.util.Log
import com.applovin.sdk.AppLovinMediationProvider
import com.applovin.sdk.AppLovinSdk
import com.applovin.sdk.AppLovinSdkInitializationConfiguration
......@@ -19,6 +20,7 @@ object AdMaxInit {
var maxInitAction: (() -> Unit)? = null
fun Context.initAdMax() {
Log.d(TAG, "initAdMax")
// If you want to test your own AppLovin SDK key, change the value here and update the package name in the build.gradle
val YOUR_SDK_KEY = "GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
......
......@@ -39,6 +39,7 @@ object AdMaxOpenUtils {
LogEx.logDebug(TAG, "广告拉取失败了,onAdLoadFailed:" + p1.message.toString())
LogEx.logDebug(TAG, "广告拉取失败了,onAdLoadFailed:" + p0)
LogEx.logDebug(TAG, "广告拉取失败了,onAdLoadFailed:" + p1.code)
loadingListener = null
onHidden?.invoke()
AdDisplayUtils.getInstance().incrementAdRequestFailCount()
AdMaxEvent.pullAd(null, "openAd")
......@@ -79,7 +80,11 @@ object AdMaxOpenUtils {
}
}
fun showAppOpenAd(activity: Activity, loaded: (() -> Unit)? = null, onHidden: (() -> Unit)? = null) {
fun showAppOpenAd(
activity: Activity,
loaded: (() -> Unit)? = null,
onHidden: (() -> Unit)? = null
) {
setListener(activity)
......
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