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
4776f27b
Commit
4776f27b
authored
Jul 17, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化样式
parent
31d876fc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
97 additions
and
55 deletions
+97
-55
VipAdapter.kt
...ain/java/com/duben/speedplayletu/ui/adapter/VipAdapter.kt
+21
-5
PayYesDialog.kt
...n/java/com/duben/speedplayletu/ui/widgets/PayYesDialog.kt
+27
-14
TxVideoActivity.kt
.../java/com/duben/speedplayletu/video/tx/TxVideoActivity.kt
+17
-8
TxVideoAdapter.kt
...om/duben/speedplayletu/video/tx/adapter/TxVideoAdapter.kt
+8
-10
NewTxVideoActivity.kt
...speedplayletu/video/tx/newrecommend/NewTxVideoActivity.kt
+7
-3
NewTxVideoAdapter.kt
.../speedplayletu/video/tx/newrecommend/NewTxVideoAdapter.kt
+8
-8
dialog_payyes.xml
video/app/src/main/res/layout/dialog_payyes.xml
+2
-1
item_rv_vip.xml
video/app/src/main/res/layout/item_rv_vip.xml
+7
-6
No files found.
video/app/src/main/java/com/duben/speedplayletu/ui/adapter/VipAdapter.kt
View file @
4776f27b
package
com.duben.speedplayletu.ui.adapter
import
android.content.Context
import
android.graphics.Color
import
android.graphics.Paint
import
android.text.TextUtils
import
android.view.Gravity
...
...
@@ -104,25 +105,40 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
// }
// }catch (e:Exception){
// e.printStackTrace()
holder
.
tvVipItemTitle
.
text
=
vipBean
.
title
holder
.
tvVipItemTitle
.
text
=
vipBean
.
title
// if (vipBean.price < 1) {
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
// } else {
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
//// holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
// }
if
(
vipBean
.
price
==
0.0
){
if
(
vipBean
.
payToModel
==
2
)
{
// 跳转小程序领券
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
vipBean
.
oldPrice
.
toInt
().
toString
())
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
.
append
(
" 元\n"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
14
))
.
append
(
"原价:"
+
vipBean
.
price
.
toInt
().
toString
()
+
" 元"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
12
))
.
setStrikethrough
()
.
create
()
}
else
{
if
(
vipBean
.
price
==
0.0
)
{
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
"0.01"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
.
append
(
"元"
)
.
create
()
}
else
{
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
vipBean
.
price
.
toString
())
}
else
{
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
vipBean
.
price
.
to
Int
().
to
String
())
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
.
append
(
"元"
)
.
create
()
}
}
// if (vipBean.oldPrice > 0) {
...
...
video/app/src/main/java/com/duben/speedplayletu/ui/widgets/PayYesDialog.kt
View file @
4776f27b
...
...
@@ -13,6 +13,7 @@ import android.widget.TextView
import
com.duben.speedplayletu.R
import
com.duben.speedplayletu.common.AppConfig
import
com.duben.speedplayletu.mvp.model.VipBean
import
com.duben.speedplayletu.utils.BubbleUtils
import
com.duben.speedplayletu.utils.SpanUtils
class
PayYesDialog
(
...
...
@@ -54,24 +55,36 @@ class PayYesDialog(
rl_dialog_vip_bg
=
findViewById
<
View
>(
R
.
id
.
rl_dialog_vip_bg
)
as
RelativeLayout
iv_dialog_vip_quit
.
setOnClickListener
(
listener
)
tv_dialog_vip_next
.
setOnClickListener
(
listener
)
iv_dialog_vip_top
.
setImageResource
(
R
.
mipmap
.
ic_vip_pay_top2
)
if
(
vipBean
.
p
rice
==
0.0
)
{
//
0-没签约 无0.01
if
(
vipBean
.
p
ayToModel
==
2
)
{
//
跳转小程序领券
tv_dialog_vip_count
.
text
=
SpanUtils
()
.
append
(
"0.01"
)
.
setFontSize
(
30
,
true
)
.
append
(
" 元"
)
.
setFontSize
(
16
,
true
)
.
append
(
vipBean
.
oldPrice
.
toInt
().
toString
())
.
setFontSize
(
BubbleUtils
.
sp2px
(
30
))
.
append
(
" 元\n"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
16
))
.
append
(
"原价:"
+
vipBean
.
price
.
toInt
().
toString
()
+
" 元"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
12
))
.
setStrikethrough
()
.
create
()
iv_dialog_vip_top
.
setImageResource
(
R
.
mipmap
.
ic_vip_pay_top2
)
}
else
{
tv_dialog_vip_count
.
text
=
SpanUtils
()
.
append
(
""
+
vipBean
.
price
)
.
setFontSize
(
30
,
true
)
.
append
(
" 元"
)
.
setFontSize
(
16
,
true
)
.
create
()
iv_dialog_vip_top
.
setImageResource
(
R
.
mipmap
.
ic_vip_pay_top2
)
if
(
vipBean
.
price
==
0.0
)
{
//0-没签约 无0.01
tv_dialog_vip_count
.
text
=
SpanUtils
()
.
append
(
"0.01"
)
.
setFontSize
(
30
,
true
)
.
append
(
" 元"
)
.
setFontSize
(
16
,
true
)
.
create
()
}
else
{
tv_dialog_vip_count
.
text
=
SpanUtils
()
.
append
(
""
+
vipBean
.
price
.
toInt
())
.
setFontSize
(
30
,
true
)
.
append
(
" 元"
)
.
setFontSize
(
16
,
true
)
.
create
()
}
}
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/speedplayletu/video/tx/TxVideoActivity.kt
View file @
4776f27b
...
...
@@ -271,7 +271,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
getVipProductSuc
(
data
:
VipBean
)
{
if
(
data
.
list
!=
null
&&
data
.
list
.
size
>
0
)
{
AppConfig
.
firstVipPrice
=
data
.
list
.
get
(
0
).
price
if
(
data
.
list
[
0
].
payToModel
==
2
)
{
AppConfig
.
firstVipPrice
=
data
.
list
[
0
].
oldPrice
}
else
{
AppConfig
.
firstVipPrice
=
data
.
list
[
0
].
price
}
}
}
...
...
@@ -297,14 +301,19 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
val
data
=
mutableListOf
<
VideoMultiItemEntity
>()
if
(
videos
.
size
>
0
)
{
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
)
if
(
video
.
isLock
)
{
val
item
=
VideoMultiItemEntity
(
MULTI_ITEM_2
,
video
,
VideoModel
(
video
.
vedioUrl
)
)
data
.
add
(
item
)
}
else
{
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
}
...
...
video/app/src/main/java/com/duben/speedplayletu/video/tx/adapter/TxVideoAdapter.kt
View file @
4776f27b
...
...
@@ -84,18 +84,17 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
}
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
"解锁%s·第%d-%d集"
,
it
.
title
,
it
.
unlockIndex
+
1
,
it
.
unlockIndex
+
it
.
adGiveVedioNum
)
AppConfig
.
detailDialogUnlockText
=
unlockText
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
}
...
...
@@ -105,14 +104,13 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
vipBtn
.
visibility
=
View
.
GONE
adBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice}元解锁后续剧集"
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice.toInt()}元解锁后续剧集"
}
else
{
// 开通会员解锁
adBtn
.
visibility
=
View
.
GONE
vipBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice}元解锁后续剧集"
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice
.toInt()
}元解锁后续剧集"
}
}
else
{
...
...
@@ -120,7 +118,7 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
adBtn
.
visibility
=
View
.
GONE
vipBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice
}元解锁后续剧集"
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice.toInt()
}元解锁后续剧集"
}
holder
.
getView
<
TextView
>(
R
.
id
.
unlock
).
text
=
String
.
format
(
"查看激励视频"
)
...
...
video/app/src/main/java/com/duben/speedplayletu/video/tx/newrecommend/NewTxVideoActivity.kt
View file @
4776f27b
...
...
@@ -54,7 +54,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
var
orderTagsList
:
ArrayList
<
String
>?
=
null
private
var
playIndex
=
1
private
var
vedioAdPosition
=
0
private
var
vedioAdPosition
=
0
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_new_tx_video
...
...
@@ -247,7 +247,11 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
getVipProductSuc
(
data
:
VipBean
)
{
if
(
data
.
list
!=
null
&&
data
.
list
.
size
>
0
)
{
AppConfig
.
firstVipPrice
=
data
.
list
.
get
(
0
).
price
if
(
data
.
list
[
0
].
payToModel
==
2
)
{
AppConfig
.
firstVipPrice
=
data
.
list
[
0
].
oldPrice
}
else
{
AppConfig
.
firstVipPrice
=
data
.
list
[
0
].
price
}
}
}
...
...
@@ -288,7 +292,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override
fun
onCustomChildClick
(
view
:
View
,
position
:
Int
)
{
vedioAdPosition
=
position
vedioAdPosition
=
position
when
(
view
.
id
)
{
R
.
id
.
ll_collect
->
{
// 无收藏
...
...
video/app/src/main/java/com/duben/speedplayletu/video/tx/newrecommend/NewTxVideoAdapter.kt
View file @
4776f27b
...
...
@@ -60,13 +60,13 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
vedioBean
?.
let
{
try
{
val
unlockText
=
String
.
format
(
"解锁%s·第%d-%d集"
,
it
.
title
,
it
.
unlockIndex
+
1
,
it
.
unlockIndex
+
it
.
adGiveVedioNum
"解锁%s·第%d-%d集"
,
it
.
title
,
it
.
unlockIndex
+
1
,
it
.
unlockIndex
+
it
.
adGiveVedioNum
)
AppConfig
.
detailDialogUnlockText
=
unlockText
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
}
when
(
type
)
{
...
...
@@ -74,7 +74,7 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
vipBtn
.
visibility
=
View
.
GONE
adBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice}元解锁后续剧集"
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice
.toInt()
}元解锁后续剧集"
}
VEDIO3DOS_PAY
->
{
// 开通会员解锁
...
...
@@ -82,13 +82,13 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
vipBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice}元解锁后续剧集"
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice
.toInt()
}元解锁后续剧集"
}
else
->
{
adBtn
.
visibility
=
View
.
GONE
vipBtn
.
visibility
=
View
.
VISIBLE
holder
.
getView
<
TextView
>(
R
.
id
.
tv_title
).
text
=
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice}元解锁后续剧集"
if
(
AppConfig
.
firstVipPrice
==
0.0
)
"解锁后续剧集"
else
"${AppConfig.firstVipPrice
.toInt()
}元解锁后续剧集"
}
}
...
...
video/app/src/main/res/layout/dialog_payyes.xml
View file @
4776f27b
...
...
@@ -36,8 +36,9 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:lineSpacingExtra=
"-6dp"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"13
6
dp"
android:layout_marginBottom=
"13
4
dp"
android:textColor=
"@color/color_FFF0D4"
/>
<TextView
...
...
video/app/src/main/res/layout/item_rv_vip.xml
View file @
4776f27b
...
...
@@ -3,11 +3,11 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"10dp"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<FrameLayout
...
...
@@ -20,19 +20,19 @@
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_marginTop=
"-8dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
>
android:layout_gravity=
"center_vertical"
android:layout_marginTop=
"-8dp"
>
<TextView
android:id=
"@+id/tvVipItemTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"18dp"
android:textColor=
"#efbc6a"
android:textSize=
"20sp"
android:layout_centerVertical=
"true"
android:textStyle=
"bold"
tools:text=
"包年会员"
/>
...
...
@@ -40,10 +40,11 @@
android:id=
"@+id/tvVipItemCurMoney"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"18dp"
android:gravity=
"center"
android:lineSpacingExtra=
"-6dp"
android:textColor=
"#efbc6a"
android:textSize=
"16sp"
tools:text=
"$78"
/>
...
...
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