Commit 4e8a16c5 authored by wanglei's avatar wanglei

Merge remote-tracking branch 'origin/master'

parents c832cc82 60e4bd51
......@@ -31,7 +31,7 @@ import java.util.UUID
class MyApplication : BaseApplication() {
private val TAG = "MyApplication"
private val TAG = "MAX"
var uuid = ""
companion object {
......@@ -83,7 +83,7 @@ class MyApplication : BaseApplication() {
private var lastTimeResume = 0L
private fun isHotLaunch(): Boolean {
if ((lastTimeResume - lastTimePause) > 1000) {
if ((lastTimeResume - lastTimePause) > 1500) {
return true
}
return false
......@@ -96,6 +96,7 @@ class MyApplication : BaseApplication() {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
override fun onActivityStarted(activity: Activity) {
LogEx.logDebug(TAG, "onActivityStarted")
count++
lastTimeResume = System.currentTimeMillis()
if (count == 1 && isHotLaunch()) {
......@@ -135,15 +136,18 @@ class MyApplication : BaseApplication() {
}
}
}
lastTimeResume = 0
}
override fun onActivityResumed(activity: Activity) {
LogEx.logDebug(TAG, "onActivityResumed")
PAUSED_VALUE = 1
}
override fun onActivityPaused(activity: Activity) {
PAUSED_VALUE = 2
LogEx.logDebug(TAG, "onActivityPaused")
lastTimePause = System.currentTimeMillis()
}
......
......@@ -32,10 +32,10 @@ object AdMaxInit {
initConfigBuilder.mediationProvider = AppLovinMediationProvider.MAX
// Enable test mode by default for the current device. Cannot be run on the main thread.
// val currentGaid = AdvertisingIdClient.getAdvertisingIdInfo(this).id
// if (currentGaid != null) {
// initConfigBuilder.testDeviceAdvertisingIds = Collections.singletonList(currentGaid)
// }
val currentGaid = AdvertisingIdClient.getAdvertisingIdInfo(this).id
if (currentGaid != null) {
initConfigBuilder.testDeviceAdvertisingIds = Collections.singletonList(currentGaid)
}
// Initialize the AppLovin SDK
val sdk = AppLovinSdk.getInstance(this)
......
......@@ -33,6 +33,7 @@ object AdMaxOpenUtils {
LogEx.logDebug(TAG, "广告拉取成功")
openLoadTime = System.currentTimeMillis()
loadingListener?.invoke()
loadingListener=null
AdMaxEvent.pullAd(p0, "openAd")
}
......
......@@ -56,7 +56,7 @@ class GuideFragment(
}
private fun jumpMain() {
val showAd = AppPreferences.getInstance().getString("isShowGuideAd", "1")?.toInt()
val showAd = AppPreferences.getInstance().getString("isShowGuideAd", "0")?.toInt()
if (showAd == 1) {
AdmobMaxHelper.admobMaxShowInterstitialAd(requireActivity()) {
startActivity(Intent(requireContext(), MainActivity::class.java))
......
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