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
e3002302
Commit
e3002302
authored
Nov 02, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化信息流展示,优化自有剧弹框逻辑
parent
cc8228fe
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
213 additions
and
119 deletions
+213
-119
BannerManager.kt
...in/java/com/duben/supertheater/ad/banner/BannerManager.kt
+5
-0
MainExpressManager.kt
...a/com/duben/supertheater/ad/express/MainExpressManager.kt
+5
-2
MyExpressManager.kt
...ava/com/duben/supertheater/ad/express/MyExpressManager.kt
+6
-3
VideoMultiItemEntity.kt
.../com/duben/supertheater/mvp/model/VideoMultiItemEntity.kt
+1
-1
VideoPresenter.kt
...a/com/duben/supertheater/mvp/presenters/VideoPresenter.kt
+43
-0
LoanService.java
...src/main/java/com/duben/supertheater/net/LoanService.java
+8
-0
NewTxVideoActivity.kt
...ava/com/duben/supertheater/video/tx/NewTxVideoActivity.kt
+37
-21
TxVideoActivity.kt
...n/java/com/duben/supertheater/video/tx/TxVideoActivity.kt
+36
-32
TxVideoAdapter.kt
...com/duben/supertheater/video/tx/adapter/TxVideoAdapter.kt
+60
-56
item_block_view.xml
video/app/src/main/res/layout/item_block_view.xml
+10
-2
ShareSDK.xml
video/tmpmob/ShareSDK/assets/ShareSDK.xml
+2
-2
No files found.
video/app/src/main/java/com/duben/supertheater/ad/banner/BannerManager.kt
View file @
e3002302
...
@@ -40,6 +40,11 @@ object BannerManager {
...
@@ -40,6 +40,11 @@ object BannerManager {
UIUtils
.
getAdWidth2
(
MintsApplication
.
getContext
()).
toInt
(),
UIUtils
.
getAdWidth2
(
MintsApplication
.
getContext
()).
toInt
(),
0
0
)
// 单位px
)
// 单位px
.
supportRenderControl
()
//支持模板样式
.
setExpressViewAcceptedSize
(
UIUtils
.
getAdWidth2
(
MintsApplication
.
getContext
()),
0f
)
//设置模板宽高(dp)
.
setUserID
(
"1234"
)
.
setUserID
(
"1234"
)
.
setMediationAdSlot
(
.
setMediationAdSlot
(
MediationAdSlot
.
Builder
()
MediationAdSlot
.
Builder
()
...
...
video/app/src/main/java/com/duben/supertheater/ad/express/MainExpressManager.kt
View file @
e3002302
...
@@ -51,9 +51,10 @@ class MainExpressManager {
...
@@ -51,9 +51,10 @@ class MainExpressManager {
*/
*/
.
setImageAcceptedSize
(
.
setImageAcceptedSize
(
UIUtils
.
getAdWidth2
(
MintsApplication
.
getContext
()).
toInt
(),
UIUtils
.
getAdWidth2
(
MintsApplication
.
getContext
()).
toInt
(),
// UIUtils.dip2px(MintsApplication.getContext(), 192f)
0
0
)
)
.
supportRenderControl
()
//支持模板样式
.
setExpressViewAcceptedSize
(
330f
,
0f
)
//设置模板宽高(dp)
.
setAdCount
(
2
)
//请求广告数量为1到3条 (优先采用平台配置的数量)
.
setAdCount
(
2
)
//请求广告数量为1到3条 (优先采用平台配置的数量)
.
build
()
.
build
()
...
@@ -153,7 +154,9 @@ class MainExpressManager {
...
@@ -153,7 +154,9 @@ class MainExpressManager {
}
}
override
fun
onAdShow
()
{
override
fun
onAdShow
()
{
if
(
it
!=
null
&&
it
!!
.
getMediationManager
()!=
null
&&
it
!!
.
getMediationManager
().
getShowEcpm
()
!=
null
)
{
if
(
it
!=
null
&&
it
!!
.
getMediationManager
()
!=
null
&&
it
!!
.
getMediationManager
()
.
getShowEcpm
()
!=
null
)
{
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"adcode"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getSlotId
()
vo
[
"adcode"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getSlotId
()
vo
[
"ecpm"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getEcpm
()
vo
[
"ecpm"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getEcpm
()
...
...
video/app/src/main/java/com/duben/supertheater/ad/express/MyExpressManager.kt
View file @
e3002302
...
@@ -89,6 +89,8 @@ class MyExpressManager {
...
@@ -89,6 +89,8 @@ class MyExpressManager {
* 2:如果是信息流模板广告,宽度设置为希望的宽度,高度设置为0(0为高度选择自适应参数)
* 2:如果是信息流模板广告,宽度设置为希望的宽度,高度设置为0(0为高度选择自适应参数)
*/
*/
.
setImageAcceptedSize
(
UIUtils
.
getAdWidth
(
MintsApplication
.
getContext
()).
toInt
(),
0
)
.
setImageAcceptedSize
(
UIUtils
.
getAdWidth
(
MintsApplication
.
getContext
()).
toInt
(),
0
)
.
supportRenderControl
()
//支持模板样式
.
setExpressViewAcceptedSize
(
300f
,
0f
)
//设置模板宽高(dp)
.
setAdCount
(
3
)
//请求广告数量为1到3条 (优先采用平台配置的数量)
.
setAdCount
(
3
)
//请求广告数量为1到3条 (优先采用平台配置的数量)
.
build
()
.
build
()
...
@@ -217,8 +219,9 @@ class MyExpressManager {
...
@@ -217,8 +219,9 @@ class MyExpressManager {
}
}
override
fun
onAdShow
()
{
override
fun
onAdShow
()
{
if
(
it
!=
null
&&
it
!!
.
getMediationManager
()!=
null
if
(
it
!=
null
&&
it
!!
.
getMediationManager
()
!=
null
&&
it
!!
.
getMediationManager
().
getShowEcpm
()
!=
null
)
{
&&
it
!!
.
getMediationManager
().
getShowEcpm
()
!=
null
)
{
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"adcode"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getSlotId
()
vo
[
"adcode"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getSlotId
()
vo
[
"ecpm"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getEcpm
()
vo
[
"ecpm"
]
=
it
!!
.
getMediationManager
().
getShowEcpm
().
getEcpm
()
...
@@ -799,7 +802,7 @@ class MyExpressManager {
...
@@ -799,7 +802,7 @@ class MyExpressManager {
adViewHolder
.
mDescription
?.
text
=
it
.
description
//description为广告的较长的说明
adViewHolder
.
mDescription
?.
text
=
it
.
description
//description为广告的较长的说明
println
(
"mcg -->>> title="
+
it
.
title
+
" description="
+
it
.
description
)
println
(
"mcg -->>> title="
+
it
.
title
+
" description="
+
it
.
description
)
adViewHolder
.
mSource
?.
text
=
adViewHolder
.
mSource
?.
text
=
if
(
TextUtils
.
isEmpty
(
it
.
source
))
"广告来源"
else
it
.
source
if
(
TextUtils
.
isEmpty
(
it
.
source
))
"广告来源"
else
it
.
source
...
...
video/app/src/main/java/com/duben/supertheater/mvp/model/VideoMultiItemEntity.kt
View file @
e3002302
...
@@ -9,7 +9,7 @@ const val MULTI_ITEM_2 = 2
...
@@ -9,7 +9,7 @@ const val MULTI_ITEM_2 = 2
const
val
MULTI_ITEM_3
=
3
const
val
MULTI_ITEM_3
=
3
data class
VideoMultiItemEntity
(
data class
VideoMultiItemEntity
(
override
va
l
itemType
:
Int
,
override
va
r
itemType
:
Int
,
var
video
:
IndexList
.
VedioEpisodeBean
?,
var
video
:
IndexList
.
VedioEpisodeBean
?,
var
videoModel
:
VideoModel
?
var
videoModel
:
VideoModel
?
)
:
MultiItemEntity
,
java
.
io
.
Serializable
)
:
MultiItemEntity
,
java
.
io
.
Serializable
...
...
video/app/src/main/java/com/duben/supertheater/mvp/presenters/VideoPresenter.kt
View file @
e3002302
...
@@ -53,6 +53,49 @@ class VideoPresenter : BasePresenter<VideoView>() {
...
@@ -53,6 +53,49 @@ class VideoPresenter : BasePresenter<VideoView>() {
})
})
}
}
fun
getIndexListA
(
thirdId
:
String
,
csj
:
Boolean
=
false
)
{
val
vo
=
HashMap
<
String
,
Any
>()
if
(
csj
)
{
vo
[
"thirdId"
]
=
thirdId
}
else
{
vo
[
"vedioId"
]
=
thirdId
}
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getIndexListA
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
IndexList
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
IndexList
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
getIndexListSuc
(
baseResponse
.
data
)
else
->
{
view
.
getIndexListFail
()
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
view
.
getIndexListFail
()
}
})
}
fun
unlock
(
vo
:
HashMap
<
String
,
Any
>)
{
fun
unlock
(
vo
:
HashMap
<
String
,
Any
>)
{
AppHttpManager
.
getInstance
(
loanApplication
)
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
.
call
(
...
...
video/app/src/main/java/com/duben/supertheater/net/LoanService.java
View file @
e3002302
...
@@ -153,6 +153,14 @@ public interface LoanService {
...
@@ -153,6 +153,14 @@ public interface LoanService {
@POST
(
"api/vedio/getIndexList"
)
@POST
(
"api/vedio/getIndexList"
)
Observable
<
BaseResponse
<
IndexList
>>
getIndexList
(
@Body
Map
<
String
,
Object
>
vo
);
Observable
<
BaseResponse
<
IndexList
>>
getIndexList
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 剧情列表
*
* @return
*/
@POST
(
"api/vedio/getIndexLista"
)
Observable
<
BaseResponse
<
IndexList
>>
getIndexListA
(
@Body
Map
<
String
,
Object
>
vo
);
/**
/**
* 收藏
* 收藏
*
*
...
...
video/app/src/main/java/com/duben/supertheater/video/tx/NewTxVideoActivity.kt
View file @
e3002302
...
@@ -20,7 +20,6 @@ import com.duben.supertheater.R
...
@@ -20,7 +20,6 @@ import com.duben.supertheater.R
import
com.duben.supertheater.ad.AdManager
import
com.duben.supertheater.ad.AdManager
import
com.duben.supertheater.ad.AdStatusListener
import
com.duben.supertheater.ad.AdStatusListener
import
com.duben.supertheater.ad.NoPreAdManager
import
com.duben.supertheater.ad.NoPreAdManager
import
com.duben.supertheater.ad.draw.DrawExpressManager
import
com.duben.supertheater.ad.express.ExpressManager
import
com.duben.supertheater.ad.express.ExpressManager
import
com.duben.supertheater.common.Constant
import
com.duben.supertheater.common.Constant
import
com.duben.supertheater.manager.LocalVedioManager
import
com.duben.supertheater.manager.LocalVedioManager
...
@@ -82,7 +81,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -82,7 +81,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
HalfScreenManager
.
getInstance
().
preLoadAd
(
this
)
HalfScreenManager
.
getInstance
().
preLoadAd
(
this
)
videoPresenter
.
attachView
(
this
)
videoPresenter
.
attachView
(
this
)
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
A
(
""
+
it
.
vedioId
)
}
initView
()
initView
()
}
}
...
@@ -109,7 +108,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -109,7 +108,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
// 重置状态
// 重置状态
isPlayNext
=
false
isPlayNext
=
false
playIndex
=
super_short_video_view
.
currentPosition
playIndex
=
super_short_video_view
.
currentPosition
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
A
(
""
+
it
.
vedioId
)
}
}
}
}
}
...
@@ -145,7 +144,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -145,7 +144,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
super_short_video_view
.
setOnPageChangeListener
{
super_short_video_view
.
setOnPageChangeListener
{
if
(
super_short_video_view
.
isAdPosition
(
it
)
||
super_short_video_view
.
isLuckPosition
(
it
))
{
if
(
super_short_video_view
.
isAdPosition
(
it
)
||
super_short_video_view
.
isLuckPosition
(
it
))
{
showLockDialog
()
showLockDialog
()
fm_bottom
.
visibility
=
View
.
GONE
//
fm_bottom.visibility = View.GONE
super_short_video_view
.
pause
()
super_short_video_view
.
pause
()
return
@setOnPageChangeListener
return
@setOnPageChangeListener
}
}
...
@@ -240,9 +239,17 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -240,9 +239,17 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
videos
.
addAll
(
indexList
.
list
)
// videos.addAll(indexList.list)
mVedioBean
!!
.
unlockIndex
=
videos
.
size
// mVedioBean!!.unlockIndex = videos.size
super_short_video_view
.
loadMoreData
(
getAdapterData
())
// super_short_video_view.loadMoreData(getAdapterData())
val
lockSet
=
if
(
mVedioBean
!!
.
adGiveVedioNum
==
0
)
1
else
mVedioBean
!!
.
adGiveVedioNum
mVedioBean
!!
.
unlockIndex
+=
lockSet
super_short_video_view
.
loadData
(
mVedioBean
,
getAdapterData
(),
mVedioBean
!!
.
unlockIndex
-
lockSet
)
}
}
override
fun
unlockFail
()
{
override
fun
unlockFail
()
{
...
@@ -269,11 +276,11 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -269,11 +276,11 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
onEpisodeClick
(
position
:
Int
)
{
override
fun
onEpisodeClick
(
position
:
Int
)
{
dialog
?.
dismiss
()
dialog
?.
dismiss
()
val
data
=
super_short_video_view
.
data
//
val data = super_short_video_view.data
if
(
position
>=
mVedioBean
!!
.
unlockIndex
)
{
//
if (position >= mVedioBean!!.unlockIndex) {
super_short_video_view
.
onItemClick
(
data
.
size
-
1
)
//
super_short_video_view.onItemClick(data.size - 1)
return
//
return
}
//
}
val
readPosition
=
getRealPosition
(
position
+
1
)
val
readPosition
=
getRealPosition
(
position
+
1
)
...
@@ -283,15 +290,24 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -283,15 +290,24 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
fun
getAdapterData
():
MutableList
<
VideoMultiItemEntity
>
{
private
fun
getAdapterData
():
MutableList
<
VideoMultiItemEntity
>
{
val
data
=
mutableListOf
<
VideoMultiItemEntity
>()
val
data
=
mutableListOf
<
VideoMultiItemEntity
>()
if
(
videos
.
size
>
0
)
{
if
(
videos
.
size
>
0
)
{
for
(
video
in
videos
)
{
for
(
i
in
0
until
videos
.
size
)
{
val
item
=
VideoMultiItemEntity
(
MULTI_ITEM_1
,
video
,
VideoModel
(
video
.
vedioUrl
))
data
.
add
(
item
)
}
if
(
mVedioBean
!!
.
unlockIndex
<
mVedioBean
!!
.
vedioTotal
)
{
val
item
=
val
item
=
VideoMultiItemEntity
(
MULTI_ITEM_2
,
videos
[
0
],
VideoModel
(
videos
[
0
].
vedioUrl
))
VideoMultiItemEntity
(
MULTI_ITEM_1
,
videos
[
i
],
VideoModel
(
videos
[
i
].
vedioUrl
))
if
(
i
>=
mVedioBean
!!
.
unlockIndex
)
{
item
.
itemType
=
MULTI_ITEM_2
}
data
.
add
(
item
)
data
.
add
(
item
)
}
}
// for (video in videos) {
// 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))
// data.add(item)
// }
}
}
return
data
return
data
}
}
...
@@ -305,7 +321,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -305,7 +321,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
finish
()
finish
()
}
}
R
.
id
.
unlock
->
{
R
.
id
.
unlock
,
R
.
id
.
block_view
->
{
// 看广告解锁
// 看广告解锁
// val carrierType = Constant.CARRIERTYPE_TX_VEDIO
// val carrierType = Constant.CARRIERTYPE_TX_VEDIO
// showAd(carrierType)
// showAd(carrierType)
...
@@ -346,7 +362,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -346,7 +362,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
var
readIndex
=
position
var
readIndex
=
position
val
data
=
super_short_video_view
.
data
val
data
=
super_short_video_view
.
data
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
[
position
].
itemType
==
MULTI_ITEM_1
)
{
if
(
data
[
position
].
itemType
==
MULTI_ITEM_1
||
data
[
position
].
itemType
==
MULTI_ITEM_2
)
{
readIndex
=
data
[
position
].
video
!!
.
vedioIndex
readIndex
=
data
[
position
].
video
!!
.
vedioIndex
}
}
}
}
...
@@ -359,7 +375,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -359,7 +375,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
val
data
=
super_short_video_view
.
data
val
data
=
super_short_video_view
.
data
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
!=
null
&&
data
.
size
>
0
)
{
for
(
i
in
0
until
data
.
size
)
{
for
(
i
in
0
until
data
.
size
)
{
if
(
data
[
i
].
itemType
==
MULTI_ITEM_1
)
{
if
(
data
[
i
].
itemType
==
MULTI_ITEM_1
||
data
[
i
].
itemType
==
MULTI_ITEM_2
)
{
if
(
data
[
i
].
video
!!
.
vedioIndex
==
position
)
{
if
(
data
[
i
].
video
!!
.
vedioIndex
==
position
)
{
readPosition
=
i
readPosition
=
i
break
break
...
...
video/app/src/main/java/com/duben/supertheater/video/tx/TxVideoActivity.kt
View file @
e3002302
...
@@ -10,10 +10,8 @@ import android.os.Handler
...
@@ -10,10 +10,8 @@ import android.os.Handler
import
android.os.Looper
import
android.os.Looper
import
android.view.View
import
android.view.View
import
android.view.animation.LinearInterpolator
import
android.view.animation.LinearInterpolator
import
android.widget.FrameLayout
import
android.widget.ImageView
import
android.widget.ImageView
import
android.widget.RelativeLayout
import
android.widget.RelativeLayout
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.daimajia.androidanimations.library.YoYo
...
@@ -22,7 +20,6 @@ import com.duben.supertheater.R
...
@@ -22,7 +20,6 @@ import com.duben.supertheater.R
import
com.duben.supertheater.ad.AdManager
import
com.duben.supertheater.ad.AdManager
import
com.duben.supertheater.ad.AdStatusListener
import
com.duben.supertheater.ad.AdStatusListener
import
com.duben.supertheater.ad.NoPreAdManager
import
com.duben.supertheater.ad.NoPreAdManager
import
com.duben.supertheater.ad.draw.DrawExpressManager
import
com.duben.supertheater.ad.express.ExpressManager
import
com.duben.supertheater.ad.express.ExpressManager
import
com.duben.supertheater.common.Constant
import
com.duben.supertheater.common.Constant
import
com.duben.supertheater.manager.LocalVedioManager
import
com.duben.supertheater.manager.LocalVedioManager
...
@@ -42,13 +39,6 @@ import com.duben.supertheater.ui.widgets.countdowntimer.CountDownTimerSupport
...
@@ -42,13 +39,6 @@ import com.duben.supertheater.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.duben.supertheater.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.duben.supertheater.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.duben.supertheater.utils.*
import
com.duben.supertheater.utils.*
import
kotlinx.android.synthetic.main.activity_tx_video.*
import
kotlinx.android.synthetic.main.activity_tx_video.*
import
kotlinx.android.synthetic.main.activity_tx_video.cl_reward
import
kotlinx.android.synthetic.main.activity_tx_video.episode_tv
import
kotlinx.android.synthetic.main.activity_tx_video.fm_bottom
import
kotlinx.android.synthetic.main.activity_tx_video.iv_cash_reward
import
kotlinx.android.synthetic.main.activity_tx_video.iv_gold_reward
import
kotlinx.android.synthetic.main.activity_tx_video.tv_cash_reward
import
kotlinx.android.synthetic.main.activity_tx_video.tv_gold_reward
import
kotlinx.android.synthetic.main.layout_draw_header.*
import
kotlinx.android.synthetic.main.layout_draw_header.*
import
kotlinx.android.synthetic.main.layout_red_box.*
import
kotlinx.android.synthetic.main.layout_red_box.*
...
@@ -88,7 +78,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -88,7 +78,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
HalfScreenManager
.
getInstance
().
preLoadAd
(
this
)
HalfScreenManager
.
getInstance
().
preLoadAd
(
this
)
videoPresenter
.
attachView
(
this
)
videoPresenter
.
attachView
(
this
)
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
A
(
""
+
it
.
vedioId
)
}
initView
()
initView
()
}
}
...
@@ -115,7 +105,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -115,7 +105,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
// 重置状态
// 重置状态
isPlayNext
=
false
isPlayNext
=
false
playIndex
=
super_short_video_view
.
currentPosition
playIndex
=
super_short_video_view
.
currentPosition
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
A
(
""
+
it
.
vedioId
)
}
}
}
}
}
...
@@ -149,12 +139,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -149,12 +139,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
if
(
mVedioBean
?.
completeStatus
==
0
)
"已完结"
else
"更新中"
if
(
mVedioBean
?.
completeStatus
==
0
)
"已完结"
else
"更新中"
)
)
super_short_video_view
.
setOnCustomChildClickListener
(
this
)
super_short_video_view
.
setOnCustomChildClickListener
(
this
)
super_short_video_view
.
setOnCustomChildClickListener
(
this
)
super_short_video_view
.
setOnPageChangeListener
{
super_short_video_view
.
setOnPageChangeListener
{
if
(
super_short_video_view
.
isAdPosition
(
it
)
||
super_short_video_view
.
isLuckPosition
(
it
))
{
if
(
super_short_video_view
.
isAdPosition
(
it
)
||
super_short_video_view
.
isLuckPosition
(
it
))
{
showLockDialog
()
showLockDialog
()
fm_bottom
.
visibility
=
View
.
GONE
//
fm_bottom.visibility = View.GONE
super_short_video_view
.
pause
()
super_short_video_view
.
pause
()
return
@setOnPageChangeListener
return
@setOnPageChangeListener
}
}
...
@@ -239,9 +228,16 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -239,9 +228,16 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
videos
.
addAll
(
indexList
.
list
)
// videos.addAll(indexList.list)
mVedioBean
!!
.
unlockIndex
=
videos
.
size
// mVedioBean!!.unlockIndex = videos.size
super_short_video_view
.
loadMoreData
(
getAdapterData
())
// super_short_video_view.loadMoreData(getAdapterData())
val
lockSet
=
if
(
mVedioBean
!!
.
adGiveVedioNum
==
0
)
1
else
mVedioBean
!!
.
adGiveVedioNum
mVedioBean
!!
.
unlockIndex
+=
lockSet
super_short_video_view
.
loadData
(
mVedioBean
,
getAdapterData
(),
mVedioBean
!!
.
unlockIndex
-
lockSet
)
}
}
override
fun
unlockFail
()
{
override
fun
unlockFail
()
{
...
@@ -297,11 +293,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -297,11 +293,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
onEpisodeClick
(
position
:
Int
)
{
override
fun
onEpisodeClick
(
position
:
Int
)
{
dialog
?.
dismiss
()
dialog
?.
dismiss
()
val
data
=
super_short_video_view
.
data
//
val data = super_short_video_view.data
if
(
position
>=
mVedioBean
!!
.
unlockIndex
)
{
//
if (position >= mVedioBean!!.unlockIndex) {
super_short_video_view
.
onItemClick
(
data
.
size
-
1
)
//
super_short_video_view.onItemClick(data.size - 1)
return
//
return
}
//
}
val
readPosition
=
getRealPosition
(
position
+
1
)
val
readPosition
=
getRealPosition
(
position
+
1
)
...
@@ -311,15 +307,24 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -311,15 +307,24 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
fun
getAdapterData
():
MutableList
<
VideoMultiItemEntity
>
{
private
fun
getAdapterData
():
MutableList
<
VideoMultiItemEntity
>
{
val
data
=
mutableListOf
<
VideoMultiItemEntity
>()
val
data
=
mutableListOf
<
VideoMultiItemEntity
>()
if
(
videos
.
size
>
0
)
{
if
(
videos
.
size
>
0
)
{
for
(
video
in
videos
)
{
for
(
i
in
0
until
videos
.
size
)
{
val
item
=
VideoMultiItemEntity
(
MULTI_ITEM_1
,
video
,
VideoModel
(
video
.
vedioUrl
))
data
.
add
(
item
)
}
if
(
mVedioBean
!!
.
unlockIndex
<
mVedioBean
!!
.
vedioTotal
)
{
val
item
=
val
item
=
VideoMultiItemEntity
(
MULTI_ITEM_2
,
videos
[
0
],
VideoModel
(
videos
[
0
].
vedioUrl
))
VideoMultiItemEntity
(
MULTI_ITEM_1
,
videos
[
i
],
VideoModel
(
videos
[
i
].
vedioUrl
))
if
(
i
>=
mVedioBean
!!
.
unlockIndex
)
{
item
.
itemType
=
MULTI_ITEM_2
}
data
.
add
(
item
)
data
.
add
(
item
)
}
}
// for (video in videos) {
// 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))
// data.add(item)
// }
}
}
return
data
return
data
}
}
...
@@ -332,8 +337,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -332,8 +337,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
// 返回
// 返回
finish
()
finish
()
}
}
R
.
id
.
unlock
,
R
.
id
.
block_view
->
{
R
.
id
.
unlock
->
{
// 看广告解锁
// 看广告解锁
// val carrierType = Constant.CARRIERTYPE_TX_VEDIO
// val carrierType = Constant.CARRIERTYPE_TX_VEDIO
// showAd(carrierType)
// showAd(carrierType)
...
@@ -374,7 +378,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -374,7 +378,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
var
readIndex
=
position
var
readIndex
=
position
val
data
=
super_short_video_view
.
data
val
data
=
super_short_video_view
.
data
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
[
position
].
itemType
==
MULTI_ITEM_1
)
{
if
(
data
[
position
].
itemType
==
MULTI_ITEM_1
||
data
[
position
].
itemType
==
MULTI_ITEM_2
)
{
readIndex
=
data
[
position
].
video
!!
.
vedioIndex
readIndex
=
data
[
position
].
video
!!
.
vedioIndex
}
}
}
}
...
@@ -387,7 +391,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -387,7 +391,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
val
data
=
super_short_video_view
.
data
val
data
=
super_short_video_view
.
data
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
!=
null
&&
data
.
size
>
0
)
{
for
(
i
in
0
until
data
.
size
)
{
for
(
i
in
0
until
data
.
size
)
{
if
(
data
[
i
].
itemType
==
MULTI_ITEM_1
)
{
if
(
data
[
i
].
itemType
==
MULTI_ITEM_1
||
data
[
i
].
itemType
==
MULTI_ITEM_2
)
{
if
(
data
[
i
].
video
!!
.
vedioIndex
==
position
)
{
if
(
data
[
i
].
video
!!
.
vedioIndex
==
position
)
{
readPosition
=
i
readPosition
=
i
break
break
...
...
video/app/src/main/java/com/duben/supertheater/video/tx/adapter/TxVideoAdapter.kt
View file @
e3002302
...
@@ -68,64 +68,68 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
...
@@ -68,64 +68,68 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
}
}
private
fun
initLockHolder
(
holder
:
BaseViewHolder
)
{
private
fun
initLockHolder
(
holder
:
BaseViewHolder
)
{
Glide
.
with
(
context
).
load
(
vedioBean
?.
coverImage
)
holder
.
itemView
.
setOnClickListener
{
.
into
(
holder
.
getView
(
R
.
id
.
iv_bg
))
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
val
vipBtn
=
holder
.
getView
<
View
>(
R
.
id
.
vip
)
if
(
UserManager
.
getInstance
().
newFlag
)
{
// 匹配
vipBtn
.
visibility
=
View
.
VISIBLE
vipBtn
.
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
}
}
else
{
// 未匹配
vipBtn
.
visibility
=
View
.
GONE
}
}
val
adBtn
=
holder
.
getView
<
View
>(
R
.
id
.
unlock
)
Glide
.
with
(
context
).
load
(
vedioBean
?.
coverImage
)
vedioBean
?.
let
{
.
into
(
holder
.
getView
(
R
.
id
.
iv_bg
))
if
(
it
.
isRecommendVedio
)
{
// 推荐剧集逻辑
// val vipBtn = holder.getView<View>(R.id.vip)
if
(
holder
.
adapterPosition
<
it
.
unlockIndex
)
{
// 观看激励视频解锁
// if (UserManager.getInstance().newFlag) {
// // 匹配
vipBtn
.
visibility
=
View
.
GONE
// vipBtn.visibility = View.VISIBLE
adBtn
.
visibility
=
View
.
VISIBLE
// vipBtn.setOnClickListener {
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
String
.
format
(
// mOnCustomChildClickListener?.onCustomChildClick(it, holder.adapterPosition)
"解锁%s·第%d集"
,
// }
it
.
title
,
// } else {
holder
.
adapterPosition
+
1
// // 未匹配
)
// vipBtn.visibility = View.GONE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_info
).
text
=
String
.
format
(
// }
"看激励视频解锁1集剧情\n请按照顺序解锁"
//
)
// val adBtn = holder.getView<View>(R.id.unlock)
}
else
{
// 开通会员解锁
// vedioBean?.let {
adBtn
.
visibility
=
View
.
GONE
// if (it.isRecommendVedio) { // 推荐剧集逻辑
vipBtn
.
visibility
=
View
.
VISIBLE
// if (holder.adapterPosition < it.unlockIndex) { // 观看激励视频解锁
//
holder
.
getView
<
TextView
>(
R
.
id
.
tv_info
).
visibility
=
View
.
GONE
// vipBtn.visibility = View.GONE
vipBtn
.
setBackgroundResource
(
R
.
mipmap
.
bg_detail_bottom_vip
)
// adBtn.visibility = View.VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
// holder.getView<TextView>(R.id.tv_title).text = String.format(
String
.
format
(
"解锁%s·全集"
,
it
.
title
)
// "解锁%s·第%d集",
}
// it.title,
// holder.adapterPosition + 1
}
else
{
// )
adBtn
.
visibility
=
View
.
VISIBLE
// holder.getView<TextView>(R.id.tv_info).text = String.format(
// "看激励视频解锁1集剧情\n请按照顺序解锁"
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
String
.
format
(
// )
"解锁%s·第%d-%d集"
,
// } else { // 开通会员解锁
it
.
title
,
// adBtn.visibility = View.GONE
it
.
unlockIndex
+
1
,
// vipBtn.visibility = View.VISIBLE
it
.
unlockIndex
+
it
.
adGiveVedioNum
//
)
// holder.getView<TextView>(R.id.tv_info).visibility = View.GONE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_info
).
text
=
String
.
format
(
// vipBtn.setBackgroundResource(R.mipmap.bg_detail_bottom_vip)
"看激励视频解锁%d集剧情\n请按照顺序解锁"
,
// holder.getView<TextView>(R.id.tv_title).text =
it
.
adGiveVedioNum
// String.format("解锁%s·全集", it.title)
)
// }
}
//
holder
.
getView
<
TextView
>(
R
.
id
.
unlock
).
text
=
String
.
format
(
"查看激励视频"
)
// } else {
holder
.
getView
<
View
>(
R
.
id
.
unlock
).
setOnClickListener
{
it2
->
// adBtn.visibility = View.VISIBLE
mOnCustomChildClickListener
?.
onCustomChildClick
(
it2
,
holder
.
adapterPosition
)
//
}
// holder.getView<TextView>(R.id.tv_title).text = String.format(
}
// "解锁%s·第%d-%d集",
// it.title,
// it.unlockIndex + 1,
// it.unlockIndex + it.adGiveVedioNum
// )
// holder.getView<TextView>(R.id.tv_info).text = String.format(
// "看激励视频解锁%d集剧情\n请按照顺序解锁",
// it.adGiveVedioNum
// )
// }
// holder.getView<TextView>(R.id.unlock).text = String.format("查看激励视频")
// holder.getView<View>(R.id.unlock).setOnClickListener { it2 ->
// mOnCustomChildClickListener?.onCustomChildClick(it2, holder.adapterPosition)
// }
// }
// ExpressManager.instance.getAdView(
// ExpressManager.instance.getAdView(
// object : ExpressAdCallback {
// object : ExpressAdCallback {
...
...
video/app/src/main/res/layout/item_block_view.xml
View file @
e3002302
...
@@ -11,11 +11,19 @@
...
@@ -11,11 +11,19 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"center"
/>
android:scaleType=
"center"
/>
<ImageView
android:id=
"@+id/iv_play"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_gravity=
"center"
android:scaleType=
"centerCrop"
android:src=
"@mipmap/player_pause"
/>
<com.duben.supertheater.ui.widgets.RoundRectLayout
<com.duben.supertheater.ui.widgets.RoundRectLayout
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#99000000"
>
android:background=
"#99000000"
android:visibility=
"gone"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
video/tmpmob/ShareSDK/assets/ShareSDK.xml
View file @
e3002302
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
<Tumblr
Enable=
"false"
/>
<Tumblr
Enable=
"false"
/>
<Email
Enable=
"false"
/>
<Email
Enable=
"false"
/>
<ShortMessage
Enable=
"false"
/>
<ShortMessage
Enable=
"false"
/>
<Wechat
AppId=
"wx
8d69898f9fb291e6"
AppSecret=
"ad6245d18872ed53a33c0f71418f6cde
"
userName=
"gh_afb25ac019c9"
path=
"pages/index/index.html?id=1"
WithShareTicket=
"true"
MiniprogramType=
"0"
/>
<Wechat
AppId=
"wx
31bf385f4de047cf"
AppSecret=
"31869e2d8815b0ba28cf4d74e2155191
"
userName=
"gh_afb25ac019c9"
path=
"pages/index/index.html?id=1"
WithShareTicket=
"true"
MiniprogramType=
"0"
/>
<WechatMoments
AppId=
"wx
8d69898f9fb291e6"
AppSecret=
"ad6245d18872ed53a33c0f71418f6cde
"
/>
<WechatMoments
AppId=
"wx
31bf385f4de047cf"
AppSecret=
"31869e2d8815b0ba28cf4d74e2155191
"
/>
<QQ
Enable=
"false"
/>
<QQ
Enable=
"false"
/>
<Instapaper
Enable=
"false"
/>
<Instapaper
Enable=
"false"
/>
<Pocket
Enable=
"false"
/>
<Pocket
Enable=
"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