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
3e287e99
Commit
3e287e99
authored
Aug 21, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推荐剧集页添加大转盘,添加看激励视频解锁
parent
05b7805f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
24 deletions
+149
-24
MainFragment.kt
...main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
+3
-2
NewTxVideoActivity.kt
...n/java/com/mints/helivideo/video/tx/NewTxVideoActivity.kt
+95
-12
TxVideoActivity.kt
...main/java/com/mints/helivideo/video/tx/TxVideoActivity.kt
+0
-4
TxVideoAdapter.kt
...va/com/mints/helivideo/video/tx/adapter/TxVideoAdapter.kt
+23
-6
activity_new_tx_video.xml
video/app/src/main/res/layout/activity_new_tx_video.xml
+28
-0
No files found.
video/app/src/main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
View file @
3e287e99
...
...
@@ -190,9 +190,10 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
topAdapter
?.
setOnItemClickListener
(
object
:
TopAdapter
.
OnItemClickListener
{
override
fun
onItemClick
(
position
:
Int
)
{
if
(
topList
.
size
>
0
)
{
topList
[
position
].
createType
=
3
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
topList
.
get
(
position
)
topList
[
position
]
)
}
}
...
...
@@ -346,7 +347,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
return
}
else
{
ll_lucky
.
visibility
=
View
.
VISIBLE
context
?.
let
{
GlideUtils
.
loadRoundImageViewGif
(
it
,
R
.
drawable
.
ic_nine
,
iv_lucky_gif
)
}
context
?.
let
{
GlideUtils
.
loadRoundImageViewGif
(
it
,
R
.
drawable
.
ic_nine
,
iv_lucky_gif
)
}
}
val
complete
=
data
.
complete
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/NewTxVideoActivity.kt
View file @
3e287e99
...
...
@@ -5,6 +5,9 @@ import android.os.Bundle
import
android.view.View
import
com.google.gson.Gson
import
com.mints.helivideo.R
import
com.mints.helivideo.ad.AdManager
import
com.mints.helivideo.ad.AdStatusListener
import
com.mints.helivideo.ad.NoPreAdManager
import
com.mints.helivideo.ad.express.ExpressManager
import
com.mints.helivideo.common.Constant
import
com.mints.helivideo.manager.LocalVedioManager
...
...
@@ -18,6 +21,8 @@ import com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.ui.adapter.VideoEpisodeAdapter
import
com.mints.helivideo.ui.widgets.DialogListener
import
com.mints.helivideo.ui.widgets.VideoEpisodeDialog
import
com.mints.helivideo.utils.AppPreferencesManager
import
com.mints.helivideo.utils.SpanUtils
import
com.mints.helivideo.video.tx.adapter.TxVideoAdapter
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_new_tx_video.*
...
...
@@ -30,7 +35,9 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
var
mVipFlag
=
UserManager
.
getInstance
().
vipFlag
private
var
videos
=
ArrayList
<
VedioEpisodeBean
>()
private
var
mShowData
=
arrayListOf
<
VedioEpisodeBean
>()
private
var
mAllData
=
arrayListOf
<
VedioEpisodeBean
>()
private
var
dialog
:
VideoEpisodeDialog
?
=
null
...
...
@@ -72,6 +79,8 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
super
.
onResume
()
super_short_video_view
.
resume
()
videoPresenter
.
showTurn
()
if
(
mVipFlag
!=
UserManager
.
getInstance
().
vipFlag
&&
UserManager
.
getInstance
().
vipFlag
)
{
// 重置状态
isPlayNext
=
false
...
...
@@ -145,7 +154,21 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
fun
showEpisodeDialog
()
{
if
(
dialog
!=
null
&&
dialog
!!
.
isShowing
)
return
dialog
=
VideoEpisodeDialog
(
this
,
mVedioBean
,
object
:
DialogListener
()
{
val
vedioBean
=
VedioBean
()
mVedioBean
?.
let
{
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
vedioBean
.
unlockIndex
=
mShowData
.
size
}
else
{
vedioBean
.
unlockIndex
=
it
.
unlockIndex
}
vedioBean
.
title
=
it
.
title
vedioBean
.
completeStatus
=
it
.
completeStatus
vedioBean
.
vedioTotal
=
it
.
vedioTotal
vedioBean
.
seeIndex
=
it
.
seeIndex
vedioBean
.
vedioTotal
=
it
.
vedioTotal
}
dialog
=
VideoEpisodeDialog
(
this
,
vedioBean
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
...
...
@@ -172,8 +195,12 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
mVedioBean
=
indexList
.
vedioMsg
mVedioBean
?.
isRecommendVedio
=
true
indexBean
=
indexList
videos
.
clear
()
videos
.
addAll
(
indexList
.
list
)
mAllData
.
clear
()
mAllData
.
addAll
(
indexList
.
list
)
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
mShowData
.
add
(
mAllData
[
0
])
}
super_short_video_view
.
loadData
(
mVedioBean
,
getAdapterData
(),
playIndex
)
}
...
...
@@ -196,16 +223,31 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
videos
.
addAll
(
indexList
.
list
)
mVedioBean
!!
.
unlockIndex
=
videos
.
size
super_short_video_view
.
loadMoreData
(
getAdapterData
())
}
override
fun
unlockFail
()
{
}
override
fun
showTurnSuc
(
data
:
NineShowBean
)
{
AppPreferencesManager
.
get
()
.
put
(
Constant
.
LUCKY_FLAG
,
data
.
isShow
)
if
(
data
.
isShow
)
{
val
complete
=
data
.
complete
val
need
=
data
.
need
if
(
complete
>=
need
)
{
tv_lucky_status
.
text
=
SpanUtils
()
.
append
(
"可领取"
)
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
apk_uninstalled
))
.
create
()
}
else
{
tv_lucky_status
.
text
=
SpanUtils
()
.
append
(
complete
.
toString
())
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
red
))
.
append
(
"/"
)
.
append
(
need
.
toString
())
.
create
()
}
}
}
override
fun
onEpisodeClick
(
position
:
Int
)
{
...
...
@@ -223,14 +265,18 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
fun
getAdapterData
():
MutableList
<
VideoMultiItemEntity
>
{
val
data
=
mutableListOf
<
VideoMultiItemEntity
>()
if
(
videos
.
size
>
0
)
{
for
(
video
in
videos
)
{
if
(
mShowData
.
size
>
0
)
{
for
(
video
in
mShowData
)
{
val
item
=
VideoMultiItemEntity
(
MULTI_ITEM_1
,
video
,
VideoModel
(
video
.
vedioUrl
))
data
.
add
(
item
)
}
if
(
mVedioBean
!!
.
unlockIndex
<
mVedioBean
!!
.
vedioTotal
)
{
val
item
=
VideoMultiItemEntity
(
MULTI_ITEM_2
,
videos
[
0
],
VideoModel
(
videos
[
0
].
vedioUrl
))
VideoMultiItemEntity
(
MULTI_ITEM_2
,
mShowData
[
0
],
VideoModel
(
mShowData
[
0
].
vedioUrl
)
)
data
.
add
(
item
)
}
}
...
...
@@ -247,7 +293,38 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
finish
()
}
R
.
id
.
unlock
->
{
// 无看广告解锁
// 看广告解锁
val
carrierType
=
Constant
.
CARRIERTYPE_TX_VEDIO
AdManager
.
instance
.
showAd
(
this
,
carrierType
,
object
:
AdStatusListener
{
var
canFail
=
false
override
fun
adSuccess
()
{
canFail
=
true
}
override
fun
adFail
()
{
if
(
canFail
)
return
NoPreAdManager
.
loadVideoAd
(
this
@NewTxVideoActivity
,
carrierType
,
object
:
AdStatusListener
{
override
fun
adFail
()
{
showToast
(
"广告太火爆了,请稍候再试"
)
}
override
fun
adSuccess
()
{
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
addEpisodeData
(
position
)
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
addEpisodeData
(
position
)
}
})
}
R
.
id
.
vip
->
{
// 开通VIP
...
...
@@ -262,6 +339,12 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
private
fun
addEpisodeData
(
position
:
Int
)
{
if
(
position
>=
mAllData
.
size
)
return
mShowData
.
add
(
mAllData
[
position
])
super_short_video_view
.
loadMoreData
(
getAdapterData
())
}
// 用于点击匹配当前剧集对应的具体下标
private
fun
getRealPosition
(
position
:
Int
):
Int
{
var
readPosition
=
position
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/TxVideoActivity.kt
View file @
3e287e99
...
...
@@ -30,10 +30,6 @@ import com.mints.helivideo.video.tx.adapter.TxVideoAdapter
import
com.mints.library.utils.GlideUtils
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_tx_video.*
import
kotlinx.android.synthetic.main.activity_tx_video.iv_lucky_gif
import
kotlinx.android.synthetic.main.activity_tx_video.ll_lucky
import
kotlinx.android.synthetic.main.activity_tx_video.tv_lucky_status
import
kotlinx.android.synthetic.main.fragment_main.*
class
TxVideoActivity
:
BaseActivity
(),
View
.
OnClickListener
,
VideoView
,
VideoEpisodeAdapter
.
OnEpisodeClickListener
,
TxVideoAdapter
.
OnCustomChildClickListener
{
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/adapter/TxVideoAdapter.kt
View file @
3e287e99
...
...
@@ -84,12 +84,29 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
val
adBtn
=
holder
.
getView
<
View
>(
R
.
id
.
unlock
)
vedioBean
?.
let
{
if
(
it
.
isRecommendVedio
)
{
if
(
it
.
isRecommendVedio
)
{
// 推荐剧集逻辑
if
(
holder
.
adapterPosition
<
it
.
unlockIndex
)
{
// 观看激励视频解锁
vipBtn
.
visibility
=
View
.
GONE
adBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
String
.
format
(
"解锁%s·第%d集"
,
it
.
title
,
holder
.
adapterPosition
+
1
)
holder
.
getView
<
TextView
>(
R
.
id
.
tv_info
).
text
=
String
.
format
(
"看激励视频解锁1集剧情\n请按照顺序解锁"
)
}
else
{
// 开通会员解锁
adBtn
.
visibility
=
View
.
GONE
vipBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_info
).
visibility
=
View
.
GONE
vipBtn
.
setBackgroundResource
(
R
.
mipmap
.
bg_detail_bottom_vip
)
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
String
.
format
(
"解锁%s·全集"
,
it
.
title
)
}
}
else
{
adBtn
.
visibility
=
View
.
VISIBLE
...
...
video/app/src/main/res/layout/activity_new_tx_video.xml
View file @
3e287e99
...
...
@@ -59,5 +59,33 @@
</LinearLayout>
</FrameLayout>
<LinearLayout
android:id=
"@+id/ll_lucky"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"1dp"
android:visibility=
"gone"
android:layout_gravity=
"bottom|right"
android:layout_marginBottom=
"220dp"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_lucky_gif"
android:layout_width=
"80dp"
android:layout_height=
"70dp"
/>
<TextView
android:id=
"@+id/tv_lucky_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:background=
"@drawable/shape_bg_black2"
android:paddingLeft=
"16dp"
android:paddingRight=
"16dp"
android:text=
"0/5"
android:textColor=
"@color/white"
android:textSize=
"12sp"
/>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
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