Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_highgold
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
android
android_highgold
Commits
852d2f43
Commit
852d2f43
authored
May 22, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug优化
parent
36ad682f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
58 deletions
+81
-58
ShanhuVedioAdManager.java
...main/java/com/mints/highgold/ad/ShanhuVedioAdManager.java
+81
-58
No files found.
highgold/app/src/main/java/com/mints/highgold/ad/ShanhuVedioAdManager.java
View file @
852d2f43
...
...
@@ -119,8 +119,15 @@ public class ShanhuVedioAdManager implements ShanhuVedioAdManagerView {
taskTypes
.
add
(
taskType
);
int
ret
=
mCoinManager
.
GetTasks
(
coinRequestInfo
,
taskTypes
,
coin
,
coinTaskTypes
);
if
(
ret
!=
ErrorCode
.
EC_SUCCESS
)
{
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdFail
();
if
(
activity
!=
null
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdFail
();
}
}
});
}
return
;
}
...
...
@@ -157,16 +164,31 @@ public class ShanhuVedioAdManager implements ShanhuVedioAdManagerView {
}
}
catch
(
Throwable
t
)
{
t
.
printStackTrace
();
if
(
shanhuVedioAdListener
!=
null
)
{
LogUtil
.
d
(
TAG
,
"shanhu Throwable"
);
shanhuVedioAdListener
.
shanhuVedioAdFail
();
if
(
activity
!=
null
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
shanhuVedioAdListener
!=
null
)
{
LogUtil
.
d
(
TAG
,
"shanhu Throwable"
);
shanhuVedioAdListener
.
shanhuVedioAdFail
();
}
}
});
}
}
if
(!
showAdFlag
)
{
if
(
shanhuVedioAdListener
!=
null
)
{
LogUtil
.
d
(
TAG
,
"no Ad show"
);
shanhuVedioAdListener
.
shanhuVedioAdFail
();
if
(
activity
!=
null
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
shanhuVedioAdListener
!=
null
)
{
LogUtil
.
d
(
TAG
,
"no Ad show"
);
shanhuVedioAdListener
.
shanhuVedioAdFail
();
}
}
});
}
}
}
...
...
@@ -191,76 +213,77 @@ public class ShanhuVedioAdManager implements ShanhuVedioAdManagerView {
}
private
List
<
AdMetaInfo
>
gotRewardVedio
(
int
adId
,
List
<
Integer
>
styleId
)
{
mRewardVedio
=
new
RewardVideo
();
List
<
AdID
>
list
=
new
ArrayList
<>();
list
.
add
(
new
AdID
(
adId
,
968
,
300
));
if
(
activity
!=
null
)
{
mRewardVedio
.
load
(
new
RewardVideo
.
RVListener
()
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
loaded
()
{
activity
.
runOnUiThread
(
new
Runnable
()
{
public
void
run
()
{
mRewardVedio
=
new
RewardVideo
();
List
<
AdID
>
list
=
new
ArrayList
<>();
list
.
add
(
new
AdID
(
adId
,
968
,
300
));
mRewardVedio
.
load
(
new
RewardVideo
.
RVListener
()
{
@Override
public
void
run
()
{
public
void
loaded
()
{
if
(
mRewardVedio
!=
null
)
{
mRewardVedio
.
showAD
();
}
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
);
LogUtil
.
d
(
TAG
,
"gotRewardVedio loaded"
);
}
});
LogUtil
.
d
(
TAG
,
"gotRewardVedio loaded"
);
}
@Override
public
void
onAdError
(
ADError
adError
)
{
if
(
adError
!=
null
)
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_ONE
,
adError
.
code
+
""
,
adError
.
msg
);
}
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdFail
();
}
LogUtil
.
d
(
TAG
,
"gotRewardVedio_onAdError code:"
+
adError
.
code
+
" msg:"
+
adError
.
msg
);
}
@Override
public
void
onAdError
(
ADError
adError
)
{
if
(
adError
!=
null
)
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_ONE
,
adError
.
code
+
""
,
adError
.
msg
);
}
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdFail
();
}
LogUtil
.
d
(
TAG
,
"gotRewardVedio_onAdError code:"
+
adError
.
code
+
" msg:"
+
adError
.
msg
);
}
@Override
public
void
onVideoComplete
()
{
LogUtil
.
d
(
TAG
,
"gotRewardVedio onVideoComplete"
);
}
@Override
public
void
onVideoComplete
()
{
LogUtil
.
d
(
TAG
,
"gotRewardVedio onVideoComplete"
);
}
@Override
public
void
onVideoPlay
()
{
LogUtil
.
d
(
TAG
,
"gotRewardVedio onVideoPlay"
);
}
@Override
public
void
onVideoPlay
()
{
LogUtil
.
d
(
TAG
,
"gotRewardVedio onVideoPlay"
);
}
@Override
public
void
onClick
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_TWO
,
""
,
""
);
@Override
public
void
onClick
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_TWO
,
""
,
""
);
if
(
isClickScreen
)
{
// 防止重复
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
isClickScreen
)
{
// 防止重复
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdDownload
();
}
LogUtil
.
d
(
TAG
,
"gotRewardVedio onClick"
);
}
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdDownload
();
}
LogUtil
.
d
(
TAG
,
"gotRewardVedio onClick"
);
}
@Override
public
void
onClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
LogUtil
.
d
(
TAG
,
"gotRewardVedio onClose"
);
@Override
public
void
onClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SHANHU
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
LogUtil
.
d
(
TAG
,
"gotRewardVedio onClose"
);
cmtTask
();
cmtTask
();
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdAdSuccess
();
}
}
},
activity
,
new
AdID
(
adId
,
968
,
300
));
if
(
shanhuVedioAdListener
!=
null
)
{
shanhuVedioAdListener
.
shanhuVedioAdAdSuccess
();
}
}
}
,
activity
,
new
AdID
(
adId
,
968
,
300
)
);
});
}
return
null
;
...
...
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