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
8e3fc437
Commit
8e3fc437
authored
Nov 23, 2020
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改任务列表逻辑,添加金币音效
parent
8488af22
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
256 additions
and
96 deletions
+256
-96
collect.mp3
app/src/main/assets/collect.mp3
+0
-0
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+52
-9
CashExchangeAdapter.kt
app/src/main/java/com/ym/game/adapter/CashExchangeAdapter.kt
+2
-2
WateringTaskAdpater.kt
app/src/main/java/com/ym/game/adapter/WateringTaskAdpater.kt
+15
-14
WateringRewardContract.kt
.../main/java/com/ym/game/contract/WateringRewardContract.kt
+3
-0
WateringRewardPresenter.kt
...ain/java/com/ym/game/presenter/WateringRewardPresenter.kt
+34
-7
MainDialog.kt
app/src/main/java/com/ym/game/view/MainDialog.kt
+4
-4
PuzzleDialog.kt
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
+21
-1
SiginDropsPopupwindow.kt
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
+83
-36
icon_puzzle_title.png
app/src/main/res/drawable-xhdpi/icon_puzzle_title.png
+0
-0
icon_sure.png
app/src/main/res/drawable-xhdpi/icon_sure.png
+0
-0
activity_welfare.xml
app/src/main/res/layout/activity_welfare.xml
+1
-1
dialog_get_puzzle.xml
app/src/main/res/layout/dialog_get_puzzle.xml
+2
-2
item_watering_task.xml
app/src/main/res/layout/item_watering_task.xml
+5
-6
splash_layout.xml
app/src/main/res/layout/splash_layout.xml
+21
-11
NewsEntity.kt
library/src/main/java/com/ym/library/module/NewsEntity.kt
+4
-3
IGameApi.kt
library/src/main/java/com/ym/library/net/IGameApi.kt
+7
-0
NetConfig.java
library/src/main/java/com/ym/library/net/NetConfig.java
+2
-0
No files found.
app/src/main/assets/collect.mp3
0 → 100644
View file @
8e3fc437
File added
app/src/main/java/com/ym/game/GameActivity.kt
View file @
8e3fc437
...
...
@@ -27,6 +27,8 @@ import com.ym.library.net.ApiClient
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.GameApiClient
import
com.ym.library.net.RxSchedulers
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.utils.*
import
com.ym.modulecommon.module.UserInfoEntity
import
io.reactivex.Observable
...
...
@@ -220,15 +222,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
})
}
private
var
isclick
=
false
/**
* 兑换现金
*/
fun
cashExchange
()
{
MainLooper
.
get
()
?.
post
(
Runnable
{
if
(
Utils
.
isFastClick2
())
{
CashExchangeDialog
.
showCashExchage
(
this
,
this
)
}
})
if
(!
isclick
){
isclick
=
true
MainLooper
.
get
()
?.
post
(
Runnable
{
CashExchangeDialog
.
showCashExchage
(
this
,
this
)
})
MainLooper
.
get
()
?.
postDelayed
(
Runnable
{
isclick
=
false
},
2000
)
}
}
/**
...
...
@@ -358,10 +366,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override
fun
onSuccess
(
result
:
List
<
LandListEntity
>?)
{
var
json
=
"{\"landList\":"
+
Utils
.
obj2Str
(
result
)
+
"}"
Log
.
d
(
"Wxw"
,
"初始化地块列表成功$from$json"
)
if
(
from
==
1
)
{
if
(
from
==
1
)
{
callUnity
(
"Canvas"
,
"loadLandListSuccess"
,
json
)
}
if
(
from
==
2
){
if
(
from
==
2
)
{
callUnity
(
"Form_land"
,
"sycnLandListSuccess"
,
json
)
}
}
...
...
@@ -587,6 +595,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
})
}
//加速剂
fun
getUseAcceleratorsSync
(
id
:
Int
)
{
GameApiClient
.
gameApi
.
getUseAccelerators
(
id
).
compose
(
RxSchedulers
.
observableIO2Main
())
...
...
@@ -600,6 +609,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
})
}
//金币购买种子
fun
getBuySeed
(
callback
:
IUnitySendMessageCallback
?,
id
:
Int
)
{
GameApiClient
.
gameApi
.
getBuySeed
(
id
).
compose
(
RxSchedulers
.
observableIO2Main
())
...
...
@@ -716,6 +726,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
})
}
}
//看视频领取种子 本地处理 新
fun
getVideoSeedReceiveNew
(
id
:
Int
)
{
if
(
videoSeedClick
)
{
...
...
@@ -726,13 +737,14 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
object
:
IAdVideoListener
{
override
fun
onAdClose
()
{
videoSeedClick
=
true
callUnity
(
"Form_land"
,
"onVideoSeedReceiveSuccess"
,
""
+(
id
-
1
))
callUnity
(
"Form_land"
,
"onVideoSeedReceiveSuccess"
,
""
+
(
id
-
1
))
GameApiClient
.
gameApi
.
getVideoSeedReceive
(
id
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
override
fun
onSuccess
(
result
:
StatusEntity
?)
{
Log
.
d
(
"wxw"
,
"看视频领取种子同步"
+
Utils
.
obj2Str
(
result
))
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
...
...
@@ -767,7 +779,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
override
fun
onSuccess
(
result
:
StatusEntity
?)
{
result
?.
id
=
id
result
?.
id
=
id
Log
.
d
(
"wxw"
,
"看视频领取加速剂"
+
Utils
.
obj2Str
(
result
))
callback
?.
onIncrVideoAcceleratorsSuccess
(
true
,
...
...
@@ -953,4 +965,35 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
})
}
//
fun
duihuan
(
id
:
Int
,
jine
:
String
)
{
GameApiClient
.
gameApi
.
dowd
(
id
).
compose
(
RxSchedulers
.
observableIO2Main
()
).
subscribe
(
object
:
BaseObserver
<
ExchangeEntity
>()
{
override
fun
onSuccess
(
result
:
ExchangeEntity
?)
{
if
(
result
!=
null
)
{
MainDialog
?.
showWithDraw
(
this
@GameActivity
,
result
?.
status
?:
0
,
result
?.
title
?:
""
,
result
?.
reason
?:
""
,
result
?.
buttonText
?:
""
,
result
?.
buttonStatus
?:
0
,
id
,
2
,
jine
,
true
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
Utils
.
showToast
(
mContext
,
""
+
errorMsg
)
}
})
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/adapter/CashExchangeAdapter.kt
View file @
8e3fc437
...
...
@@ -62,7 +62,7 @@ class CashExchangeAdapter :
holder
.
item_duihuan
?.
addClickScale
()
holder
.
item_duihuan
?.
setOnClickListener
{
if
(
Utils
.
isFastClick2
())
{
duihuan
(
bean
.
id
,
bean
.
type
!!
,
bean
.
cash
)
duihuan
(
bean
.
id
,
bean
.
type
!!
,
bean
.
cash
Str
)
if
(
bean
.
type
==
1
)
{
EventUtils
.
onEvent
(
"click_xinshou0.3"
,
"新手0.3"
)
}
else
if
(
bean
.
type
==
4
)
{
...
...
@@ -90,7 +90,7 @@ class CashExchangeAdapter :
}
}
fun
duihuan
(
id
:
Int
,
type
:
Int
,
jine
:
Int
)
{
fun
duihuan
(
id
:
Int
,
type
:
Int
,
jine
:
String
)
{
GameApiClient
.
gameApi
.
dowd
(
id
).
compose
(
RxSchedulers
.
observableIO2Main
()
...
...
app/src/main/java/com/ym/game/adapter/WateringTaskAdpater.kt
View file @
8e3fc437
...
...
@@ -17,6 +17,7 @@ import com.ym.library.rxbus.RxBusUtil
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.WateringTaskEntity
import
com.ym.library.net.GameApiClient
...
...
@@ -25,16 +26,16 @@ import com.ym.library.net.GameApiClient
*Craeted by 2020/9/12
*/
class
WateringTaskAdpater
:
BaseRecyclerAdapter
<
WateringTask
Entity
,
WateringTaskAdpater
.
WateringTaskHolder
>
{
BaseRecyclerAdapter
<
News
Entity
,
WateringTaskAdpater
.
WateringTaskHolder
>
{
private
var
type
:
Int
=
-
1
private
var
mContext
:
Activity
?
=
null
private
val
listener
:
OnRecycleItemClickListener
<
WateringTask
Entity
>
private
val
listener
:
OnRecycleItemClickListener
<
News
Entity
>
constructor
(
content
:
Activity
?,
type
:
Int
,
listener
:
OnRecycleItemClickListener
<
WateringTask
Entity
>
listener
:
OnRecycleItemClickListener
<
News
Entity
>
)
:
super
()
{
this
.
listener
=
listener
mContext
=
content
...
...
@@ -49,24 +50,24 @@ class WateringTaskAdpater :
if
(
mList
.
size
>
0
)
{
val
data
=
mList
[
position
]
holder
.
tvTitle
.
text
=
data
.
title
holder
.
tvCount
.
text
=
"+${data.award
Num
}"
holder
.
tvCount
.
text
=
"+${data.award
Coins
}"
holder
.
imgcoin
.
setImageResource
(
R
.
mipmap
.
icon_popupwater_icon
)
if
(
data
.
subTitle
!=
null
)
{
if
(
data
.
description
!=
null
)
{
holder
.
btnProgess
.
visibility
=
View
.
GONE
holder
.
tvProgess
.
text
=
data
.
subTitle
holder
.
tvProgess
.
text
=
data
.
description
}
else
{
holder
.
btnProgess
.
visibility
=
View
.
VISIBLE
holder
.
btnProgess
.
max
=
data
.
targetNum
holder
.
btnProgess
.
setProgress
(
data
.
c
ompletedNum
)
holder
.
tvProgess
.
text
=
"${data.c
ompletedNum}/${data.targetNum
}"
holder
.
btnProgess
.
max
=
data
.
awardLimit
!!
holder
.
btnProgess
.
setProgress
(
data
.
c
urrent_nums
!!
)
holder
.
tvProgess
.
text
=
"${data.c
urrent_nums}/${data.awardLimit
}"
}
holder
.
ivStatus
.
addClickScale
()
holder
.
ivStatus
.
setOnClickListener
{
if
(
Utils
.
isFastClick
())
{
when
(
data
.
status
)
{
0
->
listener
.
onItemClick
(
it
,
position
,
mList
[
position
])
0
->
listener
.
onItemClick
(
it
,
position
,
mList
[
position
])
1
->
Utils
.
showToast
(
mContext
,
"您已经领过了哦~"
)
//领取
2
->
getDripTaskReceive
(
type
,
data
)
...
...
@@ -114,8 +115,8 @@ class WateringTaskAdpater :
}
// 领取水滴 type:1每日领水 2高额领水
private
fun
getDripTaskReceive
(
type
:
Int
,
data
:
WateringTask
Entity
)
{
GameApiClient
.
gameApi
.
getTaskReceive
(
data
.
id
,
type
).
compose
(
private
fun
getDripTaskReceive
(
type
:
Int
,
data
:
News
Entity
)
{
GameApiClient
.
gameApi
.
getTaskReceive
(
data
.
s
id
,
type
).
compose
(
RxSchedulers
.
observableIO2Main
()
).
subscribe
(
object
:
BaseObserver
<
Any
>()
{
override
fun
onSuccess
(
result
:
Any
?)
{
...
...
@@ -130,7 +131,7 @@ class WateringTaskAdpater :
adType
=
"高额"
}
MainDialog
.
showgetWaterDrop
(
mContext
,
4
,
"task_coins"
,
data
.
award
Num
,
null
)
MainDialog
.
showgetWaterDrop
(
mContext
,
4
,
"task_coins"
,
data
.
award
Coins
!!
,
null
)
}
}
...
...
app/src/main/java/com/ym/game/contract/WateringRewardContract.kt
View file @
8e3fc437
package
com.ym.game.contract
import
com.ym.library.module.SinginEntity
import
com.ym.library.module.TaskListEntity
import
com.ym.library.module.WateringTaskEntity
...
...
@@ -13,10 +14,12 @@ class WateringRewardContract {
interface
View
{
fun
rchardDailyTaskResult
(
datas
:
List
<
WateringTaskEntity
>)
fun
rchardSignTaskResult
(
datas
:
SinginEntity
)
fun
taskListResult
(
result
:
TaskListEntity
?)
}
interface
Presenter
{
fun
getRrchardDailyTask
()
fun
getOrchardSignTask
()
fun
getTaskComplete
(
sid
:
Int
)
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/presenter/WateringRewardPresenter.kt
View file @
8e3fc437
package
com.ym.game.presenter
import
com.ym.game.contract.WateringRewardContract
import
com.ym.library.module.NewsEntity
import
com.ym.library.module.SinginEntity
import
com.ym.library.module.TaskListEntity
import
com.ym.library.module.WateringTaskEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.GameApiClient
...
...
@@ -22,16 +24,27 @@ class WateringRewardPresenter : WateringRewardContract.Presenter {
//每日水滴任务
override
fun
getRrchardDailyTask
()
{
GameApiClient
.
gameApi
.
getOrchardDailyTask
().
compose
(
// GameApiClient.gameApi.getOrchardDailyTask().compose(
// RxSchedulers.observableIO2Main()
// ).subscribe(object : BaseObserver<List<WateringTaskEntity>>() {
// override fun onSuccess(result: List<WateringTaskEntity>?) {
// if (result != null) {
// mView?.rchardDailyTaskResult(result)
// }
// }
//
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
// })
GameApiClient
.
gameApi
.
getTaskListInfo
(
"coin_task_list"
).
compose
(
RxSchedulers
.
observableIO2Main
()
).
subscribe
(
object
:
BaseObserver
<
List
<
WateringTaskEntity
>>()
{
override
fun
onSuccess
(
result
:
List
<
WateringTaskEntity
>?)
{
if
(
result
!=
null
)
{
mView
?.
rchardDailyTaskResult
(
result
)
}
).
subscribe
(
object
:
BaseObserver
<
TaskListEntity
>()
{
override
fun
onSuccess
(
result
:
TaskListEntity
?)
{
mView
?.
taskListResult
(
result
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
mView
?.
taskListResult
(
null
)
}
})
}
...
...
@@ -53,5 +66,19 @@ class WateringRewardPresenter : WateringRewardContract.Presenter {
})
}
override
fun
getTaskComplete
(
sid
:
Int
)
{
GameApiClient
.
gameApi
.
getTaskCompleteReport
(
sid
).
compose
(
RxSchedulers
.
observableIO2Main
()
).
subscribe
(
object
:
BaseObserver
<
NewsEntity
>()
{
override
fun
onSuccess
(
result
:
NewsEntity
?)
{
getRrchardDailyTask
()
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
mView
?.
taskListResult
(
null
)
}
})
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/view/MainDialog.kt
View file @
8e3fc437
...
...
@@ -419,7 +419,7 @@ object MainDialog {
buttonStatus
:
Int
,
id
:
Int
?,
type
:
Int
?,
jine
:
Int
?,
jine
:
String
?,
isWelfarePage
:
Boolean
)
{
...
...
@@ -512,9 +512,9 @@ object MainDialog {
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
id_img_dialog_close
).
setOnClickListener
{
mDialog
.
dismiss
()
}
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
setCancelable
(
false
)
mDialog
.
show
()
mDialog
?
.
setCanceledOnTouchOutside
(
false
)
mDialog
?
.
setCancelable
(
false
)
mDialog
?
.
show
()
}
fun
showActivityDesc
(
activity
:
Activity
)
{
...
...
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
View file @
8e3fc437
...
...
@@ -6,8 +6,10 @@ import android.animation.ValueAnimator
import
android.app.Activity
import
android.app.Dialog
import
android.content.Context
import
android.content.res.AssetFileDescriptor
import
android.graphics.Path
import
android.graphics.PathMeasure
import
android.media.MediaPlayer
import
android.util.Log
import
android.view.Gravity
import
android.view.View
...
...
@@ -145,6 +147,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
lottieView
?.
setAnimation
(
"puzzle/data.json"
)
lottieView
?.
setRepeatCount
(
1
)
lottieView
?.
playAnimation
()
playSound
(
"collect.mp3"
)
lottieView
?.
addAnimatorUpdateListener
(
ValueAnimator
.
AnimatorUpdateListener
{
valueAnimator
->
// 判断动画加载结束
if
(
valueAnimator
.
animatedFraction
==
1f
)
{
lottieView
?.
visibility
=
View
.
GONE
...
...
@@ -336,7 +339,24 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
}
}
/**
* 播放音效
*/
private
fun
playSound
(
fileName
:
String
)
{
val
fd
:
AssetFileDescriptor
?
=
context
?.
assets
?.
openFd
(
fileName
)
val
mMediaPlayer
=
MediaPlayer
()
mMediaPlayer
?.
setDataSource
(
fd
?.
fileDescriptor
,
fd
?.
startOffset
!!
,
fd
.
length
)
mMediaPlayer
?.
prepareAsync
()
mMediaPlayer
?.
setOnPreparedListener
{
mMediaPlayer
?.
start
()
}
mMediaPlayer
?.
setOnCompletionListener
{
try
{
mMediaPlayer
?.
stop
()
mMediaPlayer
?.
release
()
}
catch
(
e
:
java
.
lang
.
Exception
)
{}
}
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
View file @
8e3fc437
...
...
@@ -20,7 +20,6 @@ import com.ym.game.adapter.WateringTaskAdpater
import
com.ym.game.contract.WateringRewardContract
import
com.ym.game.presenter.WateringRewardPresenter
import
com.ym.library.Constant
import
com.ym.library.module.NewsEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
import
com.ym.library.rxbus.RxBusConstant
...
...
@@ -29,9 +28,7 @@ import com.ym.library.rxbus.Subscribe
import
com.ym.library.rxbus.ThreadMode
import
com.ym.ddcy.R
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.SinginEntity
import
com.ym.library.module.StatusEntity
import
com.ym.library.module.WateringTaskEntity
import
com.ym.library.module.*
import
com.ym.library.net.GameApiClient
import
com.ym.library.utils.*
...
...
@@ -41,7 +38,7 @@ import com.ym.library.utils.*
* 每日水滴
*/
class
SiginDropsPopupwindow
:
PopupWindow
(),
WateringRewardContract
.
View
,
OnRecycleItemClickListener
<
WateringTask
Entity
>
{
OnRecycleItemClickListener
<
News
Entity
>
{
private
val
TAG
=
"Popupwindow"
private
var
mListener
:
IDialogViewCloseCallback
?
=
null
private
var
view
:
View
?
=
null
...
...
@@ -102,49 +99,93 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
mPresenter
?.
getRrchardDailyTask
()
}
override
fun
onItemClick
(
view
:
View
,
position
:
Int
,
data
:
WateringTask
Entity
)
{
override
fun
onItemClick
(
view
:
View
,
position
:
Int
,
data
:
News
Entity
)
{
// 0未完成 1已领取 2可领取
when
(
data
.
status
)
{
0
->
{
// 跳转页面 1转盘 2高额水滴任务 3首页 4激励视频 直客任务链接"
when
(
data
.
reference
)
{
1
->
{
// if()
// appmodel_id
// 应用类模块跳转 跳转到多多菜园首页 65
//应用类模块跳转到多多菜园转盘抽奖 63
//应用类模块跳转到多多菜园开宝箱 64
//应用类模块跳转到多多菜园福利中心 66
if
(
data
.
opentype
==
7
)
{
if
(
data
.
appmodel_id
==
65
)
{
dismiss
()
}
else
if
(
data
.
appmodel_id
==
63
)
{
dismiss
()
TurntableDialog
.
showTurntable
(
mContext
,
mListener
!!
)
}
2
->
{
}
else
if
(
data
.
appmodel_id
==
64
)
{
dismiss
()
// WateringTaskPopupwindow().init(mContext)
}
3
->
dismiss
()
6
->
{
}
else
if
(
data
.
appmodel_id
==
66
)
{
dismiss
()
JumpUtils
.
jumpWelfareActivity
()
// JumpUtils.h5Jump(
// "每日福利",
// Constant.Param.WelfareCenter,
// false,
// mContext as Activity
// )
}
4
->
{
EventUtils
.
onEvent
(
"click_receive_coin_task_video_btn"
,
"领金币任务视频"
)
AdUtils
.
playRewardAd
((
mContext
as
Activity
),
"receive_coin_task"
,
object
:
IAdVideoListener
{
override
fun
onAdClose
()
{
}
override
fun
onError
(
errorMsg
:
String
?)
{
}
})
}
else
if
(
data
.
opentype
==
1
)
{
if
(
data
.
sid
!=
null
)
{
EventUtils
.
onEvent
(
"welfare_task_undone_click"
,
"${data.sid}"
)
showAd
(
data
.
sid
)
}
else
{
JumpUtils
.
adJump
(
data
,
mContext
)
}
}
else
if
(
data
.
opentype
==
2
){
//直客链接
JumpUtils
.
adJump
(
data
,
(
mContext
as
Activity
))
}
// when (data.opentype) {
//
// 1 -> {
//
// }
// 2 -> {
// dismiss()
// // WateringTaskPopupwindow().init(mContext)
// }
// 3 -> dismiss()
// 6 -> {
//
//// JumpUtils.h5Jump(
//// "每日福利",
//// Constant.Param.WelfareCenter,
//// false,
//// mContext as Activity
//// )
// }
// 4 -> {
// EventUtils.onEvent("click_receive_coin_task_video_btn", "领金币任务视频")
//
// AdUtils.playRewardAd((mContext as Activity),"receive_coin_task",object : IAdVideoListener {
// override fun onAdClose() {
//
// }
//
// override fun onError(errorMsg: String?) {
//
// }
// })
// }
//
// }
}
}
}
fun
showAd
(
sId
:
Int
)
{
AdUtils
.
playRewardAd
(
mContext
as
Activity
,
"home_task"
,
object
:
IAdVideoListener
{
override
fun
onAdClose
()
{
mPresenter
?.
getTaskComplete
(
sId
)
}
override
fun
onError
(
errorMsg
:
String
?)
{
}
})
}
//签到
override
fun
rchardSignTaskResult
(
data
:
SinginEntity
)
{
...
...
@@ -165,14 +206,20 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
}
//每日水滴任务列表
override
fun
rchardDailyTaskResult
(
datas
:
List
<
WateringTaskEntity
>)
{
LogUtils
.
i
(
TAG
,
"每日水滴任务列表"
)
override
fun
taskListResult
(
result
:
TaskListEntity
?)
{
wateringTaskAdpater
?.
clear
()
wateringTaskAdpater
?.
appendToList
(
datas
)
wateringTaskAdpater
?.
appendToList
(
result
?.
userTask
)
wateringTaskAdpater
?.
notifyDataSetChanged
()
}
//每日水滴任务列表
override
fun
rchardDailyTaskResult
(
datas
:
List
<
WateringTaskEntity
>)
{
// wateringTaskAdpater?.clear()
// wateringTaskAdpater?.appendToList(datas)
// wateringTaskAdpater?.notifyDataSetChanged()
}
override
fun
dismiss
()
{
mListener
?.
onCloseViewSuccess
(
true
)
super
.
dismiss
()
...
...
app/src/main/res/drawable-xhdpi/icon_puzzle_title.png
View replaced file @
8488af22
View file @
8e3fc437
21 KB
|
W:
|
H:
33.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/drawable-xhdpi/icon_sure.png
View replaced file @
8488af22
View file @
8e3fc437
27.7 KB
|
W:
|
H:
28.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/layout/activity_welfare.xml
View file @
8e3fc437
...
...
@@ -29,7 +29,7 @@
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:paddingBottom=
"8dp"
android:text=
"
福利中心
"
android:text=
"
每日福利
"
android:textColor=
"@color/color_333333"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
...
...
app/src/main/res/layout/dialog_get_puzzle.xml
View file @
8e3fc437
...
...
@@ -82,7 +82,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:text=
"个碎片就
可以
完成拼图了"
android:text=
"个碎片就完成拼图了"
android:textColor=
"#6A231A"
android:textSize=
"17sp"
/>
</LinearLayout>
...
...
@@ -90,7 +90,7 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"看
一次视频即可获得一个
碎片哦!"
android:text=
"看
视频可以获得
碎片哦!"
android:textColor=
"#6A231A"
android:textSize=
"17sp"
/>
...
...
app/src/main/res/layout/item_watering_task.xml
View file @
8e3fc437
...
...
@@ -49,16 +49,15 @@
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"150dp"
android:layout_height=
"8dp"
android:layout_marginRight=
"
4
dp"
android:layout_marginRight=
"
12
dp"
android:progressDrawable=
"@drawable/user_progressbar_bg"
/>
<TextView
android:id=
"@+id/tv_watering_item_progess"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_8"
android:includeFontPadding=
"false"
android:text=
"1"
android:text=
"
22
1"
android:textColor=
"#8F6E42"
android:textSize=
"16sp"
/>
</LinearLayout>
...
...
@@ -70,13 +69,13 @@
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_marginRight=
"@dimen/dp_
30
"
android:layout_marginRight=
"@dimen/dp_
25
"
android:gravity=
"center"
>
<ImageView
android:id=
"@+id/img_icon_item"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
@dimen/dp_22
"
android:layout_height=
"
@dimen/dp_22
"
android:layout_marginRight=
"@dimen/dp_3"
/>
<TextView
...
...
app/src/main/res/layout/splash_layout.xml
View file @
8e3fc437
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<FrameLayout
android:id=
"@+id/splash_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<TextView
android:id=
"@+id/tv_skipview"
android:text=
"跳过"
android:gravity=
"center"
android:padding=
"3dp"
android:visibility=
"gone"
android:layout_marginRight=
"20dp"
android:layout_marginTop=
"40dp"
android:layout_width=
"96dp"
android:layout_height=
"wrap_content"
android:layout_alignParentTop=
"true"
android:layout_alignParentRight=
"true"
android:layout_marginTop=
"40dp"
android:layout_marginRight=
"20dp"
android:background=
"@drawable/drawable_skip_view"
android:layout_width=
"96dp"
android:gravity=
"center"
android:padding=
"3dp"
android:text=
"跳过"
android:textColor=
"@android:color/white"
android:
layout_height=
"wrap_content"
/>
android:
visibility=
"gone"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:background=
"@color/white"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:src=
"@drawable/logo"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
library/src/main/java/com/ym/library/module/NewsEntity.kt
View file @
8e3fc437
...
...
@@ -12,6 +12,7 @@ class NewsEntity : Serializable {
var
reqId
:
String
?
=
""
var
slotName
:
String
?
=
""
// video
var
slotId
:
String
?
=
""
//
var
awardLimit
:
Int
?=
0
var
codeId
:
String
?
=
""
//拉取SDK广告用codeId
var
codeAppId
:
String
?
=
""
//
var
sdkRenderType
=
0
// 广告渲染类型 1. 自渲染 2.模板渲染
...
...
@@ -41,7 +42,7 @@ class NewsEntity : Serializable {
var
duration
:
String
?
=
""
//视频时长
var
appComments
:
String
?
=
""
//视频时长
var
awardCoins
:
String
?
=
""
//视频时长
var
awardCoins
:
Int
?
=
0
//视频时长
var
appScore
:
Int
?
=
0
var
isDowanloaded
:
Boolean
=
false
var
closeViewType
:
Int
?
=
0
...
...
@@ -63,13 +64,13 @@ class NewsEntity : Serializable {
var
timeTrigger
:
String
?
=
""
var
templateId
:
Int
?
=
7
// 广告类型
var
current_nums
:
String
?
=
""
var
current_nums
:
Int
?
=
0
var
source
:
String
?
=
""
var
award_limit
:
String
?
=
""
var
sourceUrl
:
String
?
=
""
var
url
:
String
?
=
""
var
title
:
String
?
=
""
var
description
:
String
?
=
""
var
description
:
String
?
=
null
var
pubDate
:
String
?
=
""
var
images
:
List
<
String
>?
=
null
var
icon_url
:
String
?
=
null
...
...
library/src/main/java/com/ym/library/net/IGameApi.kt
View file @
8e3fc437
...
...
@@ -339,4 +339,11 @@ interface IGameApi {
*/
@GET
(
NetConfig
.
Game
.
URL_GAME_HOME_WD_LIST
)
fun
getHomeWList
():
Observable
<
Response
<
List
<
HomeListEntity
>>>
/**
* 看领金币视频任务
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_VIDEO_TASK_COMPLETE
)
fun
getTaskCompleteReport
(
@Query
(
"sid"
)
sid
:
Int
):
Observable
<
Response
<
NewsEntity
>>
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/NetConfig.java
View file @
8e3fc437
...
...
@@ -270,5 +270,7 @@ public class NetConfig {
public
static
final
String
URL_COLLECT_CARD_ADD_CARD
=
"app/v1/collect-card/addCard"
;
//收金币获得卡片
public
static
final
String
URL_GAME_HOME_WD_LIST
=
"app/v1/game/ddcy/home_wd_list"
;
//首页展示果实列表
public
static
final
String
URL_CLOCK_BOX_RECEIVE
=
"app/v1/game/ddcy/clock_box_receive"
;
//打卡普通打卡任务领取
public
static
final
String
URL_GAME_VIDEO_TASK_COMPLETE
=
"app/v1/game/video_task_complete"
;
//看领金币视频任务
}
}
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