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
9867c328
Commit
9867c328
authored
Jul 24, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
44865996
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
179 additions
and
183 deletions
+179
-183
compiler.xml
video/.idea/compiler.xml
+1
-1
misc.xml
video/.idea/misc.xml
+2
-1
Constant.kt
.../app/src/main/java/com/xinfu/helivideo/common/Constant.kt
+0
-5
DramaApiDetailActivity.kt
.../java/com/xinfu/helivideo/video/DramaApiDetailActivity.kt
+139
-134
TxVideoActivity.kt
...rc/main/java/com/xinfu/helivideo/video/TxVideoActivity.kt
+37
-42
No files found.
video/.idea/compiler.xml
View file @
9867c328
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CompilerConfiguration"
>
<bytecodeTargetLevel
target=
"1
7
"
/>
<bytecodeTargetLevel
target=
"1
1
"
/>
</component>
</project>
\ No newline at end of file
video/.idea/misc.xml
View file @
9867c328
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ExternalStorageConfigurationManager"
enabled=
"true"
/>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
7"
default=
"true"
project-jdk-name=
"jbr-17
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
1"
project-jdk-name=
"11
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
video/app/src/main/java/com/xinfu/helivideo/common/Constant.kt
View file @
9867c328
...
...
@@ -34,11 +34,6 @@ object Constant {
const
val
FRAGMENT_CLICK_TWO
=
1
const
val
FRAGMENT_CLICK_THREE
=
2
const
val
VIP_REQUEST_CODE
=
0
x111
// 协议地址
var
REGISTER_URL
=
"http://mints-web.mints-id.com/agreements/helivideo/yhxy.html"
//注册协议
var
PRIVACY_URL
=
"http://mints-web.mints-id.com/agreements/helivideo/syzc.html"
//隐私协议
...
...
video/app/src/main/java/com/xinfu/helivideo/video/DramaApiDetailActivity.kt
View file @
9867c328
package
com.xinfu.helivideo.video
import
android.app.Dialog
import
android.content.Intent
import
android.os.Bundle
import
android.util.Log
import
android.view.KeyEvent
import
android.view.View
import
android.widget.Button
import
android.widget.ImageView
...
...
@@ -41,7 +39,7 @@ import kotlinx.android.synthetic.main.drama_activity_api_detail.*
* @desc
*/
class
DramaApiDetailActivity
:
BaseActivity
(),
VideoEpisodeAdapter
.
OnEpisodeClickListener
,
VideoView
,
View
.
OnClickListener
{
VideoView
,
View
.
OnClickListener
{
companion
object
{
private
const
val
TAG
=
"DramaApiDetailActivity"
...
...
@@ -51,6 +49,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
val
videoPresenter
by
lazy
{
VideoPresenter
()
}
private
var
mVipFlag
=
UserManager
.
getInstance
().
vipFlag
private
var
dpWidget
:
IDPWidget
?
=
null
private
var
isInited
=
false
private
var
drama
:
DPDrama
?
=
null
...
...
@@ -180,7 +180,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
dpWidget
?.
let
{
widget
->
supportFragmentManager
.
beginTransaction
().
replace
(
R
.
id
.
fl_container
,
widget
.
fragment
)
.
commit
()
.
commit
()
leaveBtn
?.
setOnClickListener
{
finish
()
...
...
@@ -189,7 +189,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
val
bundle
=
Bundle
()
bundle
.
putString
(
VipActivity
.
VEDIO_ID
,
mVedioBean
!!
.
vedioId
.
toString
())
bundle
.
putString
(
VipActivity
.
THIRD_ID
,
mVedioBean
!!
.
thirdId
)
readyGo
ForResult
(
VipActivity
::
class
.
java
,
Constant
.
VIP_REQUEST_CODE
,
bundle
)
readyGo
(
VipActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -199,22 +199,22 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
fun
initWidget
()
{
drama
?.
let
{
drama
->
dpWidget
=
DPSdk
.
factory
().
createDramaDetail
(
DPWidgetDramaDetailParams
.
obtain
()
.
detailConfig
(
DPDramaDetailConfig
.
obtain
(
mode
)
.
bottomOffset
(
20
)
.
infiniteScrollEnabled
(
enableInfiniteScroll
)
.
hideLeftTopTips
(
hideLeftTopTips
,
null
)
.
showCellularToast
(
true
)
.
hideMore
(
hideMore
)
.
listener
(
dramaListener
)
.
adListener
(
dramaAdListener
)
.
setCustomReport
(
enableCustomReport
)
{
context
,
id
->
// 举报
}
)
.
id
(
drama
.
id
)
.
index
(
drama
.
index
)
DPWidgetDramaDetailParams
.
obtain
()
.
detailConfig
(
DPDramaDetailConfig
.
obtain
(
mode
)
.
bottomOffset
(
20
)
.
infiniteScrollEnabled
(
enableInfiniteScroll
)
.
hideLeftTopTips
(
hideLeftTopTips
,
null
)
.
showCellularToast
(
true
)
.
hideMore
(
hideMore
)
.
listener
(
dramaListener
)
.
adListener
(
dramaAdListener
)
.
setCustomReport
(
enableCustomReport
)
{
context
,
id
->
// 举报
}
)
.
id
(
drama
.
id
)
.
index
(
drama
.
index
)
// .currentDuration(currentDuration)
)
}
...
...
@@ -225,6 +225,14 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
super
.
onDestroy
()
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
mVipFlag
!=
UserManager
.
getInstance
().
vipFlag
&&
UserManager
.
getInstance
().
vipFlag
)
{
// 重置状态
resetData
()
}
}
override
fun
onPause
()
{
super
.
onPause
()
}
...
...
@@ -334,18 +342,18 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
override
fun
isNeedBlock
(
drama
:
DPDrama
?,
index
:
Int
,
map
:
MutableMap
<
String
,
Any
>?
drama
:
DPDrama
?,
index
:
Int
,
map
:
MutableMap
<
String
,
Any
>?
):
Boolean
{
drama
?:
return
false
Log
.
d
(
TAG
,
"isNeedBlock: index = $index"
)
val
unlockIndex
=
mUnlockIndexMap
[
drama
.
id
]
?:
mInitUnlockIndex
val
hasUnlockList
=
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
Log
.
d
(
TAG
,
"isNeedBlock: index = $index"
+
" "
+
unlockIndex
+
"s"
+
drama
.
id
+
mHasUnlockIndexMap
+
" --- "
+
(
index
>
unlockIndex
&&
hasUnlockList
.
contains
(
index
).
not
())
TAG
,
"isNeedBlock: index = $index"
+
" "
+
unlockIndex
+
"s"
+
drama
.
id
+
mHasUnlockIndexMap
+
" --- "
+
(
index
>
unlockIndex
&&
hasUnlockList
.
contains
(
index
).
not
())
)
info_tv
.
text
=
String
.
format
(
"第%d集"
,
index
)
...
...
@@ -370,9 +378,9 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
override
fun
showAdIfNeeded
(
drama
:
DPDrama
?,
callback
:
Callback
?,
map
:
MutableMap
<
String
,
Any
>?
drama
:
DPDrama
?,
callback
:
Callback
?,
map
:
MutableMap
<
String
,
Any
>?
)
{
super
.
showAdIfNeeded
(
drama
,
callback
,
map
)
drama
?:
return
...
...
@@ -384,18 +392,18 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
unlockBtn
?.
setOnClickListener
{
val
carrierType
=
Constant
.
CARRIERTYPE_CSJ_VEDIO
AdManager
.
instance
.
showAd
(
this
@DramaApiDetailActivity
,
carrierType
,
object
:
AdStatusListener
{
var
canFail
=
false
override
fun
adSuccess
()
{
canFail
=
true
}
override
fun
adFail
()
{
if
(
canFail
)
return
NoPreAdManager
.
loadVideoAd
(
this
@DramaApiDetailActivity
,
carrierType
,
object
:
AdStatusListener
{
object
:
AdStatusListener
{
var
canFail
=
false
override
fun
adSuccess
()
{
canFail
=
true
}
override
fun
adFail
()
{
if
(
canFail
)
return
NoPreAdManager
.
loadVideoAd
(
this
@DramaApiDetailActivity
,
carrierType
,
object
:
AdStatusListener
{
override
fun
adFail
()
{
showToast
(
"广告太火爆了,请稍候再试"
)
}
...
...
@@ -417,14 +425,14 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
// 更新解锁集数
for
(
i
in
0
until
lockSet
)
{
val
hasUnlockList
:
MutableList
<
Int
>
=
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
hasUnlockList
.
add
(
widget
.
currentDramaIndex
+
lockSet
)
mHasUnlockIndexMap
[
drama
.
id
]
=
hasUnlockList
}
mInitUnlockIndex
=
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
mUnlockIndexMap
[
drama
.
id
]
=
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
mVedioBean
!!
.
unlockIndex
=
mInitUnlockIndex
// 播放当前集
...
...
@@ -436,38 +444,38 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
callback
?.
onDramaRewardArrived
()
// 解锁当前集
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
if
(
isThirdId
)
{
it
[
"thirdId"
]
=
""
+
mVedioBean
!!
.
thirdId
}
else
{
it
[
"vedioId"
]
=
""
+
mVedioBean
!!
.
vedioId
}
videoPresenter
.
unlock
(
it
)
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
if
(
isThirdId
)
{
it
[
"thirdId"
]
=
""
+
mVedioBean
!!
.
thirdId
}
else
{
it
[
"vedioId"
]
=
""
+
mVedioBean
!!
.
vedioId
}
videoPresenter
.
unlock
(
it
)
}
// 更新解锁集数
for
(
i
in
1
until
lockSet
)
{
val
hasUnlockList
:
MutableList
<
Int
>
=
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
hasUnlockList
.
add
(
widget
.
currentDramaIndex
+
i
)
mHasUnlockIndexMap
[
drama
.
id
]
=
hasUnlockList
}
mInitUnlockIndex
=
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
mUnlockIndexMap
[
drama
.
id
]
=
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
mVedioBean
!!
.
unlockIndex
=
mInitUnlockIndex
blockView
?.
visibility
=
View
.
GONE
// 播放当前集
mVedioBean
!!
.
seeIndex
=
mCurrentIndex
mVedioBean
!!
.
orderTags
=
orderTagsList
LocalVedioManager
.
commitVedio
(
mVedioBean
!!
)
callback
?.
onDramaRewardArrived
()
// 解锁当前集
// 更新解锁集数
for
(
i
in
1
until
lockSet
)
{
val
hasUnlockList
:
MutableList
<
Int
>
=
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
hasUnlockList
.
add
(
widget
.
currentDramaIndex
+
i
)
mHasUnlockIndexMap
[
drama
.
id
]
=
hasUnlockList
}
})
mInitUnlockIndex
=
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
mUnlockIndexMap
[
drama
.
id
]
=
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
mVedioBean
!!
.
unlockIndex
=
mInitUnlockIndex
blockView
?.
visibility
=
View
.
GONE
// 播放当前集
mVedioBean
!!
.
seeIndex
=
mCurrentIndex
mVedioBean
!!
.
orderTags
=
orderTagsList
LocalVedioManager
.
commitVedio
(
mVedioBean
!!
)
callback
?.
onDramaRewardArrived
()
// 解锁当前集
}
})
}
}
...
...
@@ -576,24 +584,24 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
fun
playCollectAnim
(
view
:
LottieAnimationView
)
{
val
lottieDrawable
=
LottieDrawable
()
LottieCompositionFactory
.
fromAsset
(
context
,
"home_collect.json"
)
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
lottieDrawable
.
loop
(
false
)
lottieDrawable
.
playAnimation
()
}
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
lottieDrawable
.
loop
(
false
)
lottieDrawable
.
playAnimation
()
}
view
.
setImageDrawable
(
lottieDrawable
)
}
private
fun
playCancelCollectAnim
(
view
:
LottieAnimationView
)
{
val
lottieDrawable
=
LottieDrawable
()
LottieCompositionFactory
.
fromAsset
(
context
,
"home_cancel_collect.json"
)
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
lottieDrawable
.
loop
(
false
)
lottieDrawable
.
playAnimation
()
}
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
lottieDrawable
.
loop
(
false
)
lottieDrawable
.
playAnimation
()
}
view
.
setImageDrawable
(
lottieDrawable
)
}
...
...
@@ -624,75 +632,72 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
fun
showVipCountDialog
(
position
:
Int
)
{
if
(
position
==
0
||
mVedioBean
!!
.
tipMaxIndex
==
0
||
mVedioBean
!!
.
tipMaxIndex
-
1
<
position
)
return
VipCountDialog
(
this
,
mVedioBean
!!
,
tipList
)
.
setOnDialogDismiss
(
object
:
VipCountDialog
.
OnDialogDismiss
{
override
fun
onDialogDismiss
()
{}
})
.
show
()
.
setOnDialogDismiss
(
object
:
VipCountDialog
.
OnDialogDismiss
{
override
fun
onDialogDismiss
()
{}
})
.
show
()
}
private
fun
setCollectImage
(
view
:
LottieAnimationView
)
{
val
lottieDrawable
=
LottieDrawable
()
LottieCompositionFactory
.
fromAsset
(
context
,
"home_collect.json"
)
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
}
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
}
view
.
setImageDrawable
(
lottieDrawable
)
}
private
fun
setCancelCollectImage
(
view
:
LottieAnimationView
)
{
val
lottieDrawable
=
LottieDrawable
()
LottieCompositionFactory
.
fromAsset
(
context
,
"home_cancel_collect.json"
)
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
}
.
addListener
{
result
:
LottieComposition
?
->
lottieDrawable
.
setImagesAssetsFolder
(
"images/"
)
lottieDrawable
.
composition
=
result
}
view
.
setImageDrawable
(
lottieDrawable
)
}
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
requestCode
==
Constant
.
VIP_REQUEST_CODE
)
{
if
(
UserManager
.
getInstance
().
vipFlag
)
{
mVedioBean
?.
let
{
//解锁全部集数
it
.
unlockIndex
=
it
.
vedioTotal
it
.
tipMaxIndex
=
0
mInitUnlockIndex
=
it
.
vedioTotal
//设置弹框集数为0
it
.
adGiveVedioNum
=
0
mUnlockIndexMap
=
mutableMapOf
()
mHasUnlockIndexMap
=
mutableMapOf
()
drama
?.
let
{
// 更新解锁集数
for
(
i
in
0
until
mInitUnlockIndex
)
{
val
hasUnlockList
:
MutableList
<
Int
>
=
mutableListOf
()
hasUnlockList
.
add
(
i
+
1
)
mHasUnlockIndexMap
[
it
.
id
]
=
hasUnlockList
}
mUnlockIndexMap
[
it
.
id
]
=
mInitUnlockIndex
mUnlockIndexMap
[
it
.
id
]
=
mUnlockIndexMap
[
it
.
id
]
!!
mVedioBean
!!
.
unlockIndex
=
mInitUnlockIndex
private
fun
resetData
()
{
if
(
UserManager
.
getInstance
().
vipFlag
)
{
mVedioBean
?.
let
{
//解锁全部集数
it
.
unlockIndex
=
it
.
vedioTotal
it
.
tipMaxIndex
=
0
mInitUnlockIndex
=
it
.
vedioTotal
//设置弹框集数为0
it
.
adGiveVedioNum
=
0
mUnlockIndexMap
=
mutableMapOf
()
mHasUnlockIndexMap
=
mutableMapOf
()
drama
?.
let
{
// 更新解锁集数
for
(
i
in
0
until
mInitUnlockIndex
)
{
val
hasUnlockList
:
MutableList
<
Int
>
=
mutableListOf
()
hasUnlockList
.
add
(
i
+
1
)
mHasUnlockIndexMap
[
it
.
id
]
=
hasUnlockList
}
mUnlockIndexMap
[
it
.
id
]
=
mInitUnlockIndex
mUnlockIndexMap
[
it
.
id
]
=
mUnlockIndexMap
[
it
.
id
]
!!
mVedioBean
!!
.
unlockIndex
=
mInitUnlockIndex
}
// 播放当前集
mVedioBean
!!
.
seeIndex
=
mCurrentIndex
mVedioBean
!!
.
orderTags
=
orderTagsList
LocalVedioManager
.
commitVedio
(
mVedioBean
!!
)
// 播放当前集
mVedioBean
!!
.
seeIndex
=
mCurrentIndex
mVedioBean
!!
.
orderTags
=
orderTagsList
LocalVedioManager
.
commitVedio
(
mVedioBean
!!
)
if
(
block_view
?.
visibility
==
View
.
VISIBLE
)
{
blockView
?.
visibility
=
View
.
GONE
//解锁当前集
dpWidget
?.
let
{
widget
->
unlockCallback
?.
onDramaRewardArrived
()
}
if
(
block_view
?.
visibility
==
View
.
VISIBLE
)
{
blockView
?.
visibility
=
View
.
GONE
//解锁当前集
dpWidget
?.
let
{
widget
->
unlockCallback
?.
onDramaRewardArrived
()
}
}
}
}
}
}
}
\ No newline at end of file
video/app/src/main/java/com/xinfu/helivideo/video/TxVideoActivity.kt
View file @
9867c328
package
com.xinfu.helivideo.video
import
android.app.Dialog
import
android.content.Intent
import
android.os.Bundle
import
android.os.Handler
import
android.os.Looper
...
...
@@ -31,7 +30,9 @@ import com.xinfu.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_tx_video.*
class
TxVideoActivity
:
BaseActivity
(),
View
.
OnClickListener
,
VideoView
,
VideoEpisodeAdapter
.
OnEpisodeClickListener
,
TxVideoAdapter
.
OnCustomChildClickListener
{
VideoEpisodeAdapter
.
OnEpisodeClickListener
,
TxVideoAdapter
.
OnCustomChildClickListener
{
private
var
mVipFlag
=
UserManager
.
getInstance
().
vipFlag
var
videos
=
ArrayList
<
VedioEpisodeBean
>()
...
...
@@ -73,6 +74,13 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
onResume
()
{
super
.
onResume
()
super_short_video_view
.
resume
()
if
(
mVipFlag
!=
UserManager
.
getInstance
().
vipFlag
&&
UserManager
.
getInstance
().
vipFlag
)
{
// 重置状态
isPlayNext
=
false
playIndex
=
super_short_video_view
.
currentPosition
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
}
}
override
fun
onPause
()
{
...
...
@@ -89,9 +97,9 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
fun
initView
()
{
episode_tv
.
text
=
String
.
format
(
"共%d集 %s"
,
mVedioBean
?.
vedioTotal
,
if
(
mVedioBean
?.
completeStatus
==
0
)
"已完结"
else
"更新中"
"共%d集 %s"
,
mVedioBean
?.
vedioTotal
,
if
(
mVedioBean
?.
completeStatus
==
0
)
"已完结"
else
"更新中"
)
super_short_video_view
.
setOnCustomChildClickListener
(
this
)
...
...
@@ -238,18 +246,18 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
// 看广告解锁
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
@TxVideoActivity
,
carrierType
,
object
:
AdStatusListener
{
object
:
AdStatusListener
{
var
canFail
=
false
override
fun
adSuccess
()
{
canFail
=
true
}
override
fun
adFail
()
{
if
(
canFail
)
return
NoPreAdManager
.
loadVideoAd
(
this
@TxVideoActivity
,
carrierType
,
object
:
AdStatusListener
{
override
fun
adFail
()
{
showToast
(
"广告太火爆了,请稍候再试"
)
}
...
...
@@ -264,16 +272,16 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
})
}
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
vo
[
"vedioId"
]
=
mVedioBean
!!
.
vedioId
videoPresenter
.
unlock
(
vo
)
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
vo
[
"vedioId"
]
=
mVedioBean
!!
.
vedioId
videoPresenter
.
unlock
(
vo
)
}
}
})
})
}
R
.
id
.
vip
->
{
...
...
@@ -281,7 +289,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
val
bundle
=
Bundle
()
bundle
.
putString
(
VipActivity
.
VEDIO_ID
,
mVedioBean
!!
.
vedioId
.
toString
())
bundle
.
putString
(
VipActivity
.
THIRD_ID
,
mVedioBean
!!
.
thirdId
)
readyGo
ForResult
(
VipActivity
::
class
.
java
,
Constant
.
VIP_REQUEST_CODE
,
bundle
)
readyGo
(
VipActivity
::
class
.
java
,
bundle
)
}
else
->
{}
...
...
@@ -296,25 +304,12 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
VipCountDialog
(
this
,
mVedioBean
!!
,
tipList
)
.
setOnDialogDismiss
(
object
:
VipCountDialog
.
OnDialogDismiss
{
override
fun
onDialogDismiss
()
{}
})
.
show
()
.
setOnDialogDismiss
(
object
:
VipCountDialog
.
OnDialogDismiss
{
override
fun
onDialogDismiss
()
{}
})
.
show
()
}
private
fun
getPosition
()
=
super_short_video_view
.
currentPosition
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
requestCode
==
Constant
.
VIP_REQUEST_CODE
)
{
if
(
UserManager
.
getInstance
().
vipFlag
)
{
// 重置状态
isPlayNext
=
false
playIndex
=
super_short_video_view
.
currentPosition
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
}
}
}
}
\ 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