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
0841eb5a
Commit
0841eb5a
authored
Aug 10, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化Draw信息流黑屏
parent
9e15f83d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1609 additions
and
697 deletions
+1609
-697
DrawExpressManager.kt
...in/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
+671
-685
HomeDrawExpressManager.kt
...ava/com/mints/helivideo/ad/draw/HomeDrawExpressManager.kt
+922
-0
RecommendVideoView.java
...java/com/mints/helivideo/video/tx/RecommendVideoView.java
+6
-3
TxVideoFragment.kt
...main/java/com/mints/helivideo/video/tx/TxVideoFragment.kt
+6
-6
TxRecommendVideoAdapter.kt
...nts/helivideo/video/tx/adapter/TxRecommendVideoAdapter.kt
+3
-3
super_short_video_view.xml
video/app/src/main/res/layout/super_short_video_view.xml
+1
-0
No files found.
video/app/src/main/java/com/mints/helivideo/ad/draw/DrawExpressManager.kt
View file @
0841eb5a
This diff is collapsed.
Click to expand it.
video/app/src/main/java/com/mints/helivideo/ad/draw/HomeDrawExpressManager.kt
0 → 100644
View file @
0841eb5a
This diff is collapsed.
Click to expand it.
video/app/src/main/java/com/mints/helivideo/video/tx/RecommendVideoView.java
View file @
0841eb5a
...
...
@@ -14,8 +14,9 @@ import androidx.annotation.NonNull;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.PagerSnapHelper
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.SimpleItemAnimator
;
import
com.mints.helivideo.ad.draw.DrawExpressManager
;
import
com.mints.helivideo.ad.draw.
Home
DrawExpressManager
;
import
com.mints.helivideo.manager.UserManager
;
import
com.mints.helivideo.mvp.model.VideoMultiItemEntity2
;
import
com.mints.helivideo.video.tx.adapter.TxRecommendVideoAdapter
;
...
...
@@ -91,11 +92,13 @@ public class RecommendVideoView extends RelativeLayout {
}
};
mRecyclerView
.
setLayoutManager
(
mLayoutManager
);
// mRecyclerView.setItemViewCacheSize(10
);
mRecyclerView
.
setItemViewCacheSize
(
6
);
mRecyclerView
.
setHasFixedSize
(
true
);
mRecyclerView
.
setDrawingCacheEnabled
(
true
);
mRecyclerView
.
setDrawingCacheQuality
(
View
.
DRAWING_CACHE_QUALITY_LOW
);
((
SimpleItemAnimator
)
mRecyclerView
.
getItemAnimator
()).
setSupportsChangeAnimations
(
false
);
mRecyclerView
.
setAdapter
(
mAdapter
);
addListener
();
}
...
...
@@ -280,7 +283,7 @@ public class RecommendVideoView extends RelativeLayout {
// 每隔3个视频出现一个广告
if
(
position
+
1
<
2
||
(
position
+
1
)
%
3
!=
0
||
lastAddAdPosition
>
position
)
return
;
if
(
DrawExpressManager
.
Companion
.
getInstance
().
getAdIsLoadSuc
())
{
if
(
Home
DrawExpressManager
.
Companion
.
getInstance
().
getAdIsLoadSuc
())
{
VideoMultiItemEntity2
itemAD
=
new
VideoMultiItemEntity2
(
MULTI_ITEM_3
,
null
,
new
VideoModel
(
""
));
mList
.
add
(
position
+
1
,
itemAD
);
mAdapter
.
notifyItemInserted
(
position
+
1
);
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/TxVideoFragment.kt
View file @
0841eb5a
...
...
@@ -4,7 +4,7 @@ import android.os.Bundle
import
android.view.View
import
androidx.fragment.app.Fragment
import
com.mints.helivideo.R
import
com.mints.helivideo.ad.draw.DrawExpressManager
import
com.mints.helivideo.ad.draw.
Home
DrawExpressManager
import
com.mints.helivideo.common.AppConfig
import
com.mints.helivideo.common.Constant
import
com.mints.helivideo.manager.LocalVedioManager
...
...
@@ -39,10 +39,6 @@ class TxVideoFragment : BaseFragment(), RecommendView {
override
fun
initViewsAndEvents
()
{
recommendPresenter
.
attachView
(
this
)
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
DrawExpressManager
.
instance
.
preLoadAd
()
}
recommendPresenter
.
autoList
()
recommend_view
.
setOnLoadMoreListener
{
...
...
@@ -97,6 +93,10 @@ class TxVideoFragment : BaseFragment(), RecommendView {
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
!=
Constant
.
FRAGMENT_CLICK_TWO
)
return
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
HomeDrawExpressManager
.
instance
.
preLoadAd
()
}
recommend_view
.
resume
()
}
...
...
@@ -110,7 +110,7 @@ class TxVideoFragment : BaseFragment(), RecommendView {
super
.
onDestroyView
()
recommend_view
.
releasePlayer
()
DrawExpressManager
.
instance
.
destroy
()
Home
DrawExpressManager
.
instance
.
destroy
()
}
override
fun
onDetach
()
{
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/adapter/TxRecommendVideoAdapter.kt
View file @
0841eb5a
...
...
@@ -11,7 +11,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.mints.helivideo.R
import
com.mints.helivideo.ad.draw.DrawExpressManager
import
com.mints.helivideo.ad.draw.
Home
DrawExpressManager
import
com.mints.helivideo.ad.express.ExpressAdCallback
import
com.mints.helivideo.mvp.model.*
import
com.mints.helivideo.utils.UIUtils
...
...
@@ -78,7 +78,7 @@ class TxRecommendVideoAdapter :
}
private
fun
initAdHolder
(
holder
:
BaseViewHolder
)
{
DrawExpressManager
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
Home
DrawExpressManager
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
adView
?.
let
{
UIUtils
.
removeFromParent
(
it
)
...
...
@@ -86,7 +86,7 @@ class TxRecommendVideoAdapter :
fmAd
.
removeAllViews
()
fmAd
.
addView
(
it
)
}
DrawExpressManager
.
instance
.
preLoadAd
()
Home
DrawExpressManager
.
instance
.
preLoadAd
()
}
override
fun
renderSuccess
(
adView
:
FrameLayout
?):
Boolean
{
...
...
video/app/src/main/res/layout/super_short_video_view.xml
View file @
0841eb5a
...
...
@@ -6,6 +6,7 @@
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/src_video"
app:srlEnableRefresh=
"false"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:srlAccentColor=
"@color/black"
...
...
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