Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
LuckyFarm
Commits
a4ed5af4
Commit
a4ed5af4
authored
Nov 23, 2020
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改任务完成后领取接口
parent
8e3fc437
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
16 deletions
+25
-16
WateringTaskAdpater.kt
app/src/main/java/com/ym/game/adapter/WateringTaskAdpater.kt
+22
-15
WateringRewardPresenter.kt
...ain/java/com/ym/game/presenter/WateringRewardPresenter.kt
+2
-1
SiginDropsPopupwindow.kt
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
+1
-0
No files found.
app/src/main/java/com/ym/game/adapter/WateringTaskAdpater.kt
View file @
a4ed5af4
...
...
@@ -18,6 +18,7 @@ import com.ym.library.utils.LogUtils
import
com.ym.library.utils.Utils
import
com.ym.ddcy.R
import
com.ym.library.module.NewsEntity
import
com.ym.library.module.TaskCompleteEntity
import
com.ym.library.module.WateringTaskEntity
import
com.ym.library.net.GameApiClient
...
...
@@ -54,6 +55,7 @@ class WateringTaskAdpater :
holder
.
imgcoin
.
setImageResource
(
R
.
mipmap
.
icon_popupwater_icon
)
if
(
data
.
description
!=
null
)
{
holder
.
btnProgess
.
visibility
=
View
.
GONE
holder
.
tvTitle
.
text
=
data
.
title
+
" (${data.current_nums}/${data.awardLimit})"
holder
.
tvProgess
.
text
=
data
.
description
}
else
{
holder
.
btnProgess
.
visibility
=
View
.
VISIBLE
...
...
@@ -116,27 +118,32 @@ class WateringTaskAdpater :
// 领取水滴 type:1每日领水 2高额领水
private
fun
getDripTaskReceive
(
type
:
Int
,
data
:
NewsEntity
)
{
GameApiClient
.
gameApi
.
getTask
Receive
(
data
.
sid
,
type
).
compose
(
GameApiClient
.
gameApi
.
getTask
Complete
(
data
.
sid
).
compose
(
RxSchedulers
.
observableIO2Main
()
).
subscribe
(
object
:
BaseObserver
<
Any
>()
{
override
fun
onSuccess
(
result
:
Any
?)
{
RxBusUtil
.
getDefault
()
.
send
(
RxBusConstant
.
RX_MAIN_WATER_DROP_UPDATE
)
if
(
result
!=
null
)
{
LogUtils
.
i
(
"WateringTaskAdpater"
,
"水滴领取"
+
result
)
var
adType
=
""
if
(
type
==
1
)
{
adType
=
"每日"
}
else
if
(
type
==
2
)
{
adType
=
"高额"
).
subscribe
(
object
:
BaseObserver
<
TaskCompleteEntity
>()
{
override
fun
onSuccess
(
result
:
TaskCompleteEntity
?)
{
RxBusUtil
.
getDefault
()
.
send
(
RxBusConstant
.
RX_MAIN_WATER_DROP_UPDATE
)
if
(
result
!=
null
)
{
LogUtils
.
i
(
"WateringTaskAdpater"
,
"水滴领取"
+
result
)
var
adType
=
""
if
(
type
==
1
)
{
adType
=
"每日"
}
else
if
(
type
==
2
)
{
adType
=
"高额"
}
MainDialog
.
showgetWaterDrop
(
mContext
,
4
,
"task_coins"
,
data
.
awardCoins
!!
,
null
)
}
MainDialog
.
showgetWaterDrop
(
mContext
,
4
,
"task_coins"
,
data
.
awardCoins
!!
,
null
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
}
})
}
/**
...
...
app/src/main/java/com/ym/game/presenter/WateringRewardPresenter.kt
View file @
a4ed5af4
...
...
@@ -75,7 +75,8 @@ class WateringRewardPresenter : WateringRewardContract.Presenter {
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
mView
?.
taskListResult
(
null
)
getRrchardDailyTask
()
}
})
}
...
...
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
View file @
a4ed5af4
...
...
@@ -96,6 +96,7 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
@SuppressLint
()
@Subscribe
(
code
=
RxBusConstant
.
RX_MAIN_WATER_DROP_UPDATE
,
threadMode
=
ThreadMode
.
MAIN
)
fun
updateList
()
{
mPresenter
?.
getRrchardDailyTask
()
}
...
...
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