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
b2610406
Commit
b2610406
authored
Aug 15, 2023
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
5d609ef7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
+15
-13
build.gradle
video/app/build.gradle
+2
-2
ExpressManager.kt
...ain/java/com/mints/helivideo/ad/express/ExpressManager.kt
+2
-1
MyExpressManager.kt
...n/java/com/mints/helivideo/ad/express/MyExpressManager.kt
+10
-8
MyFragment.kt
...c/main/java/com/mints/helivideo/ui/fragment/MyFragment.kt
+0
-1
gradle.properties
video/gradle.properties
+1
-1
No files found.
video/app/build.gradle
View file @
b2610406
...
@@ -66,7 +66,7 @@ android {
...
@@ -66,7 +66,7 @@ android {
buildConfigField
"String"
,
"GROMORE_VIDEO_CODE"
,
GROMORE_VIDEO_CODE
buildConfigField
"String"
,
"GROMORE_VIDEO_CODE"
,
GROMORE_VIDEO_CODE
buildConfigField
"String"
,
"GROMORE_DRAW_CODE"
,
GROMORE_DRAW_CODE
buildConfigField
"String"
,
"GROMORE_DRAW_CODE"
,
GROMORE_DRAW_CODE
buildConfigField
"String"
,
"GROMORE_EXPRESS_CODE"
,
GROMORE_EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_EXPRESS_CODE"
,
GROMORE_EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_MY
EXPRESS_CODE"
,
GROMORE_MY
EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_MY
_EXPRESS_CODE"
,
GROMORE_MY_
EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_BANNER_CODE"
,
GROMORE_BANNER_CODE
buildConfigField
"String"
,
"GROMORE_BANNER_CODE"
,
GROMORE_BANNER_CODE
buildConfigField
"String"
,
"RELEASE_TALKING_DATA_KEY"
,
RELEASE_TALKING_DATA_KEY
buildConfigField
"String"
,
"RELEASE_TALKING_DATA_KEY"
,
RELEASE_TALKING_DATA_KEY
buildConfigField
"String"
,
"WEIXIN_APP_PAY_ID"
,
WEIXIN_APP_PAY_ID
buildConfigField
"String"
,
"WEIXIN_APP_PAY_ID"
,
WEIXIN_APP_PAY_ID
...
@@ -90,7 +90,7 @@ android {
...
@@ -90,7 +90,7 @@ android {
buildConfigField
"String"
,
"GROMORE_VIDEO_CODE"
,
GROMORE_VIDEO_CODE
buildConfigField
"String"
,
"GROMORE_VIDEO_CODE"
,
GROMORE_VIDEO_CODE
buildConfigField
"String"
,
"GROMORE_DRAW_CODE"
,
GROMORE_DRAW_CODE
buildConfigField
"String"
,
"GROMORE_DRAW_CODE"
,
GROMORE_DRAW_CODE
buildConfigField
"String"
,
"GROMORE_EXPRESS_CODE"
,
GROMORE_EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_EXPRESS_CODE"
,
GROMORE_EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_MY
EXPRESS_CODE"
,
GROMORE_MY
EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_MY
_EXPRESS_CODE"
,
GROMORE_MY_
EXPRESS_CODE
buildConfigField
"String"
,
"GROMORE_BANNER_CODE"
,
GROMORE_BANNER_CODE
buildConfigField
"String"
,
"GROMORE_BANNER_CODE"
,
GROMORE_BANNER_CODE
buildConfigField
"String"
,
"RELEASE_TALKING_DATA_KEY"
,
RELEASE_TALKING_DATA_KEY
buildConfigField
"String"
,
"RELEASE_TALKING_DATA_KEY"
,
RELEASE_TALKING_DATA_KEY
buildConfigField
"String"
,
"WEIXIN_APP_PAY_ID"
,
WEIXIN_APP_PAY_ID
buildConfigField
"String"
,
"WEIXIN_APP_PAY_ID"
,
WEIXIN_APP_PAY_ID
...
...
video/app/src/main/java/com/mints/helivideo/ad/express/ExpressManager.kt
View file @
b2610406
...
@@ -22,12 +22,13 @@ import com.mints.helivideo.utils.UIUtils
...
@@ -22,12 +22,13 @@ import com.mints.helivideo.utils.UIUtils
import
java.lang.Exception
import
java.lang.Exception
import
java.util.ArrayList
import
java.util.ArrayList
private
val
TAG
=
ExpressManager
::
class
.
java
.
simpleName
/**
/**
* 信息流
* 信息流
*/
*/
class
ExpressManager
{
class
ExpressManager
{
private
val
TAG
=
ExpressManager
::
class
.
java
.
simpleName
companion
object
{
companion
object
{
val
instance
:
ExpressManager
by
lazy
(
mode
=
LazyThreadSafetyMode
.
SYNCHRONIZED
)
{
val
instance
:
ExpressManager
by
lazy
(
mode
=
LazyThreadSafetyMode
.
SYNCHRONIZED
)
{
...
...
video/app/src/main/java/com/mints/helivideo/ad/express/MyExpressManager.kt
View file @
b2610406
...
@@ -24,6 +24,8 @@ import java.util.ArrayList
...
@@ -24,6 +24,8 @@ import java.util.ArrayList
* 信息流
* 信息流
*/
*/
class
MyExpressManager
{
class
MyExpressManager
{
private
val
TAG
=
MyExpressManager
::
class
.
java
.
simpleName
companion
object
{
companion
object
{
val
instance
:
MyExpressManager
by
lazy
(
mode
=
LazyThreadSafetyMode
.
SYNCHRONIZED
)
{
val
instance
:
MyExpressManager
by
lazy
(
mode
=
LazyThreadSafetyMode
.
SYNCHRONIZED
)
{
...
@@ -49,14 +51,14 @@ class MyExpressManager {
...
@@ -49,14 +51,14 @@ class MyExpressManager {
LogUtil
.
d
(
LogUtil
.
d
(
TAG
,
TAG
,
"gromore信息流--> 1、进入预加载 isLoadSuccess=$isLoadSuccess isOversped=$isOversped isPreingOversped=$isPreingOversped"
"gromore
我的
信息流--> 1、进入预加载 isLoadSuccess=$isLoadSuccess isOversped=$isOversped isPreingOversped=$isPreingOversped"
)
)
if
((
isLoadSuccess
==
0
// 加载失败
if
((
isLoadSuccess
==
0
// 加载失败
||
adLoadTime
>
0
&&
isOversped
// 超过45分钟
||
adLoadTime
>
0
&&
isOversped
// 超过45分钟
||
adPreingTime
>
0
&&
isPreingOversped
&&
isLoadSuccess
==
1
)
// 预加载超时
||
adPreingTime
>
0
&&
isPreingOversped
&&
isLoadSuccess
==
1
)
// 预加载超时
)
{
)
{
LogUtil
.
d
(
TAG
,
"gromore信息流--> 2、执行预加载去了=$isLoadSuccess"
)
LogUtil
.
d
(
TAG
,
"gromore
我的
信息流--> 2、执行预加载去了=$isLoadSuccess"
)
adPreingTime
=
System
.
currentTimeMillis
()
adPreingTime
=
System
.
currentTimeMillis
()
isLoadSuccess
=
1
isLoadSuccess
=
1
...
@@ -75,7 +77,7 @@ class MyExpressManager {
...
@@ -75,7 +77,7 @@ class MyExpressManager {
val
adNativeLoader
=
TTAdSdk
.
getAdManager
().
createAdNative
(
activity
)
val
adNativeLoader
=
TTAdSdk
.
getAdManager
().
createAdNative
(
activity
)
val
adslot
=
AdSlot
.
Builder
()
val
adslot
=
AdSlot
.
Builder
()
.
setCodeId
(
BuildConfig
.
GROMORE_MYEXPRESS_CODE
)
.
setCodeId
(
BuildConfig
.
GROMORE_MY
_
EXPRESS_CODE
)
/**
/**
* 注:
* 注:
* 1:单位为px
* 1:单位为px
...
@@ -88,7 +90,7 @@ class MyExpressManager {
...
@@ -88,7 +90,7 @@ class MyExpressManager {
adNativeLoader
.
loadFeedAd
(
adslot
,
object
:
TTAdNative
.
FeedAdListener
{
adNativeLoader
.
loadFeedAd
(
adslot
,
object
:
TTAdNative
.
FeedAdListener
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
LogUtil
.
e
(
TAG
,
"gromore信息流--> 3、load feed ad error : $p0, $p1"
)
LogUtil
.
e
(
TAG
,
"gromore
我的
信息流--> 3、load feed ad error : $p0, $p1"
)
isLoadSuccess
=
0
isLoadSuccess
=
0
}
}
...
@@ -146,7 +148,7 @@ class MyExpressManager {
...
@@ -146,7 +148,7 @@ class MyExpressManager {
// 若上一个广告还在加载中则返回
// 若上一个广告还在加载中则返回
if
(
isLoadSuccess
==
1
)
{
if
(
isLoadSuccess
==
1
)
{
this
.
mExpressAdCallback
=
callback
this
.
mExpressAdCallback
=
callback
LogUtil
.
d
(
TAG
,
"gromore信息流--> 3.9、广告加载中 LoadSuccess = $isLoadSuccess"
)
LogUtil
.
d
(
TAG
,
"gromore
我的
信息流--> 3.9、广告加载中 LoadSuccess = $isLoadSuccess"
)
return
return
}
}
...
@@ -155,12 +157,12 @@ class MyExpressManager {
...
@@ -155,12 +157,12 @@ class MyExpressManager {
if
(
isLoadSuccess
==
2
&&
!
isOversped
)
{
if
(
isLoadSuccess
==
2
&&
!
isOversped
)
{
LogUtil
.
d
(
LogUtil
.
d
(
TAG
,
TAG
,
"gromore信息流--> 4、展示广告 LoadSuccess=$isLoadSuccess isOversped=$isOversped"
"gromore
我的
信息流--> 4、展示广告 LoadSuccess=$isLoadSuccess isOversped=$isOversped"
)
)
isLoadSuccess
=
0
isLoadSuccess
=
0
callback
?.
loadSuccess
(
frameLayout
)
callback
?.
loadSuccess
(
frameLayout
)
}
else
{
}
else
{
LogUtil
.
e
(
TAG
,
"gromore信息流--> 5、展示广告时失败了,广告可能超时45分钟 onError "
)
LogUtil
.
e
(
TAG
,
"gromore
我的
信息流--> 5、展示广告时失败了,广告可能超时45分钟 onError "
)
// 状态重置
// 状态重置
isLoadSuccess
=
0
isLoadSuccess
=
0
callback
?.
loadFail
()
callback
?.
loadFail
()
...
@@ -203,7 +205,7 @@ class MyExpressManager {
...
@@ -203,7 +205,7 @@ class MyExpressManager {
override
fun
onRenderFail
(
p0
:
View
?,
p1
:
String
?,
p2
:
Int
)
{
override
fun
onRenderFail
(
p0
:
View
?,
p1
:
String
?,
p2
:
Int
)
{
isLoadSuccess
=
0
isLoadSuccess
=
0
LogUtil
.
e
(
TAG
,
"gromore信息流--> 5、展示广告时失败了,onRenderFail msg=${p1} code=${p2} "
)
LogUtil
.
e
(
TAG
,
"gromore
我的
信息流--> 5、展示广告时失败了,onRenderFail msg=${p1} code=${p2} "
)
}
}
override
fun
onAdClick
()
{
override
fun
onAdClick
()
{
...
...
video/app/src/main/java/com/mints/helivideo/ui/fragment/MyFragment.kt
View file @
b2610406
...
@@ -14,7 +14,6 @@ import com.mints.helivideo.ad.AdManager
...
@@ -14,7 +14,6 @@ import com.mints.helivideo.ad.AdManager
import
com.mints.helivideo.ad.AdStatusListener
import
com.mints.helivideo.ad.AdStatusListener
import
com.mints.helivideo.ad.NoPreAdManager
import
com.mints.helivideo.ad.NoPreAdManager
import
com.mints.helivideo.ad.express.ExpressAdCallback
import
com.mints.helivideo.ad.express.ExpressAdCallback
import
com.mints.helivideo.ad.express.ExpressManager
import
com.mints.helivideo.ad.express.MyExpressManager
import
com.mints.helivideo.ad.express.MyExpressManager
import
com.mints.helivideo.common.AppConfig
import
com.mints.helivideo.common.AppConfig
import
com.mints.helivideo.common.Constant
import
com.mints.helivideo.common.Constant
...
...
video/gradle.properties
View file @
b2610406
...
@@ -50,6 +50,6 @@ GROMORE_APP_ID="5412556"
...
@@ -50,6 +50,6 @@ GROMORE_APP_ID="5412556"
GROMORE_SPLASH_CODE="102398740"
GROMORE_SPLASH_CODE="102398740"
GROMORE_VIDEO_CODE
=
"102398300"
GROMORE_VIDEO_CODE
=
"102398300"
GROMORE_EXPRESS_CODE="102405261"
GROMORE_EXPRESS_CODE="102405261"
GROMORE_MYEXPRESS_CODE
=
"102413160"
GROMORE_MY
_
EXPRESS_CODE
=
"102413160"
GROMORE_DRAW_CODE="102405069"
GROMORE_DRAW_CODE="102405069"
GROMORE_BANNER_CODE
=
"102405532"
GROMORE_BANNER_CODE
=
"102405532"
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