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
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>() {
val
code
=
baseResponse
.
status
when
(
code
)
{
200
->
{
showTurn
()
getMyInfo
()
}
}
...
...
@@ -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
import
com.mints.helivideo.mvp.model.NineListBean
import
com.mints.helivideo.mvp.model.NineShowBean
import
com.mints.helivideo.mvp.model.UserBean
interface
MyView
:
BaseView
{
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
package
com.mints.helivideo.ui.fragment
import
android.app.Dialog
import
android.os.Bundle
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.view.View
import
android.widget.FrameLayout
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.mints.helivideo.R
import
com.mints.helivideo.ad.AdManager
import
com.mints.helivideo.ad.AdStatusListener
import
com.mints.helivideo.ad.NoPreAdManager
import
com.mints.helivideo.ad.express.ExpressAdCallback
import
com.mints.helivideo.ad.express.MyExpressManager
import
com.mints.helivideo.common.AppConfig
import
com.mints.helivideo.common.Constant
import
com.mints.helivideo.manager.UserManager
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.presenters.MyPresenter
import
com.mints.helivideo.mvp.views.MyView
import
com.mints.helivideo.ui.a
ctivitys.*
import
com.mints.helivideo.ui.a
dapter.TasksAdapter
import
com.mints.helivideo.ui.fragment.base.LazyLoadBaseFragment
import
com.mints.helivideo.ui.widgets.DialogListener
import
com.mints.helivideo.ui.widgets.NineContinueDialog
import
com.mints.helivideo.utils.AppPreferencesManager
import
com.mints.helivideo.utils.SpanUtils
import
com.mints.helivideo.utils.TimeRender
import
com.mints.helivideo.utils.UIUtils
import
com.mints.helivideo.utils.rxutil.CommonRxTask
import
com.mints.helivideo.utils.rxutil.RxjavaUtil
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.fragment_main_my.*
/**
* 描述:我
* 作者:孟崔广
* 时间:2023/
7
/7 11:30
* 时间:2023/
9
/7 11:30
*/
class
MyFragment
:
LazyLoadBaseFragment
(),
MyView
,
View
.
OnClickListener
{
private
val
myPresenter
by
lazy
{
MyPresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
val
luckyIndexMap
:
MutableMap
<
Int
,
String
>
=
HashMap
()
private
var
yoyo
:
YoYo
.
YoYoString
?
=
null
private
var
isInitLuckyData
=
false
private
var
isTurnLuckyPage
=
false
private
var
nineShowBean
:
NineShowBean
?
=
null
var
carrierType
=
Constant
.
CARRIERTYPE_NINE
private
var
tasksAdapter
:
TasksAdapter
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_my
override
fun
initViewsAndEvents
()
{
myPresenter
.
attachView
(
this
)
tv_contact
.
text
=
SpanUtils
()
.
append
(
"如有问题,请直接联系"
)
.
append
(
"在线客服\n"
)
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
main_mints
))
.
append
(
"处理速度更快,"
)
.
append
(
"无需联系支付宝"
)
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
main_mints
))
.
create
()
initRecy
()
initListener
()
}
private
fun
initRecy
()
{
tasksAdapter
=
TasksAdapter
(
mContext
)
recy_tasks
.
adapter
=
tasksAdapter
// recy_tasks.adapter?.notifyDataSetChanged()
}
override
fun
onFragmentFirstVisible
()
{
super
.
onFragmentFirstVisible
()
...
...
@@ -78,8 +49,6 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override
fun
onDestroy
()
{
super
.
onDestroy
()
yoyo
?.
stop
()
yoyo
=
null
myPresenter
.
detachView
()
}
...
...
@@ -87,20 +56,9 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
super
.
onFragmentResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_FOUR
)
{
if
(
AntiShake
.
check
(
ll_my_record
?.
id
))
return
if
(
userManager
.
vipFlag
){
MyExpressManager
.
instance
.
preLoadAd
()
showAd
()
}
if
(
isTurnLuckyPage
){
isTurnLuckyPage
=
false
clickTurn
()
}
// if (AntiShake.check(ll_my_record?.id)) return
if
(!
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
myPresenter
.
showTurn
()
myPresenter
.
getMyInfo
()
}
else
{
myPresenter
.
userLogin
()
...
...
@@ -111,32 +69,10 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
override
fun
onClick
(
v
:
View
?)
{
if
(
AntiShake
.
check
(
v
?.
id
))
return
when
(
v
?.
id
)
{
R
.
id
.
tv_my_btn
->
{
}
R
.
id
.
ll_my_setting
->
{
readyGo
(
SettingsActivity
::
class
.
java
)
}
R
.
id
.
tv_my_account
,
R
.
id
.
ll_my_login
->
{
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
MobileLoginActivity
::
class
.
java
)
}
}
R
.
id
.
ll_my_record
->
{
readyGo
(
WatchRecordActivity
::
class
.
java
)
}
R
.
id
.
ll_my_feed
->
{
readyGo
(
FeedbackActivity
::
class
.
java
)
}
R
.
id
.
ll_contactus
->
{
// (requireActivity() as MainActivity).backPhoneDialog()
}
R
.
id
.
ll_my_payrecord
->
{
}
R
.
id
.
btn_action
,
R
.
id
.
rl_lucky
->
{
clickTurn
()
}
}
// when (v?.id) {
// R.id.tv_my_btn -> {
// }
// }
}
override
fun
getUserSuc
(
data
:
UserBean
)
{
...
...
@@ -144,275 +80,52 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
}
private
fun
loginStatus
(
consumer
:
UserBean
)
{
// 1-匹配用户
if
(
consumer
.
activiteFlag
==
1
)
{
// 匹配
ll_my_vip
.
visibility
=
View
.
VISIBLE
ll_my_payrecord
.
visibility
=
View
.
VISIBLE
ll_contactus
.
visibility
=
View
.
VISIBLE
line_my_payrecord
.
visibility
=
View
.
VISIBLE
line_my_contactus
.
visibility
=
View
.
VISIBLE
}
else
{
// 未匹配
ll_my_vip
.
visibility
=
View
.
GONE
ll_my_payrecord
.
visibility
=
View
.
GONE
ll_contactus
.
visibility
=
View
.
GONE
line_my_payrecord
.
visibility
=
View
.
GONE
line_my_contactus
.
visibility
=
View
.
GONE
}
// 2-是否有手机号
if
(!
TextUtils
.
isEmpty
(
userManager
.
mobile
))
{
tv_my_account
.
text
=
"手机号:"
+
consumer
.
mobile
.
substring
(
0
,
3
)+
"****"
+
consumer
.
mobile
.
substring
(
consumer
.
mobile
.
length
-
4
)
iv_my_bind
.
visibility
=
View
.
GONE
}
else
{
tv_my_account
.
text
=
"绑定手机号"
iv_my_bind
.
visibility
=
View
.
VISIBLE
}
tv_my_id
.
text
=
"用户ID:"
+
consumer
.
idcode
// 3-vip
if
(
consumer
.
expireTime
>
0
)
{
tv_my_vip
.
text
=
"VIP会员"
tv_my_btn
.
visibility
=
View
.
GONE
if
(
consumer
.
isForever
)
{
tv_my_status
.
text
=
"有效期: 永久有效"
}
else
{
tv_my_status
.
text
=
"到期时间 ${TimeRender.formatDate(consumer.expireTime, TimeRender.ALL_FORMAT_LINE)}"
}
}
else
{
tv_my_vip
.
text
=
"开通VIP会员"
tv_my_status
.
text
=
"解锁全部短剧"
tv_my_btn
.
visibility
=
View
.
VISIBLE
tv_my_btn
.
text
=
"立即开通"
}
//
// 1-匹配用户
//
if (consumer.activiteFlag == 1) {
//
// 匹配
//
ll_my_vip.visibility = View.VISIBLE
//
ll_my_payrecord.visibility = View.VISIBLE
//
ll_contactus.visibility = View.VISIBLE
//
line_my_payrecord.visibility = View.VISIBLE
//
line_my_contactus.visibility = View.VISIBLE
//
} else {
//
// 未匹配
//
ll_my_vip.visibility = View.GONE
//
ll_my_payrecord.visibility = View.GONE
//
ll_contactus.visibility = View.GONE
//
line_my_payrecord.visibility = View.GONE
//
line_my_contactus.visibility = View.GONE
//
}
//
//
// 2-是否有手机号
//
if (!TextUtils.isEmpty(userManager.mobile)) {
//
tv_my_account.text = "手机号:" + consumer.mobile.substring(0,3)+"****"+consumer.mobile.substring(consumer.mobile.length-4)
//
iv_my_bind.visibility = View.GONE
//
} else {
//
tv_my_account.text = "绑定手机号"
//
iv_my_bind.visibility = View.VISIBLE
//
}
//
tv_my_id.text = "用户ID:"+consumer.idcode
//
//
// 3-vip
//
if (consumer.expireTime > 0) {
//
tv_my_vip.text = "VIP会员"
//
tv_my_btn.visibility = View.GONE
//
if (consumer.isForever) {
//
tv_my_status.text = "有效期: 永久有效"
//
} else {
//
tv_my_status.text =
//
"到期时间 ${TimeRender.formatDate(consumer.expireTime, TimeRender.ALL_FORMAT_LINE)}"
//
}
//
} else {
//
tv_my_vip.text = "开通VIP会员"
//
tv_my_status.text = "解锁全部短剧"
//
tv_my_btn.visibility = View.VISIBLE
//
tv_my_btn.text = "立即开通"
//
}
}
private
fun
initListener
()
{
ll_my_login
.
setOnClickListener
(
this
)
tv_my_btn
.
setOnClickListener
(
this
)
tv_my_account
.
setOnClickListener
(
this
)
ll_my_record
.
setOnClickListener
(
this
)
ll_my_feed
.
setOnClickListener
(
this
)
ll_my_payrecord
.
setOnClickListener
(
this
)
ll_my_setting
.
setOnClickListener
(
this
)
ll_contactus
.
setOnClickListener
(
this
)
btn_action
.
setOnClickListener
(
this
)
rl_lucky
.
setOnClickListener
(
this
)
}
//----9宫格逻辑--开始--//
override
fun
unlockSuc
()
{
myPresenter
.
showTurn
()
if
(
nineShowBean
!=
null
)
{
if
(
nineShowBean
!!
.
need
-
nineShowBean
!!
.
complete
-
1
>
0
)
{
showContinueDialog
()
}
}
}
override
fun
getTurnIphoneMsgSuc
(
data
:
NineListBean
)
{
lucky_panel
.
setImgArray
(
data
.
list
)
initLuckyIndexForPid
(
data
.
list
)
}
private
fun
initLuckyIndexForPid
(
list
:
List
<
NineListBean
.
NineBean
>)
{
if
(
list
!=
null
&&
list
.
size
>
0
)
{
for
(
i
in
0
until
list
.
size
)
{
luckyIndexMap
.
put
(
i
,
list
.
get
(
i
).
pid
?:
i
.
toString
())
}
}
}
override
fun
toTurnSuc
(
data
:
NineListBean
.
NineBean
)
{
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
startNine
(
data
)
},
500
)
}
override
fun
showTurnSuc
(
data
:
NineShowBean
)
{
AppPreferencesManager
.
get
()
.
put
(
Constant
.
LUCKY_FLAG
,
data
.
isShow
)
nineShowBean
=
data
if
(
data
.
isShow
)
{
// 加载一次转盘数据
if
(!
isInitLuckyData
)
{
myPresenter
.
getTurnIphoneMsg
()
btn_action
?.
postDelayed
({
yoyo
=
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
1000
).
repeat
(-
1
).
playOn
(
btn_action
)
},
200
)
isInitLuckyData
=
true
}
rl_lucky
.
visibility
=
View
.
VISIBLE
if
(
TextUtils
.
equals
(
carrierType
,
Constant
.
CARRIERTYPE_NINE3
)
&&
data
.
complete
>=
data
.
need
)
{
carrierType
=
Constant
.
CARRIERTYPE_NINE
myPresenter
.
toTurn
()
}
tv_nine_count
.
text
=
"${data.complete}/${data.need}次"
}
else
{
rl_lucky
.
visibility
=
View
.
GONE
}
}
private
fun
luckyAward
()
{
if
(
nineShowBean
!=
null
)
{
if
(
nineShowBean
!!
.
complete
>=
nineShowBean
!!
.
need
)
{
carrierType
=
Constant
.
CARRIERTYPE_NINE3
}
}
AdManager
.
instance
.
showAd
(
requireActivity
(),
carrierType
,
object
:
AdStatusListener
{
var
canFail
=
false
override
fun
adSuccess
()
{
canFail
=
true
}
override
fun
adFail
()
{
if
(
canFail
)
return
showLoading
(
"正在获取视频"
,
false
)
NoPreAdManager
.
loadVideoAd
(
requireActivity
(),
carrierType
,
object
:
AdStatusListener
{
override
fun
adFail
()
{
carrierType
=
Constant
.
CARRIERTYPE_NINE
hideLoading
()
showToast
(
"广告太火爆了,请稍候再试"
)
}
override
fun
adSuccess
()
{
hideLoading
()
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
hideLoading
()
vo
?.
let
{
myPresenter
.
unlock
(
vo
)
}
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
myPresenter
.
unlock
(
vo
)
}
}
})
}
private
fun
startNine
(
data
:
NineListBean
.
NineBean
)
{
if
(
data
.
pid
==
null
)
{
showToast
(
"抽奖产品未配置"
)
return
}
if
(!
lucky_panel
.
isGameRunning
)
{
lucky_panel
.
startGame
()
RxjavaUtil
.
executeRxTask
(
object
:
CommonRxTask
<
String
>(
""
)
{
override
fun
doInIOThread
()
{
Thread
.
sleep
(
3000
)
}
override
fun
doInUIThread
()
{
val
index
=
getLuckyIndex
(
data
.
pid
)
lucky_panel
.
tryToStop
(
index
)
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
},
1500
)
}
})
}
}
private
fun
getLuckyIndex
(
pid
:
String
):
Int
{
if
(
luckyIndexMap
.
size
>
0
)
{
for
((
key
,
value
)
in
luckyIndexMap
)
{
if
(
TextUtils
.
equals
(
pid
,
value
))
{
return
key
}
}
}
return
1
}
// 点击九宫格按钮
private
fun
clickTurn
()
{
if
(
luckyIndexMap
.
size
==
0
)
{
showToast
(
"界面初始异常,请重新进入"
)
return
}
if
(
nineShowBean
!=
null
)
{
if
(
nineShowBean
!!
.
complete
!=
nineShowBean
!!
.
need
)
{
val
luckyFirst
=
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
LUCKY_MY_FIRST
,
false
)
if
(!
luckyFirst
)
{
isTurnLuckyPage
=
true
AppPreferencesManager
.
get
().
put
(
Constant
.
LUCKY_MY_FIRST
,
true
)
return
}
}
}
luckyAward
()
}
// 继续观看逻辑
private
fun
showContinueDialog
()
{
nineShowBean
?.
let
{
NineContinueDialog
(
requireActivity
(),
it
.
need
-
it
.
complete
-
1
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
clickTurn
()
}
}).
show
()
}
}
//----9宫格逻辑--结束--//
private
fun
showAd
()
{
MyExpressManager
.
instance
.
getAdView
(
object
:
ExpressAdCallback
{
override
fun
loadSuccess
(
adView
:
FrameLayout
?)
{
adView
?.
let
{
UIUtils
.
removeFromParent
(
it
)
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
it
)
}
MyExpressManager
.
instance
.
preLoadAd
()
}
override
fun
renderSuccess
(
adView
:
FrameLayout
?):
Boolean
{
adView
?.
let
{
UIUtils
.
removeFromParent
(
it
)
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
it
)
}
MyExpressManager
.
instance
.
preLoadAd
()
return
false
}
override
fun
loadFail
()
{
}
})
}
}
\ No newline at end of file
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
...
...
@@ -36,8 +36,8 @@
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:orientation=
"vertical"
>
<TextView
...
...
@@ -51,9 +51,9 @@
android:textSize=
"16sp"
/>
<LinearLayout
android:layout_marginTop=
"6dp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:orientation=
"horizontal"
>
<TextView
...
...
@@ -81,260 +81,16 @@
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"140dp"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_my_vip"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:background=
"@mipmap/bg_my_vip"
android:orientation=
"vertical"
android:paddingLeft=
"24dp"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_my_vip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"开通VIP会员"
android:textColor=
"#5B1500"
android:textSize=
"22sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_my_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"解锁全部短剧"
android:textColor=
"#5B1500"
/>
<Button
android:id=
"@+id/tv_my_btn"
android:layout_width=
"120dp"
android:layout_height=
"40dp"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/shape_my"
android:text=
"立即开通"
android:textColor=
"#FFEED3"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<RelativeLayout
android:id=
"@+id/rl_lucky"
android:layout_width=
"300dp"
android:layout_height=
"300dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:visibility=
"gone"
>
<com.mints.helivideo.ui.widgets.luckymonkeypanel.LuckyMonkeyPanelView
android:id=
"@+id/lucky_panel"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<RelativeLayout
android:id=
"@+id/btn_action"
android:layout_width=
"82dp"
android:layout_height=
"82dp"
android:layout_centerInParent=
"true"
android:background=
"@mipmap/ic_luckly_btn"
>
<TextView
android:id=
"@+id/tv_nine_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"20dp"
android:text=
"-/-"
android:textColor=
"@color/white"
android:textSize=
"10dp"
></TextView>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"14dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"14dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/shape_bg_mobile"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_my_record"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"15dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"观看记录"
android:textColor=
"@color/black"
android:textSize=
"16sp"
/>
<ImageView
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:padding=
"6dp"
android:src=
"@mipmap/ic_arrow_more"
/>
</LinearLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/my_color_gray"
/>
<LinearLayout
android:id=
"@+id/ll_my_feed"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"15dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"意见反馈"
android:textColor=
"@color/black"
android:textSize=
"16sp"
/>
<ImageView
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:padding=
"6dp"
android:src=
"@mipmap/ic_arrow_more"
/>
</LinearLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/my_color_gray"
/>
<LinearLayout
android:id=
"@+id/ll_my_payrecord"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"15dp"
android:visibility=
"gone"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"取消订阅"
android:textColor=
"@color/black"
android:textSize=
"16sp"
/>
<ImageView
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:padding=
"6dp"
android:src=
"@mipmap/ic_arrow_more"
/>
</LinearLayout>
<View
android:id=
"@+id/line_my_payrecord"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/my_color_gray"
/>
<LinearLayout
android:id=
"@+id/ll_my_setting"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"15dp"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"功能设置"
android:textColor=
"@color/black"
android:textSize=
"16sp"
/>
<ImageView
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:padding=
"6dp"
android:src=
"@mipmap/ic_arrow_more"
/>
</LinearLayout>
<View
android:id=
"@+id/line_my_contactus"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/my_color_gray"
/>
<LinearLayout
android:id=
"@+id/ll_contactus"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"20dp"
android:paddingEnd=
"15dp"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_contact"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"如有问题,请直接联系在线客服\n"
android:textColor=
"@color/black"
/>
<ImageView
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:padding=
"6dp"
android:src=
"@mipmap/ic_arrow_more"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
<
com.mints.helivideo.ui.widgets.RoundRectLayout
android:id=
"@+id/
fl_ad
"
<
androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/
recy_tasks
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_bg_write"
/>
android:layout_height=
"match_parent"
android:background=
"@null"
android:nestedScrollingEnabled=
"false"
android:paddingBottom=
"10dp"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
</LinearLayout>
</ScrollView>
...
...
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