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
e7b0ce9f
Commit
e7b0ce9f
authored
Sep 08, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
fa2e1fd4
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
315 additions
and
744 deletions
+315
-744
MyPresenter.kt
...in/java/com/mints/helivideo/mvp/presenters/MyPresenter.kt
+0
-139
MyView.kt
...app/src/main/java/com/mints/helivideo/mvp/views/MyView.kt
+0
-6
TasksAdapter.kt
.../main/java/com/mints/helivideo/ui/adapter/TasksAdapter.kt
+85
-0
MyFragment.kt
...c/main/java/com/mints/helivideo/ui/fragment/MyFragment.kt
+59
-346
bg_task_list.xml
video/app/src/main/res/drawable/bg_task_list.xml
+5
-0
progressbar_versus_changevedio_bg.xml
...c/main/res/drawable/progressbar_versus_changevedio_bg.xml
+20
-0
shape_task_btn.xml
video/app/src/main/res/drawable/shape_task_btn.xml
+8
-0
fragment_main_my.xml
video/app/src/main/res/layout/fragment_main_my.xml
+9
-253
item_fragment_adapter_task.xml
video/app/src/main/res/layout/item_fragment_adapter_task.xml
+129
-0
ic_task_item_coupon.png
video/app/src/main/res/mipmap-xhdpi/ic_task_item_coupon.png
+0
-0
ic_task_sign_coin.png
video/app/src/main/res/mipmap-xhdpi/ic_task_sign_coin.png
+0
-0
No files found.
video/app/src/main/java/com/mints/helivideo/mvp/presenters/MyPresenter.kt
View file @
e7b0ce9f
...
@@ -82,7 +82,6 @@ class MyPresenter : BasePresenter<MyView>() {
...
@@ -82,7 +82,6 @@ class MyPresenter : BasePresenter<MyView>() {
val
code
=
baseResponse
.
status
val
code
=
baseResponse
.
status
when
(
code
)
{
when
(
code
)
{
200
->
{
200
->
{
showTurn
()
getMyInfo
()
getMyInfo
()
}
}
}
}
...
@@ -128,142 +127,4 @@ class MyPresenter : BasePresenter<MyView>() {
...
@@ -128,142 +127,4 @@ class MyPresenter : BasePresenter<MyView>() {
}
}
})
})
}
}
fun
showTurn
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
showTurn
(),
object
:
BaseSubscriber
<
BaseResponse
<
NineShowBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
NineShowBean
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
showTurnSuc
(
baseResponse
.
data
)
else
->
{
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
}
})
}
fun
getTurnIphoneMsg
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getTurnConfig
(),
object
:
BaseSubscriber
<
BaseResponse
<
NineListBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
NineListBean
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
getTurnIphoneMsgSuc
(
baseResponse
.
data
)
else
->
{
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
}
})
}
fun
toTurn
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
toTurn
(),
object
:
BaseSubscriber
<
BaseResponse
<
NineListBean
.
NineBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
NineListBean
.
NineBean
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
toTurnSuc
(
baseResponse
.
data
)
else
->
{
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
}
})
}
fun
unlock
(
vo
:
java
.
util
.
HashMap
<
String
,
Any
>)
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
unlock
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
IndexList
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
IndexList
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
unlockSuc
()
else
->
{
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
}
})
}
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/helivideo/mvp/views/MyView.kt
View file @
e7b0ce9f
package
com.mints.helivideo.mvp.views
package
com.mints.helivideo.mvp.views
import
com.mints.helivideo.mvp.model.NineListBean
import
com.mints.helivideo.mvp.model.NineShowBean
import
com.mints.helivideo.mvp.model.UserBean
import
com.mints.helivideo.mvp.model.UserBean
interface
MyView
:
BaseView
{
interface
MyView
:
BaseView
{
fun
getUserSuc
(
data
:
UserBean
)
fun
getUserSuc
(
data
:
UserBean
)
fun
showTurnSuc
(
data
:
NineShowBean
)
fun
getTurnIphoneMsgSuc
(
data
:
NineListBean
)
fun
toTurnSuc
(
data
:
NineListBean
.
NineBean
)
fun
unlockSuc
()
}
}
video/app/src/main/java/com/mints/helivideo/ui/adapter/TasksAdapter.kt
0 → 100644
View file @
e7b0ce9f
package
com.mints.helivideo.ui.adapter
import
android.content.Context
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.ProgressBar
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.mints.helivideo.R
import
com.mints.helivideo.mvp.model.BannerBean
/**
* 任务中心-列表适配器
*/
class
TasksAdapter
(
context
:
Context
,
var
taskData
:
MutableList
<
BannerBean
>?
=
null
)
:
RecyclerView
.
Adapter
<
TasksAdapter
.
ViewHolder
>()
{
private
var
mContext
:
Context
=
context
private
var
itemListener
:
ItemListener
?
=
null
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
val
inflater
:
LayoutInflater
=
LayoutInflater
.
from
(
mContext
)
return
ViewHolder
(
inflater
.
inflate
(
R
.
layout
.
item_fragment_adapter_task
,
parent
,
false
))
}
override
fun
getItemCount
():
Int
{
return
if
(
taskData
==
null
)
{
30
}
else
{
taskData
!!
.
size
}
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
// taskData?.let {
// // 一级标题
// holder.itemTaskTitle.text = baseConfig.title
// // 二级内容
// holder.itemTaskContent.text = baseConfig.context
// // 按钮文字
// holder.itemTaskClick.text = baseConfig.buttonText
// // 金币
// holder.itemTaskMoney.text = baseConfig.coinText
// // 提现券
// holder.itemTaskCoupons.text = baseConfig.diText
//
// // 进度条 (文本)
// if (baseConfig.runingMax > 0) {
// holder.itemTaskPb.visibility = View.VISIBLE
// holder.itemTaskPb.max = baseConfig.runingMax
// holder.itemTaskPb.progress = baseConfig.runingComplete
//
// // 进度条文字
// holder.itemTaskProgress.visibility = View.VISIBLE
// holder.itemTaskProgress.text = baseConfig.runingText
// } else {
// holder.itemTaskPb.visibility = View.GONE
// holder.itemTaskProgress.visibility = View.GONE
// }
// }
}
inner
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
itemTaskTitle
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
item_task_title
)
val
itemTaskMoney
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
item_task_money
)
val
itemTaskCoupons
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
item_task_coupons
)
val
itemTaskProgress
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
item_task_progress
)
val
itemTaskClick
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
item_task
)
val
itemTaskContent
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
item_task_content
)
val
itemTaskPb
:
ProgressBar
=
itemView
.
findViewById
(
R
.
id
.
item_task_pb
)
val
llTaskRoot
:
FrameLayout
=
itemView
.
findViewById
(
R
.
id
.
ll_task_root
)
}
fun
setItemListener
(
listener
:
ItemListener
)
{
itemListener
=
listener
}
interface
ItemListener
{
// fun onItemClick(bean: MyInfo.AutoListBean?)
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/helivideo/ui/fragment/MyFragment.kt
View file @
e7b0ce9f
This diff is collapsed.
Click to expand it.
video/app/src/main/res/drawable/bg_task_list.xml
0 → 100644
View file @
e7b0ce9f
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/white"
/>
<corners
android:radius=
"9dp"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/drawable/progressbar_versus_changevedio_bg.xml
0 → 100644
View file @
e7b0ce9f
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!--3个层的顺序即为显示时的叠加顺序-->
<!--背景色-->
<item
android:id=
"@android:id/background"
>
<shape>
<corners
android:radius=
"5dip"
/>
<solid
android:color=
"#FFE9E9"
/>
</shape>
</item>
<!--一级进度条的颜色,也可以直接替换成图片-->
<item
android:id=
"@android:id/progress"
>
<clip>
<shape>
<corners
android:radius=
"5dip"
/>
<solid
android:color=
"#F13D3D"
/>
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
video/app/src/main/res/drawable/shape_task_btn.xml
0 → 100644
View file @
e7b0ce9f
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"500dp"
/>
<gradient
android:angle=
"270"
android:endColor=
"#F13D3D"
android:startColor=
"#F13D3D"
/>
</shape>
\ No newline at end of file
video/app/src/main/res/layout/fragment_main_my.xml
View file @
e7b0ce9f
This diff is collapsed.
Click to expand it.
video/app/src/main/res/layout/item_fragment_adapter_task.xml
0 → 100644
View file @
e7b0ce9f
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
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/ll_task_root"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/bg_task_list"
android:orientation=
"vertical"
android:padding=
"14dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/item_task_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"1"
android:singleLine=
"true"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:text=
"领金币"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:orientation=
"horizontal"
>
<ProgressBar
android:id=
"@+id/item_task_pb"
style=
"@android:style/Widget.ProgressBar.Horizontal"
android:layout_width=
"70dp"
android:layout_height=
"6dp"
android:layout_gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:progress=
"20"
android:progressDrawable=
"@drawable/progressbar_versus_changevedio_bg"
/>
<TextView
android:id=
"@+id/item_task_progress"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"2dp"
android:gravity=
"center_vertical|left"
android:textColor=
"#F13D3D"
android:textSize=
"11sp"
android:text=
"88/85"
/>
</LinearLayout>
</RelativeLayout>
<TextView
android:id=
"@+id/item_task_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:layout_marginBottom=
"8dp"
android:textColor=
"#464646"
android:textSize=
"12sp"
android:text=
"观看福利视频赚金币"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/item_task_money"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:drawableLeft=
"@mipmap/ic_task_sign_coin"
android:gravity=
"center_vertical"
android:textColor=
"#F13D3D"
android:textSize=
"22sp"
android:text=
"+1500金币"
/>
<TextView
android:id=
"@+id/item_task_plus"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:layout_toRightOf=
"@+id/item_task_money"
android:gravity=
"center_vertical"
android:text=
"+"
android:textColor=
"#FF9700"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_task_coupons"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_toRightOf=
"@+id/item_task_plus"
android:drawableLeft=
"@mipmap/ic_task_sign_coin"
android:gravity=
"center_vertical"
android:textColor=
"#F13D3D"
android:textSize=
"22sp"
android:text=
"*15"
/>
</RelativeLayout>
</LinearLayout>
<TextView
android:id=
"@+id/item_task"
android:layout_width=
"76dp"
android:layout_height=
"30dp"
android:layout_gravity=
"right|bottom"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/shape_task_btn"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"13dp"
android:text=
"去完成"
/>
</FrameLayout>
\ No newline at end of file
video/app/src/main/res/mipmap-xhdpi/ic_task_item_coupon.png
0 → 100644
View file @
e7b0ce9f
5.01 KB
video/app/src/main/res/mipmap-xhdpi/ic_task_sign_coin.png
0 → 100644
View file @
e7b0ce9f
6.18 KB
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