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
286dddb1
Commit
286dddb1
authored
Aug 10, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
0841eb5a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
41 deletions
+0
-41
ExpressManager.kt
...ain/java/com/mints/helivideo/ad/express/ExpressManager.kt
+0
-32
MainExpressManager.kt
...java/com/mints/helivideo/ad/express/MainExpressManager.kt
+0
-8
MainFragment.kt
...main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
+0
-1
ic_recommend_vedio.png
video/app/src/main/res/mipmap-xhdpi/ic_recommend_vedio.png
+0
-0
No files found.
video/app/src/main/java/com/mints/helivideo/ad/express/ExpressManager.kt
View file @
286dddb1
...
@@ -35,16 +35,8 @@ class ExpressManager {
...
@@ -35,16 +35,8 @@ class ExpressManager {
}
}
}
}
private
var
adShowTime
:
Long
=
0
// 防止预加载超时 2秒
private
var
isShowAd
=
false
// 广告是否展示
private
var
frameLayout
:
FrameLayout
?
=
null
private
var
frameLayout
:
FrameLayout
?
=
null
private
var
expressId
:
String
=
""
private
var
isClickScreen
=
true
// 是否点击屏幕跳转广告
private
val
adLoadTime
:
Long
=
0
// 广告展示时间,45分钟后当前广告失效,重新预加载广告
private
val
adLoadTime
:
Long
=
0
// 广告展示时间,45分钟后当前广告失效,重新预加载广告
private
var
adPreingTime
:
Long
=
0
// 防止预加载超时 2分钟
private
var
adPreingTime
:
Long
=
0
// 防止预加载超时 2分钟
...
@@ -53,9 +45,6 @@ class ExpressManager {
...
@@ -53,9 +45,6 @@ class ExpressManager {
private
var
mExpressAdCallback
:
ExpressAdCallback
?
=
null
private
var
mExpressAdCallback
:
ExpressAdCallback
?
=
null
private
var
adcode
=
""
private
var
ecpm
=
""
private
var
adSource
=
""
private
var
mTTFeedAd
:
TTFeedAd
?
=
null
private
var
mTTFeedAd
:
TTFeedAd
?
=
null
fun
preLoadAd
()
{
fun
preLoadAd
()
{
...
@@ -86,8 +75,6 @@ class ExpressManager {
...
@@ -86,8 +75,6 @@ class ExpressManager {
private
fun
loadAd
()
{
private
fun
loadAd
()
{
isClickScreen
=
true
expressId
=
BuildConfig
.
GROMORE_VIDEO_CODE
val
activity
=
ForegroundOrBackground
.
getTopActivity
()
val
activity
=
ForegroundOrBackground
.
getTopActivity
()
val
adNativeLoader
=
TTAdSdk
.
getAdManager
().
createAdNative
(
activity
)
val
adNativeLoader
=
TTAdSdk
.
getAdManager
().
createAdNative
(
activity
)
...
@@ -110,10 +97,6 @@ class ExpressManager {
...
@@ -110,10 +97,6 @@ class ExpressManager {
}
}
override
fun
onFeedAdLoad
(
ads
:
MutableList
<
TTFeedAd
>?)
{
override
fun
onFeedAdLoad
(
ads
:
MutableList
<
TTFeedAd
>?)
{
LogUtil
.
d
(
TAG
,
"gromore信息流--> 3、Gromore onAdLoaded expressId=${expressId} "
)
ads
?.
let
{
ads
?.
let
{
if
(
it
.
isEmpty
())
{
if
(
it
.
isEmpty
())
{
isLoadSuccess
=
0
isLoadSuccess
=
0
...
@@ -178,10 +161,7 @@ class ExpressManager {
...
@@ -178,10 +161,7 @@ class ExpressManager {
TAG
,
TAG
,
"gromore信息流--> 4、展示广告 LoadSuccess=$isLoadSuccess isOversped=$isOversped"
"gromore信息流--> 4、展示广告 LoadSuccess=$isLoadSuccess isOversped=$isOversped"
)
)
isShowAd
=
true
adShowTime
=
System
.
currentTimeMillis
()
isLoadSuccess
=
0
isLoadSuccess
=
0
isClickScreen
=
true
callback
?.
loadSuccess
(
frameLayout
)
callback
?.
loadSuccess
(
frameLayout
)
}
else
{
}
else
{
LogUtil
.
e
(
TAG
,
"gromore信息流--> 5、展示广告时失败了,广告可能超时45分钟 onError "
)
LogUtil
.
e
(
TAG
,
"gromore信息流--> 5、展示广告时失败了,广告可能超时45分钟 onError "
)
...
@@ -218,14 +198,7 @@ class ExpressManager {
...
@@ -218,14 +198,7 @@ class ExpressManager {
mExpressAdCallback
?.
let
{
mExpressAdCallback
?.
let
{
if
(
it
.
renderSuccess
(
frameLayout
))
{
if
(
it
.
renderSuccess
(
frameLayout
))
{
LogUtil
.
d
(
TAG
,
"gromore信息流 onRenderSuccess -> showAd->$isShowAd \n adcode->$adcode ecpm->$ecpm"
)
isLoadSuccess
=
0
isLoadSuccess
=
0
isShowAd
=
true
adShowTime
=
System
.
currentTimeMillis
()
}
}
}
}
mExpressAdCallback
=
null
mExpressAdCallback
=
null
...
@@ -256,11 +229,6 @@ class ExpressManager {
...
@@ -256,11 +229,6 @@ class ExpressManager {
// frameLayout?.removeAllViews()
// frameLayout?.removeAllViews()
// frameLayout = null
// frameLayout = null
// 数据重置
adcode
=
""
ecpm
=
""
adSource
=
""
mTTFeedAd
?.
destroy
()
mTTFeedAd
?.
destroy
()
this
.
mExpressAdCallback
=
null
this
.
mExpressAdCallback
=
null
}
}
...
...
video/app/src/main/java/com/mints/helivideo/ad/express/MainExpressManager.kt
View file @
286dddb1
...
@@ -33,10 +33,6 @@ class MainExpressManager {
...
@@ -33,10 +33,6 @@ class MainExpressManager {
}
}
}
}
private
var
adcode
=
""
private
var
ecpm
=
""
private
var
adSource
=
""
private
var
mTTFeedAdList
=
arrayListOf
<
TTFeedAd
>()
private
var
mTTFeedAdList
=
arrayListOf
<
TTFeedAd
>()
fun
loadAd
(
expressAdCallback
:
ExpressAdCallback
)
{
fun
loadAd
(
expressAdCallback
:
ExpressAdCallback
)
{
...
@@ -167,10 +163,6 @@ class MainExpressManager {
...
@@ -167,10 +163,6 @@ class MainExpressManager {
* 销毁
* 销毁
*/
*/
fun
destroy
()
{
fun
destroy
()
{
// 数据重置
adcode
=
""
ecpm
=
""
adSource
=
""
for
(
ttFeedAd
in
mTTFeedAdList
)
{
for
(
ttFeedAd
in
mTTFeedAdList
)
{
ttFeedAd
.
destroy
()
ttFeedAd
.
destroy
()
}
}
...
...
video/app/src/main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
View file @
286dddb1
...
@@ -388,7 +388,6 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -388,7 +388,6 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val
mainFirstRecommend
=
val
mainFirstRecommend
=
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
MAIN_FIRST_RECOMMEND
,
false
)
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
MAIN_FIRST_RECOMMEND
,
false
)
if
(!
mainFirstRecommend
)
{
if
(!
mainFirstRecommend
)
{
// if (mainFirstRecommend) {
AppPreferencesManager
.
get
().
put
(
Constant
.
MAIN_FIRST_RECOMMEND
,
true
)
AppPreferencesManager
.
get
().
put
(
Constant
.
MAIN_FIRST_RECOMMEND
,
true
)
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
...
...
video/app/src/main/res/mipmap-xhdpi/ic_recommend_vedio.png
View replaced file @
0841eb5a
View file @
286dddb1
1.24 KB
|
W:
|
H:
1.14 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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