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
3f728f0a
Commit
3f728f0a
authored
Sep 13, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
03b6befb
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
171 additions
and
75 deletions
+171
-75
HotStyleAdapter.kt
...in/java/com/mints/helivideo/ui/adapter/HotStyleAdapter.kt
+1
-2
DrawCashAdapter.kt
...a/com/mints/helivideo/ui/fragment/draw/DrawCashAdapter.kt
+40
-0
DrawCashFragment.kt
.../com/mints/helivideo/ui/fragment/draw/DrawCashFragment.kt
+13
-0
shape_draw_adapter.xml
video/app/src/main/res/drawable/shape_draw_adapter.xml
+4
-2
shape_draw_adapter_none.xml
video/app/src/main/res/drawable/shape_draw_adapter_none.xml
+4
-1
fragment_draw.xml
video/app/src/main/res/layout/fragment_draw.xml
+4
-1
fragment_main.xml
video/app/src/main/res/layout/fragment_main.xml
+1
-10
fragment_music.xml
video/app/src/main/res/layout/fragment_music.xml
+2
-0
item_draw_cash.xml
video/app/src/main/res/layout/item_draw_cash.xml
+29
-0
item_rv_vip.xml
video/app/src/main/res/layout/item_rv_vip.xml
+0
-59
layout_draw_header.xml
video/app/src/main/res/layout/layout_draw_header.xml
+73
-0
No files found.
video/app/src/main/java/com/mints/helivideo/ui/adapter/HotStyleAdapter.kt
View file @
3f728f0a
package
com.mints.
wisdomclean
.ui.adapter
package
com.mints.
helivideo
.ui.adapter
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
...
...
video/app/src/main/java/com/mints/helivideo/ui/fragment/draw/DrawCashAdapter.kt
0 → 100644
View file @
3f728f0a
package
com.mints.helivideo.ui.fragment.draw
import
android.view.View
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.mints.helivideo.R
class
DrawCashAdapter
()
:
BaseQuickAdapter
<
String
,
BaseViewHolder
>(
R
.
layout
.
item_draw_cash
)
{
private
var
mSelectIndex
=
0
init
{
mSelectIndex
=
0
}
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
String
)
{
holder
.
getView
<
View
>(
R
.
id
.
root_view
).
setOnClickListener
{
setPosition
(
holder
.
adapterPosition
)
notifyDataSetChanged
()
}
holder
.
setText
(
R
.
id
.
tv_cash
,
item
)
if
(
getPosition
()
==
holder
.
adapterPosition
)
{
//当前选中
holder
.
getView
<
View
>(
R
.
id
.
root_view
)
.
setBackgroundResource
(
R
.
drawable
.
shape_draw_adapter
)
}
else
{
holder
.
getView
<
View
>(
R
.
id
.
root_view
)
.
setBackgroundResource
(
R
.
drawable
.
shape_draw_adapter_none
)
}
}
fun
getPosition
()
=
mSelectIndex
private
fun
setPosition
(
index
:
Int
)
{
this
.
mSelectIndex
=
index
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/helivideo/ui/fragment/draw/DrawCashFragment.kt
View file @
3f728f0a
...
@@ -2,6 +2,8 @@ package com.mints.helivideo.ui.fragment.draw
...
@@ -2,6 +2,8 @@ package com.mints.helivideo.ui.fragment.draw
import
android.os.Bundle
import
android.os.Bundle
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.mints.helivideo.R
import
com.mints.helivideo.R
import
com.mints.helivideo.ui.fragment.base.BaseFragment
import
com.mints.helivideo.ui.fragment.base.BaseFragment
import
com.mints.helivideo.utils.SpanUtils
import
com.mints.helivideo.utils.SpanUtils
...
@@ -27,11 +29,22 @@ class DrawCashFragment : BaseFragment() {
...
@@ -27,11 +29,22 @@ class DrawCashFragment : BaseFragment() {
private
var
drawType
=
DRAW_TYPE_CASH
private
var
drawType
=
DRAW_TYPE_CASH
private
var
mDrawCashData
=
arrayListOf
<
String
>()
private
var
mDrawCashAdapter
:
DrawCashAdapter
?
=
null
override
fun
initViewsAndEvents
()
{
override
fun
initViewsAndEvents
()
{
arguments
?.
let
{
arguments
?.
let
{
drawType
=
it
.
getInt
(
DRAW_TYPE
,
DRAW_TYPE_CASH
)
drawType
=
it
.
getInt
(
DRAW_TYPE
,
DRAW_TYPE_CASH
)
}
}
ry_draw
.
layoutManager
=
LinearLayoutManager
(
requireContext
(),
RecyclerView
.
HORIZONTAL
,
false
)
mDrawCashAdapter
=
DrawCashAdapter
()
ry_draw
.
adapter
=
mDrawCashAdapter
mDrawCashData
.
add
(
"0.3"
)
mDrawCashData
.
add
(
"50"
)
mDrawCashData
.
add
(
"100"
)
mDrawCashAdapter
?.
addData
(
mDrawCashData
)
if
(
drawType
==
DRAW_TYPE_CASH
)
{
if
(
drawType
==
DRAW_TYPE_CASH
)
{
tv_title
.
text
=
"红包余额(元)"
tv_title
.
text
=
"红包余额(元)"
...
...
video/app/src/main/res/drawable/shape_
vip
_adapter.xml
→
video/app/src/main/res/drawable/shape_
draw
_adapter.xml
View file @
3f728f0a
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
android:shape=
"rectangle"
>
<!-- 填充的颜色 -->
<!-- 填充的颜色 -->
<stroke
android:width=
"3dp"
android:color=
"@color/red"
/>
<stroke
<solid
android:color=
"#240a0e"
/>
android:width=
"2dp"
android:color=
"@color/red"
/>
<solid
android:color=
"@color/white"
/>
<!-- 设置按钮的四个角为弧形 -->
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"5dip"
/>
<corners
android:radius=
"5dip"
/>
...
...
video/app/src/main/res/drawable/shape_
vip
_adapter_none.xml
→
video/app/src/main/res/drawable/shape_
draw
_adapter_none.xml
View file @
3f728f0a
...
@@ -2,8 +2,11 @@
...
@@ -2,8 +2,11 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
android:shape=
"rectangle"
>
<!-- 填充的颜色 -->
<!-- 填充的颜色 -->
<stroke
android:width=
"1dp"
android:color=
"@color/graya"
/>
<solid
android:color=
"
#282D34
"
/>
<solid
android:color=
"
@color/white
"
/>
<!-- 设置按钮的四个角为弧形 -->
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"5dip"
/>
<corners
android:radius=
"5dip"
/>
...
...
video/app/src/main/res/layout/fragment_draw.xml
View file @
3f728f0a
...
@@ -45,7 +45,6 @@
...
@@ -45,7 +45,6 @@
android:id=
"@+id/rg_draw"
android:id=
"@+id/rg_draw"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_height=
"60dp"
android:layout_marginTop=
"10dp"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:padding=
"10dp"
>
android:padding=
"10dp"
>
...
@@ -53,7 +52,9 @@
...
@@ -53,7 +52,9 @@
android:id=
"@+id/rb_wechat"
android:id=
"@+id/rb_wechat"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginEnd=
"@dimen/dp_10"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@drawable/shape_draw_adapter_none"
android:button=
"@null"
android:button=
"@null"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"微信"
/>
android:text=
"微信"
/>
...
@@ -62,7 +63,9 @@
...
@@ -62,7 +63,9 @@
android:id=
"@+id/rb_alipay"
android:id=
"@+id/rb_alipay"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginStart=
"@dimen/dp_10"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@drawable/shape_draw_adapter_none"
android:button=
"@null"
android:button=
"@null"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"支付宝"
/>
android:text=
"支付宝"
/>
...
...
video/app/src/main/res/layout/fragment_main.xml
View file @
3f728f0a
...
@@ -16,16 +16,7 @@
...
@@ -16,16 +16,7 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<include
layout=
"@layout/layout_draw_header"
/>
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"30dp"
android:layout_marginBottom=
"10dp"
android:text=
"剧场"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/srlMainPage"
android:id=
"@+id/srlMainPage"
...
...
video/app/src/main/res/layout/fragment_music.xml
View file @
3f728f0a
...
@@ -8,4 +8,6 @@
...
@@ -8,4 +8,6 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<include
layout=
"@layout/layout_draw_header"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_draw_cash.xml
0 → 100755
View file @
3f728f0a
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/root_view"
android:layout_width=
"100dp"
android:layout_height=
"50dp"
android:layout_marginEnd=
"6dp"
android:background=
"@drawable/shape_draw_adapter_none"
>
<TextView
android:id=
"@+id/tv_label"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@mipmap/ic_vip_lable"
android:gravity=
"center"
android:paddingLeft=
"2dp"
android:paddingRight=
"2dp"
android:textColor=
"@color/white"
android:textSize=
"10sp"
/>
<TextView
android:id=
"@+id/tv_cash"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"0.3元"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</FrameLayout>
\ No newline at end of file
video/app/src/main/res/layout/item_rv_vip.xml
deleted
100644 → 0
View file @
03b6befb
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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:id=
"@+id/rlVipItemRoot"
android:layout_width=
"110dp"
android:layout_height=
"150dp"
android:layout_margin=
"10dp"
android:background=
"@drawable/shape_vip_adapter_none"
android:orientation=
"vertical"
>
<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/white"
android:textSize=
"12sp"
tools:text=
"包年会员"
/>
<TextView
android:id=
"@+id/tvVipItemTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
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_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:textColor=
"#373737"
android:textSize=
"24sp"
android:textStyle=
"bold"
tools:text=
"$78"
/>
<TextView
android:id=
"@+id/tvVipItemMoney"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"16dp"
android:textColor=
"#939AA3"
android:textSize=
"14sp"
tools:text=
"原价:123"
/>
</LinearLayout>
\ No newline at end of file
video/app/src/main/res/layout/layout_draw_header.xml
0 → 100644
View file @
3f728f0a
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingTop=
"40dp"
android:paddingBottom=
"10dp"
>
<LinearLayout
android:id=
"@+id/ll_draw_cash"
android:layout_width=
"140dp"
android:layout_height=
"40dp"
android:layout_marginStart=
"20dp"
android:background=
"@drawable/shape_half_trans"
android:gravity=
"center_vertical"
>
<ImageView
android:layout_width=
"30dp"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_launcher_main"
/>
<TextView
android:id=
"@+id/tv_cash"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"50元"
android:textColor=
"@color/white"
/>
<Button
android:layout_width=
"60dp"
android:layout_height=
"28dp"
android:layout_marginEnd=
"6dp"
android:background=
"@drawable/shape_green"
android:text=
"提现"
android:textColor=
"@color/white"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_draw_gold"
android:layout_width=
"140dp"
android:layout_height=
"40dp"
android:layout_gravity=
"end"
android:layout_marginEnd=
"20dp"
android:background=
"@drawable/shape_half_trans"
android:gravity=
"center_vertical"
>
<ImageView
android:layout_width=
"30dp"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_launcher_main"
/>
<TextView
android:id=
"@+id/tv_gold"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"37个"
android:textColor=
"@color/white"
/>
<Button
android:layout_width=
"60dp"
android:layout_height=
"28dp"
android:layout_marginEnd=
"6dp"
android:background=
"@drawable/shape_green"
android:text=
"提现"
android:textColor=
"@color/white"
/>
</LinearLayout>
</FrameLayout>
\ 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