Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
Out
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xjl
Out
Commits
b28738d9
Commit
b28738d9
authored
Jan 04, 2024
by
xujialang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加播放失败监听回调-弱引用
parent
a24094c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
AdManagerV2.java
app/src/main/java/com/zl/sdk/ad/AdManagerV2.java
+11
-3
OnInAdListener.java
app/src/main/java/com/zl/sdk/ad/OnInAdListener.java
+1
-1
DxActivity.java
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
+5
-0
No files found.
app/src/main/java/com/zl/sdk/ad/AdManagerV2.java
View file @
b28738d9
...
...
@@ -14,12 +14,13 @@ import com.zl.sdk.event.ReportBean;
import
com.zl.sdk.out.AppOutSP
;
import
com.zl.sdk.util.LogUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.Date
;
public
class
AdManagerV2
implements
ATInterstitialListener
{
private
volatile
ATInterstitial
atInterstitial
=
null
;
private
OnInAdListener
mListener
=
null
;
private
WeakReference
<
OnInAdListener
>
mListener
=
null
;
private
int
reloadCount
=
3
;
...
...
@@ -93,12 +94,19 @@ public class AdManagerV2 implements ATInterstitialListener {
atInterstitial
.
load
();
requestTime
=
System
.
currentTimeMillis
();
EventUtils
.
statAdReport
(
getReportRequestBean
(
adId
));
if
(
mListener
!=
null
)
{
mListener
.
get
().
onShow
();
}
}
@Override
public
void
onInterstitialAdClose
(
ATAdInfo
atAdInfo
)
{
LogUtil
.
d
(
"OutShow"
,
"Topon: ad close"
);
EventUtils
.
statAdClose
(
getReportBean
(
atAdInfo
,
null
));
if
(
mListener
!=
null
)
{
mListener
.
get
().
onCloseAd
();
}
}
@Override
...
...
@@ -120,7 +128,7 @@ public class AdManagerV2 implements ATInterstitialListener {
EventUtils
.
statDisplayFail
(
getReportBean
(
null
,
builder
));
if
(
mListener
!=
null
)
{
mListener
.
showFail
();
mListener
.
get
().
showFail
();
}
}
...
...
@@ -155,7 +163,7 @@ public class AdManagerV2 implements ATInterstitialListener {
public
void
showAd
(
Activity
activity
,
OnInAdListener
listener
)
{
LogUtil
.
d
(
"OutShow"
,
"Topon: showAd"
);
mListener
=
listener
;
mListener
=
new
WeakReference
<>(
listener
)
;
ATInterstitial
.
entryAdScenario
(
"111"
,
""
);
atInterstitial
.
show
(
activity
);
...
...
app/src/main/java/com/zl/sdk/ad/OnInAdListener.java
View file @
b28738d9
package
com
.
zl
.
sdk
.
ad
;
public
interface
OnInAdListener
{
//
void onCloseAd();
void
onCloseAd
();
//
// void onLoadAd();
//
...
...
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
View file @
b28738d9
...
...
@@ -148,6 +148,11 @@ public class DxActivity extends BaseActivity {
onceStayTime
=
System
.
currentTimeMillis
();
AdManagerV2
.
get
().
showAd
(
activity
,
new
OnInAdListener
()
{
@Override
public
void
onCloseAd
()
{
}
@Override
public
void
onShow
()
{
...
...
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