Commit 8e3fc437 authored by maxiaoliang's avatar maxiaoliang

修改任务列表逻辑,添加金币音效

parent 8488af22
...@@ -27,6 +27,8 @@ import com.ym.library.net.ApiClient ...@@ -27,6 +27,8 @@ import com.ym.library.net.ApiClient
import com.ym.library.net.BaseObserver import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers 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.library.utils.*
import com.ym.modulecommon.module.UserInfoEntity import com.ym.modulecommon.module.UserInfoEntity
import io.reactivex.Observable import io.reactivex.Observable
...@@ -220,15 +222,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -220,15 +222,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
} }
private var isclick = false
/** /**
* 兑换现金 * 兑换现金
*/ */
fun cashExchange() { fun cashExchange() {
if(!isclick){
isclick = true
MainLooper.get()?.post(Runnable { MainLooper.get()?.post(Runnable {
if (Utils.isFastClick2()) {
CashExchangeDialog.showCashExchage(this, this) CashExchangeDialog.showCashExchage(this, this)
}
}) })
MainLooper.get()?.postDelayed(Runnable {
isclick = false
},2000)
}
} }
/** /**
...@@ -358,10 +366,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -358,10 +366,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onSuccess(result: List<LandListEntity>?) { override fun onSuccess(result: List<LandListEntity>?) {
var json = "{\"landList\":" + Utils.obj2Str(result) + "}" var json = "{\"landList\":" + Utils.obj2Str(result) + "}"
Log.d("Wxw", "初始化地块列表成功$from$json") Log.d("Wxw", "初始化地块列表成功$from$json")
if(from==1){ if (from == 1) {
callUnity("Canvas", "loadLandListSuccess", json) callUnity("Canvas", "loadLandListSuccess", json)
} }
if (from == 2){ if (from == 2) {
callUnity("Form_land", "sycnLandListSuccess", json) callUnity("Form_land", "sycnLandListSuccess", json)
} }
} }
...@@ -587,6 +595,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -587,6 +595,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
}) })
} }
//加速剂 //加速剂
fun getUseAcceleratorsSync(id: Int) { fun getUseAcceleratorsSync(id: Int) {
GameApiClient.gameApi.getUseAccelerators(id).compose(RxSchedulers.observableIO2Main()) GameApiClient.gameApi.getUseAccelerators(id).compose(RxSchedulers.observableIO2Main())
...@@ -600,6 +609,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -600,6 +609,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
}) })
} }
//金币购买种子 //金币购买种子
fun getBuySeed(callback: IUnitySendMessageCallback?, id: Int) { fun getBuySeed(callback: IUnitySendMessageCallback?, id: Int) {
GameApiClient.gameApi.getBuySeed(id).compose(RxSchedulers.observableIO2Main()) GameApiClient.gameApi.getBuySeed(id).compose(RxSchedulers.observableIO2Main())
...@@ -716,6 +726,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -716,6 +726,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
} }
} }
//看视频领取种子 本地处理 新 //看视频领取种子 本地处理 新
fun getVideoSeedReceiveNew(id: Int) { fun getVideoSeedReceiveNew(id: Int) {
if (videoSeedClick) { if (videoSeedClick) {
...@@ -726,13 +737,14 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -726,13 +737,14 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
object : IAdVideoListener { object : IAdVideoListener {
override fun onAdClose() { override fun onAdClose() {
videoSeedClick = true videoSeedClick = true
callUnity("Form_land", "onVideoSeedReceiveSuccess", ""+(id-1)) callUnity("Form_land", "onVideoSeedReceiveSuccess", "" + (id - 1))
GameApiClient.gameApi.getVideoSeedReceive(id) GameApiClient.gameApi.getVideoSeedReceive(id)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() { .subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) { override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "看视频领取种子同步" + Utils.obj2Str(result)) Log.d("wxw", "看视频领取种子同步" + Utils.obj2Str(result))
} }
override fun onFailure( override fun onFailure(
e: Throwable?, e: Throwable?,
code: String?, code: String?,
...@@ -767,7 +779,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -767,7 +779,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() { .subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) { override fun onSuccess(result: StatusEntity?) {
result?.id=id result?.id = id
Log.d("wxw", "看视频领取加速剂" + Utils.obj2Str(result)) Log.d("wxw", "看视频领取加速剂" + Utils.obj2Str(result))
callback?.onIncrVideoAcceleratorsSuccess( callback?.onIncrVideoAcceleratorsSuccess(
true, true,
...@@ -953,4 +965,35 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -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
...@@ -62,7 +62,7 @@ class CashExchangeAdapter : ...@@ -62,7 +62,7 @@ class CashExchangeAdapter :
holder.item_duihuan?.addClickScale() holder.item_duihuan?.addClickScale()
holder.item_duihuan?.setOnClickListener { holder.item_duihuan?.setOnClickListener {
if (Utils.isFastClick2()) { if (Utils.isFastClick2()) {
duihuan(bean.id, bean.type!!, bean.cash) duihuan(bean.id, bean.type!!, bean.cashStr)
if (bean.type == 1) { if (bean.type == 1) {
EventUtils.onEvent("click_xinshou0.3", "新手0.3") EventUtils.onEvent("click_xinshou0.3", "新手0.3")
} else if (bean.type == 4) { } else if (bean.type == 4) {
...@@ -90,7 +90,7 @@ class CashExchangeAdapter : ...@@ -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( GameApiClient.gameApi.dowd(id).compose(
RxSchedulers.observableIO2Main() RxSchedulers.observableIO2Main()
......
...@@ -17,6 +17,7 @@ import com.ym.library.rxbus.RxBusUtil ...@@ -17,6 +17,7 @@ import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.LogUtils import com.ym.library.utils.LogUtils
import com.ym.library.utils.Utils import com.ym.library.utils.Utils
import com.ym.ddcy.R import com.ym.ddcy.R
import com.ym.library.module.NewsEntity
import com.ym.library.module.WateringTaskEntity import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient import com.ym.library.net.GameApiClient
...@@ -25,16 +26,16 @@ import com.ym.library.net.GameApiClient ...@@ -25,16 +26,16 @@ import com.ym.library.net.GameApiClient
*Craeted by 2020/9/12 *Craeted by 2020/9/12
*/ */
class WateringTaskAdpater : class WateringTaskAdpater :
BaseRecyclerAdapter<WateringTaskEntity, WateringTaskAdpater.WateringTaskHolder> { BaseRecyclerAdapter<NewsEntity, WateringTaskAdpater.WateringTaskHolder> {
private var type: Int = -1 private var type: Int = -1
private var mContext: Activity? = null private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<WateringTaskEntity> private val listener: OnRecycleItemClickListener<NewsEntity>
constructor( constructor(
content: Activity?, content: Activity?,
type: Int, type: Int,
listener: OnRecycleItemClickListener<WateringTaskEntity> listener: OnRecycleItemClickListener<NewsEntity>
) : super() { ) : super() {
this.listener = listener this.listener = listener
mContext = content mContext = content
...@@ -49,16 +50,16 @@ class WateringTaskAdpater : ...@@ -49,16 +50,16 @@ class WateringTaskAdpater :
if (mList.size > 0) { if (mList.size > 0) {
val data = mList[position] val data = mList[position]
holder.tvTitle.text = data.title holder.tvTitle.text = data.title
holder.tvCount.text = "+${data.awardNum}" holder.tvCount.text = "+${data.awardCoins}"
holder.imgcoin.setImageResource(R.mipmap.icon_popupwater_icon) holder.imgcoin.setImageResource(R.mipmap.icon_popupwater_icon)
if (data.subTitle != null) { if (data.description != null) {
holder.btnProgess.visibility = View.GONE holder.btnProgess.visibility = View.GONE
holder.tvProgess.text = data.subTitle holder.tvProgess.text = data.description
} else { } else {
holder.btnProgess.visibility = View.VISIBLE holder.btnProgess.visibility = View.VISIBLE
holder.btnProgess.max = data.targetNum holder.btnProgess.max = data.awardLimit!!
holder.btnProgess.setProgress(data.completedNum) holder.btnProgess.setProgress(data.current_nums!!)
holder.tvProgess.text = "${data.completedNum}/${data.targetNum}" holder.tvProgess.text = "${data.current_nums}/${data.awardLimit}"
} }
holder.ivStatus.addClickScale() holder.ivStatus.addClickScale()
...@@ -114,8 +115,8 @@ class WateringTaskAdpater : ...@@ -114,8 +115,8 @@ class WateringTaskAdpater :
} }
// 领取水滴 type:1每日领水 2高额领水 // 领取水滴 type:1每日领水 2高额领水
private fun getDripTaskReceive(type: Int, data: WateringTaskEntity) { private fun getDripTaskReceive(type: Int, data: NewsEntity) {
GameApiClient.gameApi.getTaskReceive(data.id, type).compose( GameApiClient.gameApi.getTaskReceive(data.sid, type).compose(
RxSchedulers.observableIO2Main() RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<Any>() { ).subscribe(object : BaseObserver<Any>() {
override fun onSuccess(result: Any?) { override fun onSuccess(result: Any?) {
...@@ -130,7 +131,7 @@ class WateringTaskAdpater : ...@@ -130,7 +131,7 @@ class WateringTaskAdpater :
adType = "高额" adType = "高额"
} }
MainDialog.showgetWaterDrop(mContext, 4, "task_coins", data.awardNum, null) MainDialog.showgetWaterDrop(mContext, 4, "task_coins", data.awardCoins!!, null)
} }
} }
......
package com.ym.game.contract package com.ym.game.contract
import com.ym.library.module.SinginEntity import com.ym.library.module.SinginEntity
import com.ym.library.module.TaskListEntity
import com.ym.library.module.WateringTaskEntity import com.ym.library.module.WateringTaskEntity
...@@ -13,10 +14,12 @@ class WateringRewardContract { ...@@ -13,10 +14,12 @@ class WateringRewardContract {
interface View { interface View {
fun rchardDailyTaskResult(datas: List<WateringTaskEntity>) fun rchardDailyTaskResult(datas: List<WateringTaskEntity>)
fun rchardSignTaskResult(datas: SinginEntity) fun rchardSignTaskResult(datas: SinginEntity)
fun taskListResult(result: TaskListEntity?)
} }
interface Presenter { interface Presenter {
fun getRrchardDailyTask() fun getRrchardDailyTask()
fun getOrchardSignTask() fun getOrchardSignTask()
fun getTaskComplete(sid: Int)
} }
} }
\ No newline at end of file
package com.ym.game.presenter package com.ym.game.presenter
import com.ym.game.contract.WateringRewardContract import com.ym.game.contract.WateringRewardContract
import com.ym.library.module.NewsEntity
import com.ym.library.module.SinginEntity import com.ym.library.module.SinginEntity
import com.ym.library.module.TaskListEntity
import com.ym.library.module.WateringTaskEntity import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.BaseObserver import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient import com.ym.library.net.GameApiClient
...@@ -22,16 +24,27 @@ class WateringRewardPresenter : WateringRewardContract.Presenter { ...@@ -22,16 +24,27 @@ class WateringRewardPresenter : WateringRewardContract.Presenter {
//每日水滴任务 //每日水滴任务
override fun getRrchardDailyTask() { 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() RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<List<WateringTaskEntity>>() { ).subscribe(object : BaseObserver<TaskListEntity>() {
override fun onSuccess(result: List<WateringTaskEntity>?) { override fun onSuccess(result: TaskListEntity?) {
if (result != null) { mView?.taskListResult(result)
mView?.rchardDailyTaskResult(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 { ...@@ -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
...@@ -419,7 +419,7 @@ object MainDialog { ...@@ -419,7 +419,7 @@ object MainDialog {
buttonStatus: Int, buttonStatus: Int,
id: Int?, id: Int?,
type: Int?, type: Int?,
jine: Int?, jine: String?,
isWelfarePage:Boolean isWelfarePage:Boolean
) { ) {
...@@ -512,9 +512,9 @@ object MainDialog { ...@@ -512,9 +512,9 @@ object MainDialog {
mDialogView.findViewById<ImageView>(R.id.id_img_dialog_close).setOnClickListener { mDialogView.findViewById<ImageView>(R.id.id_img_dialog_close).setOnClickListener {
mDialog.dismiss() mDialog.dismiss()
} }
mDialog.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false) mDialog?.setCancelable(false)
mDialog.show() mDialog?.show()
} }
fun showActivityDesc(activity: Activity) { fun showActivityDesc(activity: Activity) {
......
...@@ -6,8 +6,10 @@ import android.animation.ValueAnimator ...@@ -6,8 +6,10 @@ import android.animation.ValueAnimator
import android.app.Activity import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.content.res.AssetFileDescriptor
import android.graphics.Path import android.graphics.Path
import android.graphics.PathMeasure import android.graphics.PathMeasure
import android.media.MediaPlayer
import android.util.Log import android.util.Log
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
...@@ -145,6 +147,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti ...@@ -145,6 +147,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
lottieView?.setAnimation("puzzle/data.json") lottieView?.setAnimation("puzzle/data.json")
lottieView?.setRepeatCount(1) lottieView?.setRepeatCount(1)
lottieView?.playAnimation() lottieView?.playAnimation()
playSound("collect.mp3")
lottieView?.addAnimatorUpdateListener(ValueAnimator.AnimatorUpdateListener { valueAnimator -> // 判断动画加载结束 lottieView?.addAnimatorUpdateListener(ValueAnimator.AnimatorUpdateListener { valueAnimator -> // 判断动画加载结束
if (valueAnimator.animatedFraction == 1f) { if (valueAnimator.animatedFraction == 1f) {
lottieView?.visibility = View.GONE lottieView?.visibility = View.GONE
...@@ -336,7 +339,24 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti ...@@ -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
...@@ -20,7 +20,6 @@ import com.ym.game.adapter.WateringTaskAdpater ...@@ -20,7 +20,6 @@ import com.ym.game.adapter.WateringTaskAdpater
import com.ym.game.contract.WateringRewardContract import com.ym.game.contract.WateringRewardContract
import com.ym.game.presenter.WateringRewardPresenter import com.ym.game.presenter.WateringRewardPresenter
import com.ym.library.Constant import com.ym.library.Constant
import com.ym.library.module.NewsEntity
import com.ym.library.net.BaseObserver import com.ym.library.net.BaseObserver
import com.ym.library.net.RxSchedulers import com.ym.library.net.RxSchedulers
import com.ym.library.rxbus.RxBusConstant import com.ym.library.rxbus.RxBusConstant
...@@ -29,9 +28,7 @@ import com.ym.library.rxbus.Subscribe ...@@ -29,9 +28,7 @@ import com.ym.library.rxbus.Subscribe
import com.ym.library.rxbus.ThreadMode import com.ym.library.rxbus.ThreadMode
import com.ym.ddcy.R import com.ym.ddcy.R
import com.ym.library.listener.IAdVideoListener import com.ym.library.listener.IAdVideoListener
import com.ym.library.module.SinginEntity import com.ym.library.module.*
import com.ym.library.module.StatusEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient import com.ym.library.net.GameApiClient
import com.ym.library.utils.* import com.ym.library.utils.*
...@@ -41,7 +38,7 @@ import com.ym.library.utils.* ...@@ -41,7 +38,7 @@ import com.ym.library.utils.*
* 每日水滴 * 每日水滴
*/ */
class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View, class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
OnRecycleItemClickListener<WateringTaskEntity> { OnRecycleItemClickListener<NewsEntity> {
private val TAG = "Popupwindow" private val TAG = "Popupwindow"
private var mListener: IDialogViewCloseCallback? = null private var mListener: IDialogViewCloseCallback? = null
private var view: View? = null private var view: View? = null
...@@ -102,49 +99,93 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View, ...@@ -102,49 +99,93 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
mPresenter?.getRrchardDailyTask() mPresenter?.getRrchardDailyTask()
} }
override fun onItemClick(view: View, position: Int, data: WateringTaskEntity) { override fun onItemClick(view: View, position: Int, data: NewsEntity) {
// 0未完成 1已领取 2可领取 // 0未完成 1已领取 2可领取
when (data.status) { when (data.status) {
0 -> { 0 -> {
// 跳转页面 1转盘 2高额水滴任务 3首页 4激励视频 直客任务链接" // 跳转页面 1转盘 2高额水滴任务 3首页 4激励视频 直客任务链接"
when (data.reference) { // if()
1 -> { // appmodel_id
// 应用类模块跳转 跳转到多多菜园首页 65
//应用类模块跳转到多多菜园转盘抽奖 63
//应用类模块跳转到多多菜园开宝箱 64
//应用类模块跳转到多多菜园福利中心 66
if (data.opentype == 7) {
if (data.appmodel_id == 65) {
dismiss()
} else if (data.appmodel_id == 63) {
dismiss() dismiss()
TurntableDialog.showTurntable(mContext, mListener!!) TurntableDialog.showTurntable(mContext, mListener!!)
} } else if (data.appmodel_id == 64) {
2 -> {
dismiss() dismiss()
// WateringTaskPopupwindow().init(mContext) } else if (data.appmodel_id == 66) {
}
3 -> dismiss()
6 -> {
dismiss() dismiss()
JumpUtils.jumpWelfareActivity() JumpUtils.jumpWelfareActivity()
// JumpUtils.h5Jump(
// "每日福利",
// Constant.Param.WelfareCenter,
// false,
// mContext as Activity
// )
} }
4 -> { } else if (data.opentype == 1) {
EventUtils.onEvent("click_receive_coin_task_video_btn", "领金币任务视频") if (data.sid != null) {
EventUtils.onEvent("welfare_task_undone_click", "${data.sid}")
showAd(data.sid)
}
else {
JumpUtils.adJump(data, mContext)
}
AdUtils.playRewardAd((mContext as Activity),"receive_coin_task",object : IAdVideoListener { }else if(data.opentype==2){
override fun onAdClose() { //直客链接
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 onError(errorMsg: String?) {
} }
}) })
} }
}
}
}
}
//签到 //签到
override fun rchardSignTaskResult(data: SinginEntity) { override fun rchardSignTaskResult(data: SinginEntity) {
...@@ -165,14 +206,20 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View, ...@@ -165,14 +206,20 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
} }
//每日水滴任务列表 override fun taskListResult(result: TaskListEntity?) {
override fun rchardDailyTaskResult(datas: List<WateringTaskEntity>) {
LogUtils.i(TAG, "每日水滴任务列表")
wateringTaskAdpater?.clear() wateringTaskAdpater?.clear()
wateringTaskAdpater?.appendToList(datas) wateringTaskAdpater?.appendToList(result?.userTask)
wateringTaskAdpater?.notifyDataSetChanged() wateringTaskAdpater?.notifyDataSetChanged()
} }
//每日水滴任务列表
override fun rchardDailyTaskResult(datas: List<WateringTaskEntity>) {
// wateringTaskAdpater?.clear()
// wateringTaskAdpater?.appendToList(datas)
// wateringTaskAdpater?.notifyDataSetChanged()
}
override fun dismiss() { override fun dismiss() {
mListener?.onCloseViewSuccess(true) mListener?.onCloseViewSuccess(true)
super.dismiss() super.dismiss()
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:paddingBottom="8dp" android:paddingBottom="8dp"
android:text="福利中心" android:text="每日福利"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" /> android:textStyle="bold" />
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:text="个碎片就可以完成拼图了" android:text="个碎片就完成拼图了"
android:textColor="#6A231A" android:textColor="#6A231A"
android:textSize="17sp" /> android:textSize="17sp" />
</LinearLayout> </LinearLayout>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="看一次视频即可获得一个碎片哦!" android:text="看视频可以获得碎片哦!"
android:textColor="#6A231A" android:textColor="#6A231A"
android:textSize="17sp" /> android:textSize="17sp" />
......
...@@ -49,16 +49,15 @@ ...@@ -49,16 +49,15 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="8dp" android:layout_height="8dp"
android:layout_marginRight="4dp" android:layout_marginRight="12dp"
android:progressDrawable="@drawable/user_progressbar_bg" /> android:progressDrawable="@drawable/user_progressbar_bg" />
<TextView <TextView
android:id="@+id/tv_watering_item_progess" android:id="@+id/tv_watering_item_progess"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="1" android:text="221"
android:textColor="#8F6E42" android:textColor="#8F6E42"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>
...@@ -70,13 +69,13 @@ ...@@ -70,13 +69,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_2" android:layout_marginTop="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_30" android:layout_marginRight="@dimen/dp_25"
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:id="@+id/img_icon_item" android:id="@+id/img_icon_item"
android:layout_width="wrap_content" android:layout_width="@dimen/dp_22"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_22"
android:layout_marginRight="@dimen/dp_3" /> android:layout_marginRight="@dimen/dp_3" />
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<FrameLayout <FrameLayout
android:id="@+id/splash_container" android:id="@+id/splash_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent" />
<TextView <TextView
android:id="@+id/tv_skipview" android:id="@+id/tv_skipview"
android:text="跳过" android:layout_width="96dp"
android:gravity="center" android:layout_height="wrap_content"
android:padding="3dp"
android:visibility="gone"
android:layout_marginRight="20dp"
android:layout_marginTop="40dp"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginTop="40dp"
android:layout_marginRight="20dp"
android:background="@drawable/drawable_skip_view" android:background="@drawable/drawable_skip_view"
android:layout_width="96dp" android:gravity="center"
android:padding="3dp"
android:text="跳过"
android:textColor="@android:color/white" 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> </RelativeLayout>
\ No newline at end of file
...@@ -12,6 +12,7 @@ class NewsEntity : Serializable { ...@@ -12,6 +12,7 @@ class NewsEntity : Serializable {
var reqId: String? = "" var reqId: String? = ""
var slotName: String? = "" // video var slotName: String? = "" // video
var slotId: String? = "" // var slotId: String? = "" //
var awardLimit:Int?=0
var codeId: String? = ""//拉取SDK广告用codeId var codeId: String? = ""//拉取SDK广告用codeId
var codeAppId: String? = ""// var codeAppId: String? = ""//
var sdkRenderType = 0// 广告渲染类型 1. 自渲染 2.模板渲染 var sdkRenderType = 0// 广告渲染类型 1. 自渲染 2.模板渲染
...@@ -41,7 +42,7 @@ class NewsEntity : Serializable { ...@@ -41,7 +42,7 @@ class NewsEntity : Serializable {
var duration: String? = ""//视频时长 var duration: String? = ""//视频时长
var appComments: String? = ""//视频时长 var appComments: String? = ""//视频时长
var awardCoins: String? = ""//视频时长 var awardCoins: Int? = 0//视频时长
var appScore: Int? = 0 var appScore: Int? = 0
var isDowanloaded: Boolean = false var isDowanloaded: Boolean = false
var closeViewType: Int? = 0 var closeViewType: Int? = 0
...@@ -63,13 +64,13 @@ class NewsEntity : Serializable { ...@@ -63,13 +64,13 @@ class NewsEntity : Serializable {
var timeTrigger: String? = "" var timeTrigger: String? = ""
var templateId: Int? = 7// 广告类型 var templateId: Int? = 7// 广告类型
var current_nums: String? = "" var current_nums: Int? = 0
var source: String? = "" var source: String? = ""
var award_limit: String? = "" var award_limit: String? = ""
var sourceUrl: String? = "" var sourceUrl: String? = ""
var url: String? = "" var url: String? = ""
var title: String? = "" var title: String? = ""
var description: String? = "" var description: String? = null
var pubDate: String? = "" var pubDate: String? = ""
var images: List<String>? = null var images: List<String>? = null
var icon_url: String? = null var icon_url: String? = null
......
...@@ -339,4 +339,11 @@ interface IGameApi { ...@@ -339,4 +339,11 @@ interface IGameApi {
*/ */
@GET(NetConfig.Game.URL_GAME_HOME_WD_LIST) @GET(NetConfig.Game.URL_GAME_HOME_WD_LIST)
fun getHomeWList(): Observable<Response<List<HomeListEntity>>> 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
...@@ -270,5 +270,7 @@ public class NetConfig { ...@@ -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_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_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_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";//看领金币视频任务
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment