Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhouzhi
appzxhy
Commits
2475e1a9
Commit
2475e1a9
authored
May 19, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[修改]广告代码修改
parent
fdd35a54
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
33 deletions
+16
-33
AdsMgr.kt
app/src/main/java/com/base/appzxhy/ads/AdsMgr.kt
+2
-3
AdInterMgr.kt
app/src/main/java/com/base/appzxhy/ads/admob/AdInterMgr.kt
+3
-3
AdNativeMgr.kt
app/src/main/java/com/base/appzxhy/ads/admob/AdNativeMgr.kt
+1
-0
AdOpenMgr.kt
app/src/main/java/com/base/appzxhy/ads/admob/AdOpenMgr.kt
+2
-2
MaxInsertMgr.kt
...c/main/java/com/base/appzxhy/ads/applovin/MaxInsertMgr.kt
+4
-4
InterAdServiceImp.kt
...ain/java/com/base/appzxhy/drouterimp/InterAdServiceImp.kt
+3
-20
NativeAdServiceImp.kt
...in/java/com/base/appzxhy/drouterimp/NativeAdServiceImp.kt
+1
-1
No files found.
app/src/main/java/com/base/appzxhy/ads/AdsMgr.kt
View file @
2475e1a9
...
...
@@ -156,8 +156,8 @@ object AdsMgr {
*/
fun
showOpen
(
activity
:
Activity
,
isUnLimit
:
Boolean
=
false
,
showCallBack
:
AdsShowCallBack
?
=
null
,
isUnLimit
:
Boolean
=
false
,
)
{
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
"isInBlackList=${configBean.isInBlackList}"
)
...
...
@@ -195,8 +195,8 @@ object AdsMgr {
*/
fun
showInsert
(
activity
:
Activity
,
isUnLimit
:
Boolean
=
false
,
showCallBack
:
AdsShowCallBack
?
=
null
,
isUnLimit
:
Boolean
=
false
,
)
{
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
...
...
@@ -238,7 +238,6 @@ object AdsMgr {
}
}
fun
isNativeShow
()
=
LimitUtils
.
isAdShow
(
AdsType
.
NATIVE
,
null
)
/**
* 展示banner广告
...
...
app/src/main/java/com/base/appzxhy/ads/admob/AdInterMgr.kt
View file @
2475e1a9
...
...
@@ -62,7 +62,7 @@ class AdInterMgr {
val
needLoad
=
adState
.
currentAd
==
null
||
!
adAvailable
()
if
(
needLoad
)
{
if
(!
adState
.
loadingAd
)
{
loadAd
(
activity
,
isUnLimit
,
adEven
t
)
loadAd
(
activity
,
adEvent
,
isUnLimi
t
)
}
}
else
{
showReadyAd
(
adEvent
)
...
...
@@ -103,7 +103,7 @@ class AdInterMgr {
showCallBack
?.
close
()
showCallBack
=
null
loadAd
(
MyApplication
.
appContext
,
false
,
AdmobEvent
(
"interAd"
,
"preload"
))
loadAd
(
MyApplication
.
appContext
,
AdmobEvent
(
"interAd"
,
"preload"
))
}
override
fun
onAdClicked
()
{
...
...
@@ -121,7 +121,7 @@ class AdInterMgr {
fun
loadAd
(
context
:
Context
,
adEvent
:
AdEvent
,
isUnLimit
:
Boolean
=
false
,
isUnLimit
:
Boolean
=
false
,
)
{
if
(!
isUnLimit
)
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
INSERT
,
adEvent
))
{
...
...
app/src/main/java/com/base/appzxhy/ads/admob/AdNativeMgr.kt
View file @
2475e1a9
...
...
@@ -3,6 +3,7 @@ package com.base.appzxhy.ads.admob
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.ads.AdsType
import
com.base.appzxhy.ads.LimitUtils
import
com.base.appzxhy.ads.NativeParentView
import
com.google.android.gms.ads.AdListener
import
com.google.android.gms.ads.AdLoader
import
com.google.android.gms.ads.AdRequest
...
...
app/src/main/java/com/base/appzxhy/ads/admob/AdOpenMgr.kt
View file @
2475e1a9
...
...
@@ -54,7 +54,7 @@ class AdOpenMgr {
val
needLoad
=
adState
.
currentAd
==
null
||
!
adAvailable
()
if
(
needLoad
)
{
if
(!
adState
.
loadingAd
)
{
loadAd
(
activity
,
isUnLimit
,
adEven
t
)
loadAd
(
activity
,
adEvent
,
isUnLimi
t
)
}
}
else
{
showReadyAd
(
adEvent
)
...
...
@@ -96,7 +96,7 @@ class AdOpenMgr {
adState
.
onAdHidden
()
//预加载,“Timeout for show call succeed.”预加载的广告大概率,
loadAd
(
MyApplication
.
appContext
,
false
,
AdmobEvent
(
"openAd"
,
"preload"
))
loadAd
(
MyApplication
.
appContext
,
AdmobEvent
(
"openAd"
,
"preload"
))
}
...
...
app/src/main/java/com/base/appzxhy/ads/applovin/MaxInsertMgr.kt
View file @
2475e1a9
...
...
@@ -57,12 +57,12 @@ class MaxInsertMgr {
}
if
(!
adAvailable
()
||
adState
.
currentAd
==
null
)
{
loadAd
(
activity
,
isUnLimit
,
adEven
t
)
loadAd
(
activity
,
adEvent
,
isUnLimi
t
)
return
}
if
(
adState
.
currentAd
?.
isReady
==
false
)
{
loadAd
(
activity
,
isUnLimit
,
adEven
t
)
loadAd
(
activity
,
adEvent
,
isUnLimi
t
)
return
}
showReadyAd
(
adEvent
)
...
...
@@ -100,7 +100,7 @@ class MaxInsertMgr {
adState
.
onAdHidden
()
showCallBack
?.
close
()
loadAd
(
activity
.
applicationContext
,
false
,
AdMaxEvent
(
"interAd"
,
"preload"
))
loadAd
(
activity
.
applicationContext
,
AdMaxEvent
(
"interAd"
,
"preload"
))
}
override
fun
onAdClicked
(
ad
:
MaxAd
)
{
...
...
@@ -121,7 +121,7 @@ class MaxInsertMgr {
fun
loadAd
(
context
:
Context
,
adEvent
:
AdEvent
,
isUnLimit
:
Boolean
=
false
,
isUnLimit
:
Boolean
=
false
,
)
{
if
(!
isUnLimit
)
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
INSERT
,
adEvent
))
{
...
...
app/src/main/java/com/base/appzxhy/drouterimp/InterAdServiceImp.kt
View file @
2475e1a9
...
...
@@ -14,18 +14,9 @@ class InterAdServiceImp : InterAdService {
if
(
AdConfigBean
.
adsConfigBean
.
functionInShowAd
)
{
AdsMgr
.
showInsert
(
activity
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
callBack
.
invoke
()
}
override
fun
failed
(
where
:
Int
)
{
callBack
.
invoke
()
}
override
fun
adFailed
(
where
:
Int
)
{
AdsMgr
.
showInsert
(
activity
,
object
:
AdsShowCallBack
()
{
override
fun
next
()
{
callBack
.
invoke
()
}
})
...
...
@@ -39,15 +30,7 @@ class InterAdServiceImp : InterAdService {
if
(
AdConfigBean
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
activity
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
callBack
.
invoke
()
}
override
fun
failed
(
where
:
Int
)
{
callBack
.
invoke
()
}
override
fun
adFailed
(
where
:
Int
)
{
override
fun
next
()
{
callBack
.
invoke
()
}
})
...
...
app/src/main/java/com/base/appzxhy/drouterimp/NativeAdServiceImp.kt
View file @
2475e1a9
...
...
@@ -21,7 +21,7 @@ class NativeAdServiceImp : NativeAdService {
else
->
R
.
layout
.
layout_admob_native_custom
}
val
maxLayout
=
R
.
layout
.
layout_max_native_custom
AdsMgr
.
showNative
(
activity
,
flAd
,
admobLayout
,
maxLayout
)
//
AdsMgr.showNative(activity, flAd, admobLayout, maxLayout)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment