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
e2f9aea3
Commit
e2f9aea3
authored
Jan 08, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
7b02cff9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
305 additions
and
144 deletions
+305
-144
VipActivity.kt
...in/java/com/duben/xixiplaylet/ui/activitys/VipActivity.kt
+2
-0
DramaApiDetailActivity.kt
...com/duben/xixiplaylet/video/csj/DramaApiDetailActivity.kt
+238
-112
TxVideoActivity.kt
...in/java/com/duben/xixiplaylet/video/tx/TxVideoActivity.kt
+1
-1
NewTxVideoActivity.kt
...n/xixiplaylet/video/tx/newrecommend/NewTxVideoActivity.kt
+64
-31
No files found.
video/app/src/main/java/com/duben/xixiplaylet/ui/activitys/VipActivity.kt
View file @
e2f9aea3
...
...
@@ -417,6 +417,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
//策略场景类调起支付方法开始支付,以及接收回调。
RxPay
.
pay
(
wxPay
,
this
,
wxPayInfoImpl
,
object
:
IPayCallback
{
override
fun
success
()
{
AppConfig
.
showVipAdDialog
=
false
UserManager
.
getInstance
().
vipFlag
=
true
vipPresenter
.
queryVipOrder
(
wxParanBean
.
tid
.
toString
(),
true
)
}
...
...
@@ -454,6 +455,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
//策略场景类调起支付方法开始支付,以及接收回调。
RxPay
.
pay
(
aliPay
,
this
,
alipayInfoImpl
,
object
:
IPayCallback
{
override
fun
success
()
{
AppConfig
.
showVipAdDialog
=
false
UserManager
.
getInstance
().
vipFlag
=
true
vipPresenter
.
queryVipOrder
(
wxParanBean
.
tid
.
toString
(),
true
)
}
...
...
video/app/src/main/java/com/duben/xixiplaylet/video/csj/DramaApiDetailActivity.kt
View file @
e2f9aea3
This diff is collapsed.
Click to expand it.
video/app/src/main/java/com/duben/xixiplaylet/video/tx/TxVideoActivity.kt
View file @
e2f9aea3
...
...
@@ -94,7 +94,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
// vip界面返回弹出广告弹窗
if
(
AppConfig
.
showVipAdDialog
)
{
if
(
AppConfig
.
showVipAdDialog
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
adDialog
()
AppConfig
.
showVipAdDialog
=
false
...
...
video/app/src/main/java/com/duben/xixiplaylet/video/tx/newrecommend/NewTxVideoActivity.kt
View file @
e2f9aea3
...
...
@@ -2,6 +2,8 @@ package com.duben.xixiplaylet.video.tx.newrecommend
import
android.app.Dialog
import
android.os.Bundle
import
android.os.Handler
import
android.os.Looper
import
android.view.View
import
androidx.core.content.ContextCompat
import
com.google.gson.Gson
...
...
@@ -27,6 +29,7 @@ import com.duben.xixiplaylet.video.tx.VideoModel
import
com.duben.library.utils.GlideUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.xixiplaylet.common.AppConfig
import
com.duben.xixiplaylet.ui.widgets.DetailAdDialog
import
com.duben.xixiplaylet.ui.widgets.DialogListener
import
com.duben.xixiplaylet.ui.widgets.VideoEpisodeDialog
import
kotlinx.android.synthetic.main.activity_new_tx_video.*
...
...
@@ -42,6 +45,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
var
mAllData
=
arrayListOf
<
VedioEpisodeBean
>()
private
var
dialog
:
VideoEpisodeDialog
?
=
null
private
var
detailAdDialog
:
DetailAdDialog
?
=
null
private
val
videoPresenter
by
lazy
{
VideoPresenter
()
}
...
...
@@ -81,6 +85,14 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
playIndex
=
new_super_short_video_view
.
currentPosition
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
}
// vip界面返回弹出广告弹窗
if
(
AppConfig
.
showVipAdDialog
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
adDialog
()
AppConfig
.
showVipAdDialog
=
false
},
300
)
}
}
override
fun
onPause
()
{
...
...
@@ -285,37 +297,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
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
>?)
{
updateEpisodeData
(
position
,
vo
)
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
updateEpisodeData
(
position
,
vo
)
}
})
showAd
()
}
R
.
id
.
vip
->
{
// 开通VIP
...
...
@@ -323,6 +305,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
bundle
.
putString
(
VipActivity
.
VEDIO_ID
,
mVedioBean
!!
.
vedioId
.
toString
())
bundle
.
putString
(
VipActivity
.
THIRD_ID
,
mVedioBean
!!
.
thirdId
)
bundle
.
putBoolean
(
VipActivity
.
IS_RECOMMEND
,
true
)
bundle
.
putBoolean
(
VipActivity
.
IS_DETAIL
,
true
)
readyGo
(
VipActivity
::
class
.
java
,
bundle
)
}
...
...
@@ -330,6 +313,40 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
private
fun
showAd
()
{
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
>?)
{
updateEpisodeData
(
position
,
vo
)
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
updateEpisodeData
(
position
,
vo
)
}
})
}
private
fun
updateEpisodeData
(
position
:
Int
,
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
// 解锁剧集
...
...
@@ -358,4 +375,20 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
return
readPosition
}
private
fun
adDialog
()
{
detailAdDialog
=
DetailAdDialog
(
context
,
object
:
DialogListener
()
{
override
fun
onClick
(
v
:
View
)
{
if
(
AntiShake
.
check
(
v
.
id
))
return
when
(
v
.
id
)
{
R
.
id
.
iv_detail_ad_next
->
{
showAd
()
detailAdDialog
?.
dismiss
()
}
}
}
})
detailAdDialog
!!
.
show
()
}
}
\ 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