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
95c2af77
Commit
95c2af77
authored
Aug 01, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
c1b64f4d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
22 deletions
+16
-22
AdManager.kt
video/app/src/main/java/com/mints/helivideo/ad/AdManager.kt
+0
-11
BannerManager.kt
.../main/java/com/mints/helivideo/ad/banner/BannerManager.kt
+0
-3
DrawExpressManager.kt
...in/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
+4
-3
ExpressManager.kt
...ain/java/com/mints/helivideo/ad/express/ExpressManager.kt
+2
-2
SplashActivity.kt
...n/java/com/mints/helivideo/ui/activitys/SplashActivity.kt
+2
-2
MainFragment.kt
...main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
+8
-1
No files found.
video/app/src/main/java/com/mints/helivideo/ad/AdManager.kt
View file @
95c2af77
...
...
@@ -44,15 +44,4 @@ class AdManager {
carrierType
,
)
}
/**
* 开屏页使用-预加载广告
*/
fun
splashPreLoadAll
(
activity
:
Activity
)
{
SplashManager
.
preLoadAd
(
activity
)
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
this
.
preLoadAd
(
activity
)
}
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/helivideo/ad/banner/BannerManager.kt
View file @
95c2af77
...
...
@@ -28,9 +28,6 @@ object BannerManager {
fun
loadAd
(
act
:
Activity
?,
view
:
FrameLayout
?)
{
weakActivity
=
WeakReference
<
Activity
>(
act
)
weakFrameLayout
=
WeakReference
<
FrameLayout
>(
view
)
// if (UserManager.getInstance().vipFlag) {
// return
// }
LogUtil
.
d
(
TAG
,
"gromore banner广告-> 1、进入加载"
)
/** 这里是简单的banner请求adSlot设置,如果需要更多的设置,可参考AdUtils.kt中bannerAdSlot函数部分。 */
...
...
video/app/src/main/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
View file @
95c2af77
...
...
@@ -183,7 +183,7 @@ class DrawExpressManager {
// 若上一个广告还在加载中则返回
if
(
isLoadSuccess
==
1
)
{
this
.
mExpressAdCallback
=
callback
LogUtil
.
e
(
TAG
,
"gromore draw信息流--> 3.9、广告加载中 LoadSuccess = $isLoadSuccess"
)
LogUtil
.
d
(
TAG
,
"gromore draw信息流--> 3.9、广告加载中 LoadSuccess = $isLoadSuccess"
)
return
}
...
...
@@ -255,11 +255,12 @@ class DrawExpressManager {
}
override
fun
onRenderFail
(
p0
:
View
?,
p1
:
String
?,
p2
:
Int
)
{
Log
.
i
(
TAG
,
"onRenderFail"
)
LogUtil
.
e
(
TAG
,
"gromore信息流--> 5、展示广告时失败了,onRenderFail msg=${p1} code=${p2} "
)
}
override
fun
onAdClick
()
{
Log
.
i
(
TAG
,
"onAdClick"
)
Log
Util
.
d
(
TAG
,
"onAdClick"
)
}
override
fun
onAdShow
()
{
...
...
video/app/src/main/java/com/mints/helivideo/ad/express/ExpressManager.kt
View file @
95c2af77
...
...
@@ -167,7 +167,7 @@ class ExpressManager {
// 若上一个广告还在加载中则返回
if
(
isLoadSuccess
==
1
)
{
this
.
mExpressAdCallback
=
callback
LogUtil
.
e
(
TAG
,
"gromore信息流--> 3.9、广告加载中 LoadSuccess = $isLoadSuccess"
)
LogUtil
.
d
(
TAG
,
"gromore信息流--> 3.9、广告加载中 LoadSuccess = $isLoadSuccess"
)
return
}
...
...
@@ -233,7 +233,7 @@ class ExpressManager {
override
fun
onRenderFail
(
p0
:
View
?,
p1
:
String
?,
p2
:
Int
)
{
isLoadSuccess
=
0
Log
.
i
(
TAG
,
"onRenderFail
"
)
Log
Util
.
e
(
TAG
,
"gromore信息流--> 5、展示广告时失败了,onRenderFail msg=${p1} code=${p2}
"
)
}
override
fun
onAdClick
()
{
...
...
video/app/src/main/java/com/mints/helivideo/ui/activitys/SplashActivity.kt
View file @
95c2af77
...
...
@@ -71,7 +71,7 @@ class SplashActivity : BaseActivity() {
private
fun
initData
()
{
val
firstSplash
=
get
().
getBoolean
(
Constant
.
FIRST_SPLASH
,
true
)
if
(!
firstSplash
)
{
AdManager
.
instance
.
splashPreLoadAll
(
this
)
SplashManager
.
preLoadAd
(
this
@SplashActivity
)
}
mProgressBar
!!
.
startOneAnim
()
try
{
...
...
@@ -92,7 +92,7 @@ class SplashActivity : BaseActivity() {
// 第一次安装时,延迟加载开屏广告,因为广告sdk还未初始化完成
val
firstSplash
=
get
().
getBoolean
(
Constant
.
FIRST_SPLASH
,
true
)
if
(
firstSplash
&&
millisUntilFinished
==
(
AD_TIME_OUT
-
2000
).
toLong
())
{
AdManager
.
instance
.
splashPreLoadAll
(
this
@SplashActivity
)
SplashManager
.
preLoadAd
(
this
@SplashActivity
)
get
().
put
(
Constant
.
FIRST_SPLASH
,
false
)
}
...
...
video/app/src/main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
View file @
95c2af77
...
...
@@ -13,6 +13,7 @@ import com.google.android.material.tabs.TabLayoutMediator
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
com.mints.helivideo.R
import
com.mints.helivideo.ad.AdManager
import
com.mints.helivideo.ad.banner.BannerManager
import
com.mints.helivideo.common.AppConfig
import
com.mints.helivideo.common.Constant
...
...
@@ -67,6 +68,10 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
initListener
()
loadData
()
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
AdManager
.
instance
.
preLoadAd
(
requireActivity
())
}
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
goToMainActivity
()
},
300
)
...
...
@@ -95,7 +100,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_ONE
)
{
if
(
AntiShake
.
check
(
banner
?.
id
))
return
BannerManager
.
loadAd
(
requireActivity
(),
fl_main_banner
)
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
BannerManager
.
loadAd
(
requireActivity
(),
fl_main_banner
)
}
if
(
AppConfig
.
exitLoginMainRefresh
)
{
AppConfig
.
exitLoginMainRefresh
=
false
...
...
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