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
wanglei
appzxhy
Commits
ffddbee7
Commit
ffddbee7
authored
Jun 10, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[商业化]优化上报的卡顿问题
parent
9d0c1a11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
278 additions
and
241 deletions
+278
-241
AdEvent.kt
app/src/main/java/com/base/appzxhy/business/ads/AdEvent.kt
+4
-0
AdBannerMgr.kt
...n/java/com/base/appzxhy/business/ads/admob/AdBannerMgr.kt
+1
-1
AdInterMgr.kt
...in/java/com/base/appzxhy/business/ads/admob/AdInterMgr.kt
+1
-1
AdNativeMgr.kt
...n/java/com/base/appzxhy/business/ads/admob/AdNativeMgr.kt
+1
-1
AdOpenMgr.kt
...ain/java/com/base/appzxhy/business/ads/admob/AdOpenMgr.kt
+1
-1
AdmobEvent.kt
...in/java/com/base/appzxhy/business/ads/admob/AdmobEvent.kt
+1
-237
AdmobOnPaidEventListener.kt
...se/appzxhy/business/ads/admob/AdmobOnPaidEventListener.kt
+269
-0
No files found.
app/src/main/java/com/base/appzxhy/business/ads/AdEvent.kt
View file @
ffddbee7
...
...
@@ -3,6 +3,9 @@ package com.base.appzxhy.business.ads
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.business.helper.EventUtils
import
com.base.appzxhy.utils.LogEx
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.SupervisorJob
import
org.json.JSONObject
import
java.util.UUID
...
...
@@ -18,6 +21,7 @@ val taichiSharedPreferencesEditor by lazy {
abstract
class
AdEvent
{
abstract
val
TAG
:
String
var
adUnit
:
String
=
""
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdBannerMgr.kt
View file @
ffddbee7
...
...
@@ -42,7 +42,7 @@ class AdBannerMgr {
adView
=
AdView
(
parent
.
context
)
parent
.
addView
(
adView
)
adView
?.
onPaidEventListener
=
Admob
Event
.
EventOnPaidEventListener
(
adView
)
adView
?.
onPaidEventListener
=
Admob
OnPaidEventListener
(
adView
,
admobEvent
.
scope
)
listener
=
ViewTreeObserver
.
OnGlobalLayoutListener
{
val
screenPixelDensity
=
parent
.
context
.
resources
.
displayMetrics
.
density
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdInterMgr.kt
View file @
ffddbee7
...
...
@@ -150,7 +150,7 @@ class AdInterMgr {
}
(
adEvent
as
AdmobEvent
).
pullAd
(
ad
.
responseInfo
)
LimitUtils
.
addRequestNum
()
ad
.
onPaidEventListener
=
Admob
Event
.
EventOnPaidEventListener
(
ad
)
ad
.
onPaidEventListener
=
Admob
OnPaidEventListener
(
adEvent
.
scope
)
}
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdNativeMgr.kt
View file @
ffddbee7
...
...
@@ -52,7 +52,7 @@ class AdNativeMgr {
).
forNativeAd
{
nativeAd
->
lastTime
=
System
.
currentTimeMillis
()
nativeAd
.
setOnPaidEventListener
(
Admob
Event
.
EventOnPaidEventListener
(
nativeAd
))
nativeAd
.
setOnPaidEventListener
(
Admob
OnPaidEventListener
(
nativeAd
,
admobEvent
.
scope
))
currentNativeAd
=
nativeAd
admobEvent
.
pullAd
(
nativeAd
.
responseInfo
)
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdOpenMgr.kt
View file @
ffddbee7
...
...
@@ -141,7 +141,7 @@ class AdOpenMgr {
showReadyAd
(
adEvent
)
}
(
adEvent
as
AdmobEvent
).
pullAd
(
appOpenAd
.
responseInfo
)
appOpenAd
.
onPaidEventListener
=
Admob
Event
.
EventOnPaidEventListener
(
appOpenAd
)
appOpenAd
.
onPaidEventListener
=
Admob
OnPaidEventListener
(
appOpenAd
,
adEvent
.
scope
)
LimitUtils
.
addRequestNum
()
}
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdmobEvent.kt
View file @
ffddbee7
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/appzxhy/business/ads/admob/AdmobOnPaidEventListener.kt
0 → 100644
View file @
ffddbee7
This diff is collapsed.
Click to expand it.
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