Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
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
王雪伟
LuckyFarm
Commits
783a82c4
Commit
783a82c4
authored
Nov 06, 2020
by
erwin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
黄军辉
测试广告
parent
44c787fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
17 deletions
+18
-17
misc.xml
.idea/misc.xml
+1
-1
AdManager.kt
library/src/main/java/com/ym/library/config/AdManager.kt
+8
-8
TTADUtils.kt
library/src/main/java/com/ym/library/csj/TTADUtils.kt
+9
-8
No files found.
.idea/misc.xml
View file @
783a82c4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
JDK
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
1.8
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
library/src/main/java/com/ym/library/config/AdManager.kt
View file @
783a82c4
...
...
@@ -551,10 +551,10 @@ object AdManager {
var
callback
:
ZXADCallback
=
object
:
ZXADCallback
{
override
fun
onAdSuccess
()
{
Log
.
d
(
TAG
,
"onAdSuccess"
)
Log
.
d
(
"mingzhong"
,
"Success adPlatform"
+
totalEntity
[
0
].
adPlatform
+
" platformId"
+
totalEntity
[
0
].
platformId
);
//
Log.d(
//
"mingzhong",
//
"Success adPlatform" + totalEntity[0].adPlatform + " platformId" + totalEntity[0].platformId
//
);
result
.
remove
(
newsEntity
)
AdCache
.
rewardList
.
put
(
slotName
,
result
)
Utils
.
showToast
(
mActivity
,
"看完视频即可获得奖励"
)
...
...
@@ -568,10 +568,10 @@ object AdManager {
if
(
totalEntity
.
size
>
0
)
{
Log
.
d
(
"mingzhong"
,
"Fail adPlatform"
+
totalEntity
[
0
].
adPlatform
+
" platformId"
+
totalEntity
[
0
].
platformId
);
//
Log.d(
//
"mingzhong",
//
"Fail adPlatform" + totalEntity[0].adPlatform + " platformId" + totalEntity[0].platformId
//
);
var
newsEntitys
=
totalEntity
[
0
]
loadVideoAd
(
mActivity
,
newsEntitys
,
listener
,
this
)
...
...
library/src/main/java/com/ym/library/csj/TTADUtils.kt
View file @
783a82c4
...
...
@@ -468,6 +468,7 @@ object TTADUtils {
.
setMediaExtra
(
"media_extra"
)
//用户透传的信息,可不传
.
build
()
var
mttRewardVideoAd
:
TTRewardVideoAd
?
=
null
mTTAdNative
.
loadRewardVideoAd
(
adSlot
,
object
:
RewardVideoAdListener
{
override
fun
onError
(
code
:
Int
,
message
:
String
)
{
EventUtils
.
onEventPullFail
(
entity
)
...
...
@@ -477,20 +478,20 @@ object TTADUtils {
}
//视频广告加载后的视频文件资源缓存到本地的回调
override
fun
onRewardVideo
Cached
(
)
{
listener
.
onRewardVideoCached
()
override
fun
onRewardVideo
AdLoad
(
ad
:
TTRewardVideoAd
)
{
//
listener.onRewardVideoCached()
Log
.
e
(
"mingzhong"
,
"onRewardVideoCached"
)
mttRewardVideoAd
=
ad
}
//视频广告素材加载到,如title,视频url等,不包括视频文件
override
fun
onRewardVideo
AdLoad
(
ad
:
TTRewardVideoAd
)
{
override
fun
onRewardVideo
Cached
(
)
{
Log
.
e
(
"mingzhong"
,
"onRewardVideoAdLoad"
)
EventUtils
.
onEventPullSuccess
(
entity
)
callback
.
onAdSuccess
()
var
mttRewardVideoAd
=
ad
//
var mttRewardVideoAd = ad
mttRewardVideoAd
.
setRewardAdInteractionListener
(
object
:
mttRewardVideoAd
?
.
setRewardAdInteractionListener
(
object
:
RewardAdInteractionListener
{
override
fun
onAdShow
()
{
listener
.
setRewardAdInteractionListener
()
...
...
@@ -533,7 +534,7 @@ object TTADUtils {
listener
.
onSkippedVideo
()
}
})
mttRewardVideoAd
.
setDownloadListener
(
object
:
TTAppDownloadListener
{
mttRewardVideoAd
?
.
setDownloadListener
(
object
:
TTAppDownloadListener
{
override
fun
onIdle
()
{}
override
fun
onDownloadActive
(
totalBytes
:
Long
,
...
...
@@ -577,7 +578,7 @@ object TTADUtils {
})
Log
.
e
(
TAG
,
"穿山甲激励视频耗时"
+
(
System
.
currentTimeMillis
()-
startTime
)+
""
)
listener
.
onRewardVideoAdLoad
(
entity
)
mttRewardVideoAd
.
showRewardVideoAd
(
activity
)
mttRewardVideoAd
?
.
showRewardVideoAd
(
activity
)
}
})
}
...
...
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