Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
3dd5e131
Commit
3dd5e131
authored
Oct 16, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
e983a04d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
22 deletions
+40
-22
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+2
-2
HomePresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
+4
-0
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+1
-1
DrawcashAdapter.kt
...in/java/com/mints/goodmoney/ui/adapter/DrawcashAdapter.kt
+1
-1
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+32
-18
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
3dd5e131
...
...
@@ -102,7 +102,6 @@ object Constant {
const
val
CHALLENGE_SHAREFRIEND
=
"CHALLENGE_SHAREFRIEND"
//邀请好友
const
val
AD_SOURCE_CSJ
=
"CSJ"
const
val
AD_SOURCE_YLH
=
"YLH"
...
...
@@ -134,12 +133,13 @@ object Constant {
const
val
HOT_ACTIVITY_WATER
=
"water"
const
val
HOT_ACTIVITY_WALK
=
"walk"
const
val
HOT_ACTIVITY_CARD
=
"card"
// 打开激活
const
val
FIRST_DEVICE_FLAG
=
"first_device_flag"
// share
const
val
SHARE_TITLE
=
"当下流行的赚钱模式,边看边玩边赚钱"
var
SHARE_CONTENT
=
"邀请码【${UserManager.getInstance().codeID}】,共享新模式,快来加入跟我一起赚钱吧"
var
SHARE_URL
:
String
=
BuildConfig
.
MainIp
+
"share/shareFriend.html?
channel="
+
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
var
SHARE_URL
:
String
=
BuildConfig
.
MainIp
+
"share/shareFriend.html?ruid="
+
UserManager
.
getInstance
().
getUserID
()
+
"&
channel="
+
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
View file @
3dd5e131
...
...
@@ -130,6 +130,10 @@ class HomePresenter : BasePresenter<HomeView>() {
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
when
(
code
)
{
200
->
getHomeVedioMsg
()
}
}
})
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
3dd5e131
...
...
@@ -64,7 +64,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
startTime
()
when
(
carrierType
)
{
Constant
.
CARRIER_HOMEVEDIO_SMALL
->
{
Constant
.
CARRIER_HOMEVEDIO_SMALL
,
Constant
.
CHALLENGE_SHAREFRIEND
->
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
awardPresenter
.
reportAddCoinMsg
(
vo
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/DrawcashAdapter.kt
View file @
3dd5e131
...
...
@@ -68,8 +68,8 @@ class DrawcashAdapter(val priceList: MutableList<DrawcashBean.CashOutMoneyArrBea
holder
.
tvDrawItemGold
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
grayc
))
holder
.
llDrawItem
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter
)
}
else
{
//当前选中
if
(
getPosition
()
==
position
)
{
//当前选中
holder
.
tvDrawItemCash
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
))
holder
.
tvDrawItemGold
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
))
holder
.
llDrawItem
.
setBackgroundResource
(
R
.
drawable
.
shape_vip_adapter_none
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
3dd5e131
...
...
@@ -96,7 +96,7 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
littleVideoFragment
?.
onResume
()
if
(!
TextUtils
.
isEmpty
(
vedioId
))
{
start
DownloadTime
(
vedioId
)
resume
DownloadTime
(
vedioId
)
}
}
}
...
...
@@ -152,20 +152,24 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
}
override
fun
getHomeVedioMsgSuc
(
data
:
MainVedioMsgBean
)
{
if
(
activity
==
null
||
activity
!!
.
isFinishing
)
{
return
}
smallRewardCoin
=
data
.
smallRewardCoin
bigRewardCoin
=
data
.
bigRewardCoin
ivMainBox
.
visibility
=
if
(
bigRewardCoin
>
0
)
View
.
VISIBLE
else
View
.
GONE
//
ivMainBox.visibility = if (bigRewardCoin > 0) View.VISIBLE else View.GONE
if
(
data
.
isToCreateReward
)
{
// 防止界面切换 重置倒计时
if
(!
cdvvYilanTime
.
isPlaying
)
{
// 第一次能过 isFirstLoadVedio 判断好兔先加载视频
if
(!
isFirstLoadVedio
&&
!
cdvvYilanTime
.
isPlaying
)
{
cdvvYilanTime
?.
reset
()
cdvvYilanTime
?.
start
()
}
}
else
{
// 暂停
isClickStop
=
true
cdvvYilanTime
?.
stop
()
stopDownloadTime
()
}
}
...
...
@@ -191,14 +195,14 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
override
fun
onVideoAdPaused
(
entity
:
AdEntity
?)
{
LogUtil
.
d
(
TAG
,
"override onVideoAdPaused"
)
//
stop
DownloadTime()
//
pause
DownloadTime()
}
override
fun
onVideoAdComplete
(
entity
:
AdEntity
?)
{
LogUtil
.
d
(
TAG
,
"override onVideoAdComplete"
)
// addVedioIdList(entity?.reqId!!)
//
stop
DownloadTime()
//
pause
DownloadTime()
}
override
fun
onVideoAdStartPlay
(
entity
:
AdEntity
?)
{
...
...
@@ -209,7 +213,7 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
LogUtil
.
d
(
TAG
,
"override onVideoError"
)
LogUtil
.
d
(
"MainFragment"
,
"code:${code} entity:${entity?.toString()}"
)
//
stop
DownloadTime()
//
pause
DownloadTime()
}
override
fun
onVideoAdContinuePlay
(
entity
:
AdEntity
?)
{
...
...
@@ -254,24 +258,24 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
com
.
yilan
.
sdk
.
player
.
utils
.
Constant
.
STATE_ERROR
->
{
LogUtil
.
d
(
TAG
,
"type STATE_ERROR"
)
stop
DownloadTime
()
pause
DownloadTime
()
}
com
.
yilan
.
sdk
.
player
.
utils
.
Constant
.
STATE_PLAYING
->
{
LogUtil
.
d
(
TAG
,
"type STATE_PLAYING"
)
start
DownloadTime
(
data
.
videoId
)
resume
DownloadTime
(
data
.
videoId
)
}
com
.
yilan
.
sdk
.
player
.
utils
.
Constant
.
STATE_COMPLETE
->
{
LogUtil
.
d
(
TAG
,
"type STATE_COMPLETE"
)
addVedioIdList
(
data
.
videoId
)
stop
DownloadTime
()
pause
DownloadTime
()
}
com
.
yilan
.
sdk
.
player
.
utils
.
Constant
.
STATE_PAUSED
->
{
LogUtil
.
d
(
TAG
,
"type STATE_PAUSED"
)
stop
DownloadTime
()
pause
DownloadTime
()
}
}
false
...
...
@@ -301,7 +305,7 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
/**
* 倒计时红包暂停
*/
private
fun
stop
DownloadTime
()
{
private
fun
pause
DownloadTime
()
{
isClickStop
=
true
cdvvYilanTime
?.
pause
()
}
...
...
@@ -309,10 +313,10 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
/**
*用户主动暂时或网络异常结束后 重新加载倒计时红包
*/
private
fun
start
DownloadTime
(
id
:
String
)
{
private
fun
resume
DownloadTime
(
id
:
String
)
{
if
(!
TextUtils
.
isEmpty
(
id
))
{
LogUtil
.
d
(
TAG
,
"
start
DownloadTime cur id:"
+
id
)
LogUtil
.
d
(
TAG
,
"
start
DownloadTime ListItem:"
+
JsonUtil
.
toJson
(
vedioIdList
))
LogUtil
.
d
(
TAG
,
"
resume
DownloadTime cur id:"
+
id
)
LogUtil
.
d
(
TAG
,
"
resume
DownloadTime ListItem:"
+
JsonUtil
.
toJson
(
vedioIdList
))
if
(
vedioIdList
.
contains
(
id
))
{
cdvvYilanTime
?.
pause
()
return
...
...
@@ -325,6 +329,15 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
}
}
/**
* 停止转动
*/
private
fun
stopDownloadTime
()
{
// 暂停
isClickStop
=
true
cdvvYilanTime
?.
stop
()
}
/**
* 红包倒计时初始化
*/
...
...
@@ -332,7 +345,8 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
cdvvYilanTime
.
setCountDownVedioListener
(
object
:
CountDownVedioView
.
CountDownVedioListener
{
override
fun
finish
()
{
cdvvYilanTime
?.
showRedbox
()
cdvvYilanTime
?.
stopStatus
()
stopDownloadTime
()
homePresenter
.
requestAddHomeVedioReward
()
}
})
...
...
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