Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
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_vedio
Commits
a0ad52d4
Commit
a0ad52d4
authored
Aug 01, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
62ffa5ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
20 deletions
+38
-20
DrawExpressManager.kt
...in/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
+24
-6
ExpressManager.kt
...ain/java/com/mints/helivideo/ad/express/ExpressManager.kt
+14
-14
No files found.
video/app/src/main/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
View file @
a0ad52d4
...
...
@@ -54,6 +54,8 @@ class DrawExpressManager {
private
var
mExpressAdCallback
:
ExpressAdCallback
?
=
null
private
var
viewCache
=
Stack
<
FrameLayout
>()
// 载体
private
var
adcode
=
""
private
var
ecpm
=
""
...
...
@@ -190,8 +192,8 @@ class DrawExpressManager {
adShowTime
=
System
.
currentTimeMillis
()
isLoadSuccess
=
0
isClickScreen
=
true
callback
?.
loadSuccess
(
frameLayout
)
//
callback?.loadSuccess(viewCache.lastElement())
//
callback?.loadSuccess(frameLayout)
callback
?.
loadSuccess
(
viewCache
.
lastElement
())
}
else
{
LogUtil
.
e
(
TAG
,
"gromore draw信息流--> 5、展示广告时失败了,广告可能超时45分钟 onError "
)
// 状态重置
...
...
@@ -223,11 +225,25 @@ class DrawExpressManager {
(
view
.
parent
as
ViewGroup
).
removeView
(
view
)
}
frameLayout
?.
addView
(
view
)
// val view: FrameLayout = frameLayout!!
// val frameLayout = FrameLayout(MintsApplication.getContext())
// frameLayout.addView(view)
// viewCache.add(frameLayout)
}
// val view: FrameLayout = frameLayout!!
// val frameLayout = FrameLayout(MintsApplication.getContext())
// frameLayout.addView(view)
viewCache
.
add
(
frameLayout
)
// mExpressAdCallback?.let {
// if (it.renderSuccess(viewCache.lastElement())) {
// LogUtil.d(
// TAG,
// "gromore信息流 onRenderSuccess -> showAd->$isShowAd \n adcode->$adcode ecpm->$ecpm"
// )
//
// isLoadSuccess = 0
// isShowAd = true
// adShowTime = System.currentTimeMillis()
// }
// }
// mExpressAdCallback = null
}
override
fun
onRenderFail
(
p0
:
View
?,
p1
:
String
?,
p2
:
Int
)
{
...
...
@@ -259,6 +275,8 @@ class DrawExpressManager {
ecpm
=
""
adSource
=
""
viewCache
.
clear
()
mTTFeedAd
?.
destroy
()
this
.
mExpressAdCallback
=
null
}
...
...
video/app/src/main/java/com/mints/helivideo/ad/express/ExpressManager.kt
View file @
a0ad52d4
...
...
@@ -194,20 +194,6 @@ class ExpressManager {
private
fun
showExpressView
(
it
:
TTFeedAd
)
{
it
.
setExpressRenderListener
(
object
:
MediationExpressRenderListener
{
override
fun
onRenderSuccess
(
p0
:
View
?,
p1
:
Float
,
p2
:
Float
,
p3
:
Boolean
)
{
mExpressAdCallback
?.
let
{
if
(
it
.
renderSuccess
(
frameLayout
))
{
LogUtil
.
d
(
TAG
,
"gromore信息流 onRenderSuccess -> showAd->$isShowAd \n adcode->$adcode ecpm->$ecpm"
)
isLoadSuccess
=
0
isShowAd
=
true
adShowTime
=
System
.
currentTimeMillis
()
}
}
mExpressAdCallback
=
null
Log
.
i
(
TAG
,
"onRenderSuccess"
)
it
.
setDislikeCallback
(
ForegroundOrBackground
.
getTopActivity
(),
object
:
TTAdDislike
.
DislikeInteractionCallback
{
...
...
@@ -229,6 +215,20 @@ class ExpressManager {
}
frameLayout
?.
addView
(
view
)
}
mExpressAdCallback
?.
let
{
if
(
it
.
renderSuccess
(
frameLayout
))
{
LogUtil
.
d
(
TAG
,
"gromore信息流 onRenderSuccess -> showAd->$isShowAd \n adcode->$adcode ecpm->$ecpm"
)
isLoadSuccess
=
0
isShowAd
=
true
adShowTime
=
System
.
currentTimeMillis
()
}
}
mExpressAdCallback
=
null
}
override
fun
onRenderFail
(
p0
:
View
?,
p1
:
String
?,
p2
:
Int
)
{
...
...
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