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
73b8c211
Commit
73b8c211
authored
Oct 12, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改成竖屏
parent
07e4fbe3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
164 deletions
+87
-164
VipActivity.kt
...n/java/com/duben/xixiplayletu/ui/activitys/VipActivity.kt
+1
-1
VipAdapter.kt
...main/java/com/duben/xixiplayletu/ui/adapter/VipAdapter.kt
+41
-95
activity_new_vip.xml
video/app/src/main/res/layout/activity_new_vip.xml
+1
-1
dialog_powe2.xml
video/app/src/main/res/layout/dialog_powe2.xml
+3
-3
item_rv_vip.xml
video/app/src/main/res/layout/item_rv_vip.xml
+41
-64
No files found.
video/app/src/main/java/com/duben/xixiplayletu/ui/activitys/VipActivity.kt
View file @
73b8c211
...
...
@@ -401,7 +401,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
private
fun
initRvView
()
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
gridLayoutManager
=
LinearLayoutManager
(
this
)
val
gridLayoutManager
=
GridLayoutManager
(
this
,
3
)
rvVip
.
layoutManager
=
gridLayoutManager
vipAdapter
=
VipAdapter
(
vipList
!!
)
rvVip
.
adapter
=
vipAdapter
...
...
video/app/src/main/java/com/duben/xixiplayletu/ui/adapter/VipAdapter.kt
View file @
73b8c211
package
com.duben.xixiplayletu.ui.adapter
import
android.content.Context
import
android.graphics.Color
import
android.graphics.Paint
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.RecyclerView
import
com.duben.xixiplayletu.R
import
com.duben.xixiplayletu.mvp.model.VipBean
import
com.duben.xixiplayletu.utils.BubbleUtils
import
com.duben.xixiplayletu.utils.SpanUtils
import
com.duben.xixiplayletu.utils.UIUtils
import
kotlinx.android.synthetic.main.fragment_main_my.*
class
VipAdapter
(
val
vipList
:
MutableList
<
VipBean
.
ListBean
>)
:
RecyclerView
.
Adapter
<
VipAdapter
.
ViewHolder
>()
{
...
...
@@ -33,7 +40,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
}
inner
class
ViewHolder
(
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
{
val
rlVipItemRoot
:
Frame
Layout
=
view
.
findViewById
(
R
.
id
.
rlVipItemRoot
)
val
rlVipItemRoot
:
Linear
Layout
=
view
.
findViewById
(
R
.
id
.
rlVipItemRoot
)
val
tvVipItemCurMoney
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemCurMoney
)
val
tvVipItemMoney
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemMoney
)
val
tvVipItemTitle
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemTitle
)
...
...
@@ -50,89 +57,28 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
val
vipBean
=
vipList
[
position
]
if
(
vipBean
.
trial
!=
0
)
{
holder
.
tvVipItemLable
.
setPadding
(
0
,
0
,
0
,
0
)
holder
.
tvVipItemLable
.
text
=
"限时特惠"
holder
.
tvVipItemLable
.
gravity
=
Gravity
.
CENTER
holder
.
tvVipItemLable
.
setBackgroundResource
(
R
.
mipmap
.
ic_vip_lable
)
}
else
{
holder
.
tvVipItemLable
.
setPadding
(
0
,
0
,
0
,
0
)
holder
.
tvVipItemLable
.
text
=
"热门"
holder
.
tvVipItemLable
.
gravity
=
Gravity
.
CENTER
holder
.
tvVipItemLable
.
setBackgroundResource
(
R
.
mipmap
.
ic_vip_lable
)
try
{
if
(!
TextUtils
.
isEmpty
(
vipBean
.
topTitle
))
{
val
topArray
=
vipBean
.
topTitle
.
split
(
","
)
if
(
topArray
!=
null
&&
topArray
.
size
>
0
)
{
holder
.
tvVipItemLable
.
visibility
=
View
.
VISIBLE
holder
.
tvVipItemLable
.
text
=
topArray
[
0
]
holder
.
tvVipItemMoney
.
text
=
topArray
[
1
]
holder
.
tvVipItemCurMoney
.
text
=
topArray
[
2
]
holder
.
tvVipItemTitle
.
text
=
topArray
[
3
]
}
else
{
holder
.
tvVipItemLable
.
visibility
=
View
.
GONE
}
// try {
// if(!TextUtils.isEmpty(vipBean.topTitle)){
//
// val topArray= vipBean.topTitle.split(",")
// holder.tvVipItemCurMoney.text = SpanUtils()
// .append(topArray[0])
// .append(topArray[1])
// .setFontSize(BubbleUtils.sp2px(28))
// .append(topArray[2])
// .create()
// holder.tvVipItemMoney.text = topArray[3]
// holder.tvVipItemTitle.text = topArray[4]
// }else{
// 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.oldPrice > 0) {
// holder.tvVipItemMoney.visibility = View.VISIBLE
// holder.tvVipItemMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中间横线(删除线)
// if (vipBean.oldPrice < 1) {
// holder.tvVipItemMoney.text = "原价:${vipBean.oldPrice}"
// } else {
// holder.tvVipItemMoney.text = "原价:${String.format("%.0f", vipBean.oldPrice)}"
// }
// } else {
// holder.tvVipItemMoney.visibility = View.INVISIBLE
// }
//
// }
// }catch (e:Exception){
// e.printStackTrace()
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
){
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
"0.01"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
.
append
(
"元"
)
.
create
()
}
else
{
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
vipBean
.
price
.
toString
())
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
.
append
(
"元"
)
.
create
()
holder
.
tvVipItemLable
.
visibility
=
View
.
GONE
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
holder
.
tvVipItemLable
.
text
=
""
holder
.
tvVipItemCurMoney
.
text
=
""
holder
.
tvVipItemMoney
.
text
=
""
holder
.
tvVipItemTitle
.
text
=
""
}
// if (vipBean.oldPrice > 0) {
// holder.tvVipItemMoney.visibility = View.VISIBLE
// holder.tvVipItemMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中间横线(删除线)
// if (vipBean.oldPrice < 1) {
// holder.tvVipItemMoney.text = "原价:${vipBean.oldPrice}"
// } else {
// holder.tvVipItemMoney.text = "原价:${String.format("%.0f", vipBean.oldPrice)}"
// }
// } else {
// holder.tvVipItemMoney.visibility = View.INVISIBLE
// }
// }
holder
.
tvVipItemMoney
.
text
=
vipBean
.
topTitle
holder
.
rlVipItemRoot
.
setOnClickListener
{
mOnItemClickListener
.
onItemClick
(
position
)
...
...
@@ -142,20 +88,20 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
if
(
getPosition
()
==
position
)
{
//当前选中
holder
.
rlVipItemRoot
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter
)
//
holder.tvVipItemCurMoney.setTextColor(
//
ContextCompat.getColor(
//
context,
//
R.color.color_FD7E0E
//
)
//
)
holder
.
tvVipItemCurMoney
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FD7E0E
)
)
}
else
{
holder
.
rlVipItemRoot
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter_none
)
//
holder.tvVipItemCurMoney.setTextColor(
//
ContextCompat.getColor(
//
context,
//
R.color.white
//
)
//
)
holder
.
tvVipItemCurMoney
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
)
)
}
holder
.
itemView
.
setTag
(
position
)
...
...
video/app/src/main/res/layout/activity_new_vip.xml
View file @
73b8c211
...
...
@@ -139,7 +139,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvVip"
android:layout_width=
"match_parent"
android:layout_height=
"1
4
0dp"
android:layout_height=
"1
8
0dp"
android:layout_gravity=
"center_horizontal"
android:background=
"@null"
android:overScrollMode=
"never"
/>
...
...
video/app/src/main/res/layout/dialog_powe2.xml
View file @
73b8c211
...
...
@@ -17,7 +17,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"20dp"
android:text=
"欢迎使用
爱都安居
"
android:text=
"欢迎使用
西西剧场
"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
...
...
@@ -125,11 +125,11 @@
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:background=
"#cccccc"
android:gravity=
"center"
android:text=
"不同意并退出"
android:textColor=
"@color/white"
/>
...
...
@@ -140,11 +140,11 @@
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:background=
"#4BB93F"
android:gravity=
"center"
android:text=
"同意并进入"
android:textColor=
"@color/white"
/>
</LinearLayout>
...
...
video/app/src/main/res/layout/item_rv_vip.xml
View file @
73b8c211
<?xml version="1.0" encoding="utf-8"?>
<
Frame
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"10dp"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/rlVipItemRoot"
android:layout_width=
"match_parent
"
android:layout_height=
"11
0dp"
android:layout_marginTop=
"8
dp"
android:layout_width=
"110dp
"
android:layout_height=
"16
0dp"
android:layout_margin=
"10
dp"
android:background=
"@drawable/shape_vip_adapter_none"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent
"
android:layout_marginTop=
"-8dp
"
<TextView
android:id=
"@+id/tvVipItemLable
"
android:layout_width=
"wrap_content
"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
>
android:background=
"@mipmap/ic_vip_lable"
android:gravity=
"center"
android:paddingLeft=
"6dp"
android:paddingTop=
"2dp"
android:paddingRight=
"6dp"
android:paddingBottom=
"2dp"
android:textColor=
"@color/color_815136"
android:textSize=
"10sp"
tools:text=
"包年会员"
/>
<TextView
android:id=
"@+id/tvVipItemTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"18dp"
android:textColor=
"#efbc6a"
android:textSize=
"20sp"
android:layout_centerVertical=
"true"
android:textStyle=
"bold"
android:layout_marginTop=
"16dp"
android:textColor=
"@color/white"
android:textSize=
"18sp"
tools:text=
"包年会员"
/>
<TextView
android:id=
"@+id/tvVipItemCurMoney"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_alignParentRight=
"true"
android:layout_marginRight=
"18dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:textColor=
"#efbc6a
"
android:textSize=
"16
sp"
android:textColor=
"#373737
"
android:textSize=
"24
sp"
tools:text=
"$78"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tvVipItemMoney"
android:layout_width=
"match_parent"
android:layout_height=
"28dp"
android:layout_gravity=
"bottom"
android:background=
"@drawable/shape_vip_lable"
android:gravity=
"center"
android:textColor=
"@color/color_A24240"
android:textSize=
"12sp"
tools:text=
"原价:123"
/>
</FrameLayout>
<TextView
android:id=
"@+id/tvVipItemLable"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@mipmap/ic_vip_lable"
android:gravity=
"center"
android:paddingLeft=
"6dp"
android:paddingTop=
"2dp"
android:paddingRight=
"6dp"
android:paddingBottom=
"2dp"
android:textColor=
"@color/color_815136"
android:textSize=
"14sp"
tools:text=
"包年会员"
/>
</FrameLayout>
\ No newline at end of file
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"16dp"
android:textColor=
"#939AA3"
android:textSize=
"15sp"
tools:text=
"原价:123"
/>
</LinearLayout>
\ 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