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
3353f548
Commit
3353f548
authored
Jan 08, 2024
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b9a81a16
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
28 deletions
+39
-28
DetailAdDialog.kt
...n/java/com/duben/xixiplaylet/ui/widgets/DetailAdDialog.kt
+3
-3
DramaApiDetailActivity.kt
...com/duben/xixiplaylet/video/csj/DramaApiDetailActivity.kt
+6
-6
TxVideoAdapter.kt
.../com/duben/xixiplaylet/video/tx/adapter/TxVideoAdapter.kt
+15
-7
NewTxVideoAdapter.kt
...en/xixiplaylet/video/tx/newrecommend/NewTxVideoAdapter.kt
+11
-7
dialog_detail_ad.xml
video/app/src/main/res/layout/dialog_detail_ad.xml
+4
-5
No files found.
video/app/src/main/java/com/duben/xixiplaylet/ui/widgets/DetailAdDialog.kt
View file @
3353f548
...
...
@@ -29,9 +29,9 @@ class DetailAdDialog(private val context: Context, private val listener: DialogL
setContentView
(
R
.
layout
.
dialog_detail_ad
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
BOTTOM
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Bottom
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Fade
window
!!
.
attributes
=
lp
// 设置外部不可关闭
...
...
@@ -44,7 +44,7 @@ class DetailAdDialog(private val context: Context, private val listener: DialogL
}
// 查找View
iv_detail_ad_next
=
findViewById
<
View
>(
R
.
id
.
t
v_detail_ad_next
)
as
Button
iv_detail_ad_next
=
findViewById
<
View
>(
R
.
id
.
i
v_detail_ad_next
)
as
Button
findViewById
<
View
>(
R
.
id
.
iv_detail_quit
).
setOnClickListener
{
dismiss
()
}
...
...
video/app/src/main/java/com/duben/xixiplaylet/video/csj/DramaApiDetailActivity.kt
View file @
3353f548
...
...
@@ -438,16 +438,16 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
unlockCallback
=
callback
currentDramaIndex
=
dpWidget
?.
currentDramaIndex
!!
// 展示广告
if
(!
UserManager
.
getInstance
().
newFlag
)
{
val
unlockText
=
String
.
format
(
val
unlockText
=
String
.
format
(
"解锁%s·第%d-%d集"
,
drama
.
title
,
mInitUnlockIndex
+
1
,
mInitUnlockIndex
+
lockSet
)
AppConfig
.
detailDialogUnlockText
=
unlockText
)
AppConfig
.
detailDialogUnlockText
=
unlockText
if
(!
UserManager
.
getInstance
().
newFlag
)
{
tv_title
.
text
=
unlockText
}
else
{
...
...
video/app/src/main/java/com/duben/xixiplaylet/video/tx/adapter/TxVideoAdapter.kt
View file @
3353f548
...
...
@@ -83,8 +83,22 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
vipBtn
.
visibility
=
View
.
GONE
}
val
adBtn
=
holder
.
getView
<
View
>(
R
.
id
.
unlock
)
vedioBean
?.
let
{
try
{
val
unlockText
=
String
.
format
(
"解锁%s·第%d-%d集"
,
it
.
title
,
it
.
unlockIndex
+
1
,
it
.
unlockIndex
+
it
.
adGiveVedioNum
)
AppConfig
.
detailDialogUnlockText
=
unlockText
}
catch
(
e
:
Exception
){
}
if
(
it
.
isRecommendVedio
)
{
// 推荐剧集逻辑
if
(
holder
.
adapterPosition
<
it
.
unlockIndex
)
{
// 观看激励视频解锁
...
...
@@ -93,13 +107,7 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice}元解锁后续剧集"
val
unlockText
=
String
.
format
(
"解锁%s·第%d-%d集"
,
it
.
title
,
it
.
unlockIndex
+
1
,
it
.
unlockIndex
+
it
.
adGiveVedioNum
)
AppConfig
.
detailDialogUnlockText
=
unlockText
}
else
{
// 开通会员解锁
adBtn
.
visibility
=
View
.
GONE
vipBtn
.
visibility
=
View
.
VISIBLE
...
...
video/app/src/main/java/com/duben/xixiplaylet/video/tx/newrecommend/NewTxVideoAdapter.kt
View file @
3353f548
...
...
@@ -58,6 +58,17 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
val
adBtn
=
holder
.
getView
<
View
>(
R
.
id
.
unlock
)
vedioBean
?.
let
{
try
{
val
unlockText
=
String
.
format
(
"解锁%s·第%d-%d集"
,
it
.
title
,
it
.
unlockIndex
+
1
,
it
.
unlockIndex
+
it
.
adGiveVedioNum
)
AppConfig
.
detailDialogUnlockText
=
unlockText
}
catch
(
e
:
Exception
){
}
when
(
type
)
{
VEDIO3DOS_AD
->
{
// 观看激励视频解锁
vipBtn
.
visibility
=
View
.
GONE
...
...
@@ -65,13 +76,6 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice}元解锁后续剧集"
val
unlockText
=
String
.
format
(
"解锁%s·第%d-%d集"
,
it
.
title
,
it
.
unlockIndex
+
1
,
it
.
unlockIndex
+
it
.
adGiveVedioNum
)
AppConfig
.
detailDialogUnlockText
=
unlockText
}
VEDIO3DOS_PAY
->
{
// 开通会员解锁
adBtn
.
visibility
=
View
.
GONE
...
...
video/app/src/main/res/layout/dialog_detail_ad.xml
View file @
3353f548
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:background=
"@color/black"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_cont
ent"
android:layout_height=
"
match_par
ent"
android:layout_centerInParent=
"true"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:gravity=
"center"
android:orientation=
"vertical"
>
...
...
@@ -39,7 +38,7 @@
<Button
android:id=
"@+id/
t
v_detail_ad_next"
android:id=
"@+id/
i
v_detail_ad_next"
android:layout_width=
"280dp"
android:layout_height=
"46dp"
android:layout_marginTop=
"20dp"
...
...
@@ -52,7 +51,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:padding=
"5dp"
android:src=
"@mipmap/ic_
activity_quit
"
></ImageView>
android:src=
"@mipmap/ic_
quit_yuan
"
></ImageView>
</LinearLayout>
</RelativeLayout>
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