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
b408abbf
Commit
b408abbf
authored
Sep 13, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化样式
parent
3af3334d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
87 deletions
+83
-87
VipActivity.kt
...java/com/duben/duoduoplayletu/ui/activitys/VipActivity.kt
+2
-1
VipAdapter.kt
...in/java/com/duben/duoduoplayletu/ui/adapter/VipAdapter.kt
+37
-18
shape_vip_adapter.xml
video/app/src/main/res/drawable/shape_vip_adapter.xml
+1
-1
shape_vip_adapter_none.xml
video/app/src/main/res/drawable/shape_vip_adapter_none.xml
+1
-1
activity_new_vip.xml
video/app/src/main/res/layout/activity_new_vip.xml
+1
-1
item_rv_vip.xml
video/app/src/main/res/layout/item_rv_vip.xml
+41
-65
No files found.
video/app/src/main/java/com/duben/duoduoplayletu/ui/activitys/VipActivity.kt
View file @
b408abbf
...
@@ -11,6 +11,7 @@ import android.text.TextUtils
...
@@ -11,6 +11,7 @@ import android.text.TextUtils
import
android.view.KeyEvent
import
android.view.KeyEvent
import
android.view.View
import
android.view.View
import
android.widget.CompoundButton
import
android.widget.CompoundButton
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.daimajia.androidanimations.library.YoYo
...
@@ -400,7 +401,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
...
@@ -400,7 +401,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
private
fun
initRvView
()
{
private
fun
initRvView
()
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
gridLayoutManager
=
LinearLayoutManager
(
this
)
val
gridLayoutManager
=
GridLayoutManager
(
this
,
3
)
rvVip
.
layoutManager
=
gridLayoutManager
rvVip
.
layoutManager
=
gridLayoutManager
vipAdapter
=
VipAdapter
(
vipList
!!
)
vipAdapter
=
VipAdapter
(
vipList
!!
)
rvVip
.
adapter
=
vipAdapter
rvVip
.
adapter
=
vipAdapter
...
...
video/app/src/main/java/com/duben/duoduoplayletu/ui/adapter/VipAdapter.kt
View file @
b408abbf
...
@@ -40,7 +40,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
...
@@ -40,7 +40,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
}
}
inner
class
ViewHolder
(
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
{
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
tvVipItemCurMoney
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemCurMoney
)
val
tvVipItemMoney
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemMoney
)
val
tvVipItemMoney
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemMoney
)
val
tvVipItemTitle
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemTitle
)
val
tvVipItemTitle
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvVipItemTitle
)
...
@@ -118,7 +118,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
...
@@ -118,7 +118,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
// 跳转小程序领券
// 跳转小程序领券
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
vipBean
.
oldPrice
.
toFloat
().
toString
())
.
append
(
vipBean
.
oldPrice
.
toFloat
().
toString
())
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
//
.setFontSize(BubbleUtils.sp2px(34))
.
append
(
" 元\n"
)
.
append
(
" 元\n"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
14
))
.
setFontSize
(
BubbleUtils
.
sp2px
(
14
))
.
append
(
"原价:"
+
vipBean
.
price
.
toFloat
().
toString
()
+
" 元"
)
.
append
(
"原价:"
+
vipBean
.
price
.
toFloat
().
toString
()
+
" 元"
)
...
@@ -129,14 +129,16 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
...
@@ -129,14 +129,16 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
if
(
vipBean
.
price
==
0.0
)
{
if
(
vipBean
.
price
==
0.0
)
{
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
"0.01"
)
.
append
(
"0.01"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
//
.setFontSize(BubbleUtils.sp2px(34))
.
append
(
"元"
)
.
append
(
"元"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
14
))
.
create
()
.
create
()
}
else
{
}
else
{
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
holder
.
tvVipItemCurMoney
.
text
=
SpanUtils
()
.
append
(
vipBean
.
price
.
toString
())
.
append
(
vipBean
.
price
.
toString
())
.
setFontSize
(
BubbleUtils
.
sp2px
(
34
))
//
.setFontSize(BubbleUtils.sp2px(34))
.
append
(
"元"
)
.
append
(
"元"
)
.
setFontSize
(
BubbleUtils
.
sp2px
(
14
))
.
create
()
.
create
()
}
}
}
}
...
@@ -153,8 +155,25 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
...
@@ -153,8 +155,25 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
// holder.tvVipItemMoney.visibility = View.INVISIBLE
// holder.tvVipItemMoney.visibility = View.INVISIBLE
// }
// }
// }
// }
holder
.
tvVipItemMoney
.
text
=
vipBean
.
topTitle
// holder.tvVipItemMoney.text = vipBean.topTitle
try
{
if
(!
TextUtils
.
isEmpty
(
vipBean
.
topTitle
))
{
val
topArray
=
vipBean
.
topTitle
.
split
(
","
)
if
(
topArray
!=
null
&&
topArray
.
size
>
0
)
{
holder
.
tvVipItemLable
.
text
=
topArray
[
0
]
?:
""
holder
.
tvVipItemCurMoney
.
text
=
topArray
[
1
]
?:
""
holder
.
tvVipItemMoney
.
text
=
topArray
[
2
]
?:
""
holder
.
tvVipItemTitle
.
text
=
topArray
[
3
]
?:
""
}
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
holder
.
tvVipItemLable
.
text
=
""
holder
.
tvVipItemCurMoney
.
text
=
""
holder
.
tvVipItemMoney
.
text
=
""
holder
.
tvVipItemTitle
.
text
=
""
}
holder
.
rlVipItemRoot
.
setOnClickListener
{
holder
.
rlVipItemRoot
.
setOnClickListener
{
mOnItemClickListener
.
onItemClick
(
position
)
mOnItemClickListener
.
onItemClick
(
position
)
...
@@ -164,20 +183,20 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
...
@@ -164,20 +183,20 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
if
(
getPosition
()
==
position
)
{
if
(
getPosition
()
==
position
)
{
//当前选中
//当前选中
holder
.
rlVipItemRoot
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter
)
holder
.
rlVipItemRoot
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter
)
//
holder.tvVipItemCurMoney.setTextColor(
holder
.
tvVipItemCurMoney
.
setTextColor
(
//
ContextCompat.getColor(
ContextCompat
.
getColor
(
//
context,
context
,
//
R.color.color_FD7E0E
R
.
color
.
color_FD7E0E
//
)
)
//
)
)
}
else
{
}
else
{
holder
.
rlVipItemRoot
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter_none
)
holder
.
rlVipItemRoot
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter_none
)
//
holder.tvVipItemCurMoney.setTextColor(
holder
.
tvVipItemCurMoney
.
setTextColor
(
//
ContextCompat.getColor(
ContextCompat
.
getColor
(
//
context,
context
,
//
R.color.white
R
.
color
.
white
//
)
)
//
)
)
}
}
holder
.
itemView
.
setTag
(
position
)
holder
.
itemView
.
setTag
(
position
)
...
...
video/app/src/main/res/drawable/shape_vip_adapter.xml
View file @
b408abbf
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
<solid
android:color=
"@color/black"
/>
<solid
android:color=
"@color/black"
/>
<!-- 设置按钮的四个角为弧形 -->
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"
5
dip"
/>
<corners
android:radius=
"
10
dip"
/>
</shape>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/shape_vip_adapter_none.xml
View file @
b408abbf
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
<solid
android:color=
"@color/black"
/>
<solid
android:color=
"@color/black"
/>
<!-- 设置按钮的四个角为弧形 -->
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"
5
dip"
/>
<corners
android:radius=
"
10
dip"
/>
</shape>
</shape>
\ No newline at end of file
video/app/src/main/res/layout/activity_new_vip.xml
View file @
b408abbf
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvVip"
android:id=
"@+id/rvVip"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"1
3
0dp"
android:layout_height=
"1
8
0dp"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:background=
"@null"
android:background=
"@null"
android:overScrollMode=
"never"
/>
android:overScrollMode=
"never"
/>
...
...
video/app/src/main/res/layout/item_rv_vip.xml
View file @
b408abbf
<?xml version="1.0" encoding="utf-8"?>
<?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:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"10dp"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/rlVipItemRoot"
android:id=
"@+id/rlVipItemRoot"
android:layout_width=
"match_parent
"
android:layout_width=
"110dp
"
android:layout_height=
"11
0dp"
android:layout_height=
"16
0dp"
android:layout_marginTop=
"8
dp"
android:layout_margin=
"10
dp"
android:background=
"@drawable/shape_vip_adapter_none"
android:background=
"@drawable/shape_vip_adapter_none"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<RelativeLayout
<TextView
android:layout_width=
"match_parent"
android:id=
"@+id/tvVipItemLable"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:background=
"@mipmap/ic_vip_lable"
android:layout_marginTop=
"-8dp"
>
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
<TextView
android:id=
"@+id/tvVipItemTitle"
android:id=
"@+id/tvVipItemTitle"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"18dp"
android:layout_marginTop=
"16dp"
android:textColor=
"#efbc6a"
android:textColor=
"@color/white"
android:textSize=
"20sp"
android:textSize=
"18sp"
android:textStyle=
"bold"
tools:text=
"包年会员"
/>
tools:text=
"包年会员"
/>
<TextView
<TextView
android:id=
"@+id/tvVipItemCurMoney"
android:id=
"@+id/tvVipItemCurMoney"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_gravity=
"center_horizontal"
android:layout_centerVertical=
"true"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"18dp"
android:gravity=
"center"
android:gravity=
"center"
android:lineSpacingExtra=
"-6dp"
android:textColor=
"#373737"
android:textColor=
"#efbc6a"
android:textSize=
"24sp"
android:textSize=
"16sp"
tools:text=
"$78"
/>
tools:text=
"$78"
/>
</RelativeLayout>
<TextView
<TextView
android:id=
"@+id/tvVipItemMoney"
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_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@mipmap/ic_vip_lable"
android:layout_gravity=
"center_horizontal"
android:gravity=
"center"
android:layout_marginTop=
"10dp"
android:paddingLeft=
"6dp"
android:layout_marginBottom=
"16dp"
android:paddingTop=
"2dp"
android:textColor=
"#939AA3"
android:paddingRight=
"6dp"
android:paddingBottom=
"2dp"
android:textColor=
"@color/color_815136"
android:textSize=
"14sp"
android:textSize=
"14sp"
tools:text=
"包年会员"
/>
tools:text=
"原价:123"
/>
</FrameLayout>
\ No newline at end of file
</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