Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
SuperEasyClean
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
songjianyu
SuperEasyClean
Commits
0b3c14cf
Commit
0b3c14cf
authored
Jun 23, 2025
by
songjianyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[修改] 广告bug修复
parent
b4d554ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
AdBannerMgr.kt
...ain/java/com/easy/clean/business/ads/admob/AdBannerMgr.kt
+3
-1
AdInterMgr.kt
...main/java/com/easy/clean/business/ads/admob/AdInterMgr.kt
+5
-2
AdmobEvent.kt
...main/java/com/easy/clean/business/ads/admob/AdmobEvent.kt
+1
-2
No files found.
app/src/main/java/com/easy/clean/business/ads/admob/AdBannerMgr.kt
View file @
0b3c14cf
...
...
@@ -42,7 +42,9 @@ class AdBannerMgr {
adView
=
AdView
(
parent
.
context
)
parent
.
addView
(
adView
)
adView
?.
onPaidEventListener
=
AdmobOnPaidEventListener
(
adView
,
admobEvent
.
scope
)
adView
?.
let
{
it
.
onPaidEventListener
=
AdmobOnPaidEventListener
(
it
,
admobEvent
.
scope
)
}
listener
=
ViewTreeObserver
.
OnGlobalLayoutListener
{
val
screenPixelDensity
=
parent
.
context
.
resources
.
displayMetrics
.
density
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdInterMgr.kt
View file @
0b3c14cf
...
...
@@ -76,12 +76,15 @@ class AdInterMgr {
private
fun
showReadyAd
(
adEvent
:
AdEvent
)
{
val
ac
=
adState
.
activityRef
?.
get
()
if
(
ac
==
null
||
ac
.
isDestroyed
||
ac
.
isFinishing
){
return
}
adState
.
currentAd
?.
run
{
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
override
fun
onAdShowedFullScreenContent
()
{
super
.
onAdShowedFullScreenContent
()
val
ac
=
adState
.
activityRef
?.
get
()
(
adEvent
as
AdmobEvent
).
showAd
(
responseInfo
,
ac
)
adState
.
onAdDisplayed
()
...
...
@@ -153,7 +156,7 @@ class AdInterMgr {
}
(
adEvent
as
AdmobEvent
).
pullAd
(
ad
.
responseInfo
)
LimitUtils
.
addRequestNum
()
ad
.
onPaidEventListener
=
AdmobOnPaidEventListener
(
adEvent
.
scope
)
ad
.
onPaidEventListener
=
AdmobOnPaidEventListener
(
ad
,
ad
Event
.
scope
)
}
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdmobEvent.kt
View file @
0b3c14cf
...
...
@@ -144,12 +144,11 @@ class AdmobEvent : AdEvent {
class
AdmobOnPaidEventListener
(
private
val
ad
:
Any
?
,
private
val
ad
:
Any
,
private
val
coroutineScope
:
CoroutineScope
=
CoroutineScope
(
SupervisorJob
()
+
Dispatchers
.
IO
)
)
:
OnPaidEventListener
{
override
fun
onPaidEvent
(
adValue
:
AdValue
)
{
ad
?:
return
onPaidEvent2
(
ad
,
adValue
)
}
...
...
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