Commit 1baa60fa authored by maxiaoliang's avatar maxiaoliang

多多菜园1.0.6迭代

parent 80a6d133
......@@ -198,7 +198,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun oneveryDayWelfareClick() {
Log.d("wxw", "每日福利")
// JumpUtils.h5Jump("每日福利", Constant.Param.WelfareCenter, false, act)
JumpUtils.jumpWelfareActivity()
JumpUtils.jumpWelfareActivity()
}
/**
......@@ -996,7 +996,51 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
Utils.showToast(mContext, "" + errorMsg)
}
})
}
fun showCloudDialog(speedtime:Int,sppedtimes:Int){
MainLooper.get()?.post(Runnable {
// CashExchangeDialog.showCashExchage(this, this)
MainDialog.showDialogCloud(this,speedtime,sppedtimes, View.OnClickListener {
AdUtils.playRewardAd(
this@GameActivity,
"cloud_acceleration_click",
object : IAdVideoListener {
override fun onAdClose() {
GameApiClient.gameApi.getCloudSpeed()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "云朵加速" + Utils.obj2Str(result))
// callback?.onCloudSpeedSuccess(true, Utils.obj2Str(result))
callUnity("Form_land", "showCloudSpeedAnim", "")
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
Log.d("wxw", "云朵加速 error")
//callback?.onCloudSpeedSuccess(false, errorMsg + "")
}
})
}
override fun onError(errorMsg: String?) {
cloudIsClick = true
}
})
})
})
}
fun showWareHouseDialog(){
MainLooper.get()?.post(Runnable {
if (Utils.isFastClick2()) {
WareHouseDialog.showWareHouse(this)
}
})
}
}
\ No newline at end of file
......@@ -4,7 +4,6 @@ import android.app.Dialog
import android.text.Html
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.bird.cc.id
import com.ym.ddcy.R
import com.ym.game.adapter.ClockInWithdrawAdpater
import com.ym.game.contract.ClockInWithdrawContract
......
......@@ -10,7 +10,6 @@ import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.bird.cc.it
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.ddcy.R
......
package com.ym.game.adapter
import android.app.Activity
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
......@@ -17,21 +18,22 @@ 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
import com.ym.library.utils.EventUtils
class SpeedWaterTaskAdapter :
BaseRecyclerAdapter<WateringTaskEntity, SpeedWaterTaskAdapter.WateringTaskHolder> {
BaseRecyclerAdapter<NewsEntity, SpeedWaterTaskAdapter.WateringTaskHolder> {
private var type: Int = -1
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<WateringTaskEntity>
private val listener: OnRecycleItemClickListener<NewsEntity>
constructor(
content: Activity?,
type: Int,
listener: OnRecycleItemClickListener<WateringTaskEntity>
listener: OnRecycleItemClickListener<NewsEntity>
) : super() {
this.listener = listener
mContext = content
......@@ -43,13 +45,28 @@ class SpeedWaterTaskAdapter :
if (mList.size > 0) {
val data = mList[position]
holder.tvTitle.text = data.title
holder.tvCount.text = "+${data.awardNum}"
holder.imgspeed.setImageResource(R.mipmap.icon_speed_get)
if (data.subTitle != null) {
holder.tvProgess.text = data.subTitle
if (data?.awardRangeStart != null && data?.awardRangeEnd != null) {
holder.tvCount.text = "+${data?.awardRangeStart}~${data?.awardRangeEnd}"
} else {
holder.tvProgess.text = "${data.completedNum}/${data.targetNum}"
holder.tvCount.text = "+${data.coins}"
}
if (!TextUtils.isEmpty(data.description)) {
// 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
// holder.btnProgess.max = data.awardLimit!!
// holder.btnProgess.setProgress(data.current_nums!!)
holder.tvProgess.text = "${data.current_nums}/${data.awardLimit}"
}
// holder.tvCount.text = "+${data.awardNum}"
// holder.imgspeed.setImageResource(R.mipmap.icon_speed_get)
// if (data.subTitle != null) {
// holder.tvProgess.text = data.subTitle
// } else {
// holder.tvProgess.text = "${data.completedNum}/${data.targetNum}"
// }
holder.ivStatus.addClickScale()
holder.ivStatus.setOnClickListener {
......@@ -57,7 +74,7 @@ class SpeedWaterTaskAdapter :
when (data.status) {
0 ->{
EventUtils.onEvent("renwu_undone_click_"+mList[position].id, "金币任务去完成点击")
EventUtils.onEvent("jiasu_renwu_undone_click_"+mList[position].sid, "金币任务去完成点击")
listener.onItemClick(it, position, mList[position])
}
......@@ -69,7 +86,7 @@ class SpeedWaterTaskAdapter :
//领取
2 ->{
getDripTaskReceive(type, data)
getDripTaskReceive( data.sid!!,data)
}
}
}
......@@ -111,23 +128,16 @@ class SpeedWaterTaskAdapter :
}
// 领取水滴 type:1每日领水 2高额领水
private fun getDripTaskReceive(type: Int, data: WateringTaskEntity) {
GameApiClient.gameApi.getAcceleTask(data.id).compose(
private fun getDripTaskReceive(sid: Int, data: NewsEntity) {
GameApiClient.gameApi.getAcceleTask(sid).compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<Any>() {
override fun onSuccess(result: Any?) {
RxBusUtil.getDefault()
.send(RxBusConstant.RX_SPEED_WATER_TASK_LIST)
if (result != null) {
LogUtils.i("WateringTaskAdpater", "水滴领取" + result)
var adType = ""
if (type == 1) {
adType = "每日"
} else if (type == 2) {
adType = "高额"
}
MainDialog.showgetWaterDrop(mContext, 5, "task_accelerator", data.awardNum, null)
MainDialog.showgetWaterDrop(mContext, 5, "task_accelerator", data.awardCoins!!, null)
}
}
......
package com.ym.game.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.ym.ddcy.R
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.module.FlyBoxEntity
import com.ym.modulecommon.AppliContext
class WareHouseAdapter : BaseRecyclerAdapter<FlyBoxEntity, WareHouseAdapter.ViewHolder> {
private var mContext: Context? = null
constructor(
content: Context?
) : super() {
mContext = content
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
var bean = mList[position]
when (bean.type) {
//加速剂
1 -> {
holder.item_img?.setBackgroundResource(R.mipmap.icon_speed_water)
}
//种子
2 -> {
when (bean.id) {
1 -> {
holder.item_img?.setImageResource(R.mipmap.img_cabbage)
}
2 -> {
holder.item_img?.setImageResource(R.mipmap.img_tomato)
}
3 -> {
holder.item_img?.setImageResource(R.mipmap.img_pumpkin)
}
4 -> {
holder.item_img?.setImageResource(R.mipmap.img_radish)
}
5 -> {
holder.item_img?.setImageResource(R.mipmap.img_corn)
}
6 -> {
holder.item_img?.setImageResource(R.mipmap.img_eggplant)
}
7 -> {
holder.item_img?.setImageResource(R.mipmap.img_melon)
}
8 -> {
holder.item_img?.setImageResource(R.mipmap.img_grape)
}
9 -> {
holder.item_img?.setImageResource(R.mipmap.img_strawberry)
}
}
}
//果实
3 -> {
when (bean.id) {
1 -> {
holder.item_img?.setImageResource(R.mipmap.baicai_fruit)
}
2 -> {
holder.item_img?.setImageResource(R.mipmap.fanqiei_fruit)
}
3 -> {
holder.item_img?.setImageResource(R.mipmap.nangua_fruit)
}
4 -> {
holder.item_img?.setImageResource(R.mipmap.luobo_fruit)
}
5 -> {
holder.item_img?.setImageResource(R.mipmap.yumi_fruit)
}
6 -> {
holder.item_img?.setImageResource(R.mipmap.qiezi_fruit)
}
7 -> {
holder.item_img?.setImageResource(R.mipmap.xigua_fruit)
}
8 -> {
holder.item_img?.setImageResource(R.mipmap.putao_fruit)
}
9 -> {
holder.item_img?.setImageResource(R.mipmap.caomei_fruit)
}
}
}
}
holder.item_ownnum?.text = bean.ownNum.toString()
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppliContext.get())
.inflate(R.layout.item_layout_warehouse, parent, false)
)
}
class ViewHolder : RecyclerView.ViewHolder {
var item_img: ImageView?
var item_ownnum: TextView?
constructor(
itemView: View
) : super(itemView) {
item_img = itemView.findViewById<ImageView>(R.id.id_img_item)
item_ownnum = itemView.findViewById<TextView>(R.id.id_tv_ownnum)
}
}
}
\ No newline at end of file
package com.ym.game.adapter
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.app.Activity
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.text.TextUtils
import android.view.*
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.ym.library.listener.OnRecycleItemClickListener
......@@ -52,14 +52,32 @@ class WateringTaskAdpater :
if (mList.size > 0) {
val data = mList[position]
holder.tvTitle.text = data.title
if(data.opentype==1){
holder.tvCount.text = "+${data.awardCoins}"
}else{
if (data?.awardRangeStart != null && data?.awardRangeEnd != null) {
holder.tvCount.text = "+${data?.awardRangeStart}~${data?.awardRangeEnd}"
holder.llnum.gravity=Gravity.RIGHT
} else {
holder.tvCount.text = "+${data.coins}"
holder.llnum.gravity=Gravity.CENTER
}
if (data?.adRenderStyle != null && data?.adRenderStyle == 3) {
holder?.rlbg.setBackgroundResource(R.drawable.withdraw_bg)
} else if (data?.adRenderStyle != null && data?.adRenderStyle == 1) {
holder?.rlbg.setBackgroundResource(R.drawable.icon_luck_task)
}
if (data?.buttonSway != null && data?.buttonSway == 1) {
startAnimator(holder?.ivStatus)
} else {
holder?.ivStatus.clearAnimation()
}
// if(data.opentype==1){
// holder.tvCount.text = "+${data.awardCoins}"
// }else{
// holder.tvCount.text = "+${data.coins}"
// }
holder.imgcoin.setImageResource(R.mipmap.icon_popupwater_icon)
if (data.description != null) {
if (!TextUtils.isEmpty(data.description)) {
holder.btnProgess.visibility = View.GONE
holder.tvTitle.text = data.title+" (${data.current_nums}/${data.awardLimit})"
holder.tvProgess.text = data.description
......@@ -89,7 +107,7 @@ class WateringTaskAdpater :
EventUtils.onEvent("renwu_done_click_total")
}
EventUtils.onEvent("renwu_done_click_"+mList[position].sid, "金币任务领取点击")
getDripTaskReceive(type, data)
getDripTaskReceive(type, data.sid!!)
}
}
......@@ -101,9 +119,16 @@ class WateringTaskAdpater :
// 0未完成 1已领取 2可领取
when (data.status) {
0 -> holder.ivStatus.setImageResource(R.mipmap.icon_mian_popup_complete)
0 ->
{
holder.ivStatus.setImageResource(R.mipmap.icon_mian_popup_complete)
if(data.opentype==1){
holder.ivStatus.setImageResource(R.mipmap.icon_main_popup_receive)
}
}
1 -> holder.ivStatus.setImageResource(R.mipmap.icon_main_popup_receiveed)
2 -> holder.ivStatus.setImageResource(R.mipmap.icon_main_popup_receive)
}
val layoutParams = RelativeLayout.LayoutParams(
......@@ -127,7 +152,7 @@ class WateringTaskAdpater :
inner class WateringTaskHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val tvTitle: TextView = itemView.findViewById(R.id.tv_watering_item_title)
val llnum:LinearLayout=itemView.findViewById(R.id.id_ll_right)
// val btnProgess: ProgressButton = itemView.findViewById(R.id.progess_watering_item)
val btnProgess: ProgressBar = itemView.findViewById(R.id.progess_watering_item)
val tvProgess: TextView = itemView.findViewById(R.id.tv_watering_item_progess)
......@@ -136,11 +161,13 @@ class WateringTaskAdpater :
val imgcoin: ImageView = itemView.findViewById(R.id.img_icon_item)
val layoutRoot: LinearLayout = itemView.findViewById(R.id.layout_watering_root)
val rlbg: RelativeLayout = itemView.findViewById(R.id.ll_one)
}
// 领取水滴 type:1每日领水 2高额领水
private fun getDripTaskReceive(type: Int, data: NewsEntity) {
GameApiClient.gameApi.getTaskComplete(data.sid).compose(
fun getDripTaskReceive(type: Int, sid:Int) {
GameApiClient.gameApi.getTaskComplete(sid).compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<TaskCompleteEntity>() {
override fun onSuccess(result: TaskCompleteEntity?) {
......@@ -148,19 +175,8 @@ class WateringTaskAdpater :
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 = "高额"
}
if(data.opentype==1){
MainDialog.showgetWaterDrop(mContext, 4, "task_coins", data.awardCoins!!, null)
}else{
MainDialog.showgetWaterDrop(mContext, 4, "task_coins", data.coins!!, null)
}
LogUtils.i("WaterTaskAdpater", "任务奖励领取" + result)
MainDialog.showgetWaterDrop(mContext, 4, "task_coins", result.awardCoins!!, null)
}
}
......@@ -171,7 +187,34 @@ class WateringTaskAdpater :
})
}
private var animatorList: MutableList<ObjectAnimator> = ArrayList()
private var viewList: MutableList<View> = ArrayList()
private fun startAnimator(view: View) {
val oa: ObjectAnimator = ObjectAnimator.ofFloat(
view,
View.ROTATION,
0F, 8F, -8F, 0F, 0F, 0F, 0F, 0F, 0F
)
oa.repeatCount = ValueAnimator.INFINITE
oa.setDuration(1000).start()
animatorList.add(oa)
viewList.add(view)
}
fun clearAnimation() {
if (animatorList.size > 0) {
for (animator in animatorList) {
animator?.cancel()
}
animatorList.clear()
}
if (viewList.size > 0) {
for (view in viewList) {
view?.clearAnimation()
}
viewList.clear()
}
}
/**
* 添加点击缩放效果
*/
......
......@@ -10,7 +10,6 @@ import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.bird.cc.it
import com.bumptech.glide.Glide
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.base.BaseRecyclerAdapter
......
......@@ -60,7 +60,8 @@ class BaseApplication : MultiDexApplication() {
//TODO 上线去掉测试地址
NetConfig.BASE_FEED_URL = "http://feedapitest2.zhangxinhulian.com/"
NetConfig.BASE_FEED_URL = "http://feedapitest2.zhangxinhulian.com/"
// Constant.appLs = "afcbef40e31631d3"//appls
AdManager.init(this,"afcbef40e31631d3")
LogUtils.getConfig().logSwitch = false
UMConfigure.setLogEnabled(true)
......
package com.ym.game.contract
import com.ym.library.module.TaskListEntity
import com.ym.library.module.WateringTaskEntity
......@@ -7,6 +8,7 @@ class SpeedWaterContract {
interface View {
fun AcceleratorsTaskResult(result: List<WateringTaskEntity>)
fun taskListResult(result: TaskListEntity?)
}
interface Presenter {
......
package com.ym.game.contract
import com.ym.library.module.FlyBoxEntity
import com.ym.library.module.WateringTaskEntity
class WareHouseContract {
interface View {
fun warehouseDataResult(result: List<FlyBoxEntity>)
}
interface Presenter {
fun getwarehouseData()
}
}
\ No newline at end of file
package com.ym.game.presenter
import com.ym.game.contract.SpeedWaterContract
import com.ym.library.module.TaskListEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
......@@ -14,17 +15,28 @@ class SpeedWaterPresenter : SpeedWaterContract.Presenter {
}
override fun getAcceleratorsTask() {
GameApiClient.gameApi.getAcceleratorsTask().compose(
// GameApiClient.gameApi.getAcceleratorsTask().compose(
// RxSchedulers.observableIO2Main()
// ).subscribe(object : BaseObserver<List<WateringTaskEntity>>() {
// override fun onSuccess(result: List<WateringTaskEntity>?) {
// if (result != null) {
// mView?.AcceleratorsTaskResult(result)
// }
// }
//
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
// })
// }
GameApiClient.gameApi.getTaskListInfo("watter_high_task_list").compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<List<WateringTaskEntity>>() {
override fun onSuccess(result: List<WateringTaskEntity>?) {
if (result != null) {
mView?.AcceleratorsTaskResult(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)
}
})
}
}
\ No newline at end of file
package com.ym.game.presenter
import com.ym.game.contract.WareHouseContract
import com.ym.library.module.FlyBoxEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
class WareHousePresenter: WareHouseContract.Presenter {
var mView: WareHouseContract.View
constructor(mView: WareHouseContract.View) {
this.mView = mView
}
override fun getwarehouseData() {
GameApiClient.gameApi.getWarehouseData().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<List<FlyBoxEntity>>() {
override fun onSuccess(result: List<FlyBoxEntity>?) {
if (result != null) {
mView?.warehouseDataResult(result)
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
})
}
}
\ No newline at end of file
......@@ -11,7 +11,6 @@ import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.*
import com.bird.cc.it
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.qq.e.ads.nativ.NativeExpressADView
import com.ym.admodule.config.AdManager
......@@ -456,7 +455,6 @@ object MainDialog {
imgtitle.setImageResource(R.mipmap.img_duihuan_success)
imggoon.setImageResource(R.mipmap.img_go_on_make_money)
if (type == 1) {
Log.e("MXL","show_xinshou0.3")
EventUtils.onEvent("show_xinshou0.3", "新手0.3")
} else if (type == 4) {
EventUtils.onEvent("show_fuli0.3", "福利0.3")
......@@ -585,7 +583,40 @@ object MainDialog {
mDialog?.setCancelable(false)
mDialog?.show()
}
// 云朵加速的弹窗
fun showDialogCloud(
activity: Activity?,
speedtime: Int,
speedtimes: Int,
onClickListener: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView = showBottomDialog(
R.layout.dialog_cloud_speed,
activity,
mDialog,
0,
Gravity.CENTER
)
EventUtils.onEvent("show_cloud_speed_up_dialog", "云朵加速弹窗")
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad)
AdUtils.showFeedAd(activity, "cloud_speed_bigimage", layoutAd)
mDialogView.findViewById<TextView>(R.id.id_tv_speed_time)?.text = "所有土地获得${speedtime}分钟加速"
mDialogView.findViewById<TextView>(R.id.id_cloud_speed_num)?.text = "每天晚上0点重置视频次数(剩余${speedtimes}次)"
mDialogView.findViewById<ImageView>(R.id.id_img_close_cloud_speed).setOnClickListener {
mDialog.dismiss()
}
mDialogView.findViewById<ImageView>(R.id.id_img_all_speed).setOnClickListener {
EventUtils.onEvent("click_cloud_speed_up_video_btn", "云朵加速视频点击")
onClickListener.onClick(it)
mDialog.dismiss()
}
mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false)
mDialog?.show()
}
/**
* 添加点击缩放效果
*/
......
......@@ -179,7 +179,8 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
fun showAd(sId: Int) {
AdUtils.playRewardAd(mContext as Activity, "home_task", object : IAdVideoListener {
override fun onAdClose() {
mPresenter?.getTaskComplete(sId)
// mPresenter?.getTaskComplete(sId)
wateringTaskAdpater?.getDripTaskReceive(1,sId)
}
override fun onError(errorMsg: String?) {
......
......@@ -27,12 +27,13 @@ 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.TaskListEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient
import com.ym.library.utils.*
class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
OnRecycleItemClickListener<WateringTaskEntity> {
OnRecycleItemClickListener<NewsEntity> {
private var mListener: IDialogViewCloseCallback? = null
private var view: View? = null
private var mContext: Activity? = null
......@@ -46,7 +47,7 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
RxBusUtil.getDefault().register(this)
mPresenter = SpeedWaterPresenter(this)
view = LayoutInflater.from(mContext).inflate(R.layout.layout_popup_speedwater, null)
EventUtils.onEvent("show_speed_water_task_dialog", "领加速剂任务")
EventUtils.onEvent("show_jiasu_task_dialog", "领加速剂任务")
init(view)
initView()
mPresenter?.getAcceleratorsTask()
......@@ -73,57 +74,94 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
mPresenter?.getAcceleratorsTask()
}
override fun onItemClick(view: View, position: Int, data: WateringTaskEntity) {
override fun onItemClick(view: View, position: Int, data: NewsEntity) {
// 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_jiasuji_task_video_btn", "领加速剂任务视频")
AdUtils.playRewardAd((mContext as Activity),"accelerator_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)
EventUtils.onEvent("renwu_undone_click_total")
}
5 -> {
//直客任务链接
if (data?.url != null) {
val newsEntity: NewsEntity =
Utils.str2Obj(data?.ad, NewsEntity::class.java) as NewsEntity
JumpUtils.adJump(newsEntity, (mContext as Activity))
}
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 dismiss() {
mListener?.onCloseViewSuccess(true)
......@@ -168,8 +206,15 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
}
override fun AcceleratorsTaskResult(result: List<WateringTaskEntity>) {
// speedadapter?.clear()
// speedadapter?.appendToList(result)
// speedadapter?.notifyDataSetChanged()
}
override fun taskListResult(result: TaskListEntity?) {
speedadapter?.clear()
speedadapter?.appendToList(result)
speedadapter?.appendToList(result?.userTask)
speedadapter?.notifyDataSetChanged()
}
}
\ No newline at end of file
package com.ym.game.view
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.widget.ImageView
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ym.ddcy.R
import com.ym.game.adapter.RecordAdapter
import com.ym.game.adapter.WareHouseAdapter
import com.ym.game.contract.WareHouseContract
import com.ym.game.presenter.RecordPresenter
import com.ym.game.presenter.WareHousePresenter
import com.ym.library.module.FlyBoxEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.EventUtils
import com.ym.library.utils.LogUtils
object WareHouseDialog : WareHouseContract.View {
private var context: Context? = null
private var mDialog: Dialog? = null
private var mPresenter: WareHousePresenter? = null
private var adapter: WareHouseAdapter? = null
//展示兑换记录窗口
fun showWareHouse(context: Context?) {
if (context == null) {
return
}
this.context = context
EventUtils.onEvent("show_cangku_dialog", "仓库弹窗曝光")
mPresenter = WareHousePresenter(this)
mPresenter?.getwarehouseData()
RxBusUtil.getDefault().register(this)
mDialog = Dialog(context, R.style.UpdateVersionCompatDialogTheme75)
val mDialogView =
MainDialog.showBottomDialog(
R.layout.dialog_layout_warehouse,
context,
mDialog!!,
0,
Gravity.CENTER
)
val rl = mDialog?.findViewById<RecyclerView>(R.id.rl_record)
rl?.layoutManager =
GridLayoutManager(context,4)
adapter = WareHouseAdapter(context)
rl?.adapter = adapter
mDialogView?.findViewById<ImageView>(R.id.iv_dialog_close).setOnClickListener {
mDialog?.dismiss()
RxBusUtil.getDefault().unregister(this)
}
mDialog?.setOnCancelListener {
RxBusUtil.getDefault().unregister(this)
}
mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false)
mDialog?.show()
}
override fun warehouseDataResult(result: List<FlyBoxEntity>) {
adapter?.clear()
adapter?.appendToList(result)
adapter?.notifyDataSetChanged()
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="370dp"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15">
<ImageView
android:layout_width="match_parent"
android:layout_height="313dp"
android:layout_alignParentBottom="true"
android:scaleType="fitXY"
android:src="@mipmap/icon_main_dialog_get_drops_bg" />
<ImageView
android:id="@+id/id_img_close_cloud_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="65dp"
android:src="@mipmap/icon_new_close" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="20dp"
android:background="@mipmap/icon_content_bg">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:src="@drawable/icon_speed_cloud_title" />
<LinearLayout
android:id="@+id/id_ll_content"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_below="@+id/id_tv_gongxi_get"
android:layout_centerHorizontal="true"
android:layout_marginLeft="28dp"
android:layout_marginTop="@dimen/dp_121"
android:layout_marginRight="@dimen/dp_26"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
>
<TextView
android:id="@+id/id_tv_speed_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#6A231A"
android:textSize="@dimen/sp_20"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_centerInParent="true"
android:src="@drawable/icon_light" />
<ImageView
android:layout_width="125dp"
android:layout_height="114dp"
android:layout_centerInParent="true"
android:src="@drawable/icon_cloud"
android:visibility="visible" />
</RelativeLayout>
</LinearLayout>
<ImageView
android:id="@+id/id_img_all_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_36"
android:src="@drawable/icon_speed_all" />
<TextView
android:id="@+id/id_cloud_speed_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_10"
android:includeFontPadding="false"
android:text="每天晚上0点重置视频次数(剩余30次)"
android:textColor="#864F1C" />
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:id="@+id/layout_get_drop_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="18dp"
android:layout_marginTop="10dp"
android:layout_marginRight="18dp"
android:background="@color/white"
android:padding="@dimen/dp_10"
android:visibility="gone" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="590dp"
android:layout_centerInParent="true"
android:layout_marginLeft="9dp"
android:layout_marginRight="9dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="520dp"
android:layout_alignParentBottom="true"
android:scaleType="fitXY"
android:src="@mipmap/icon_main_dialog_get_drops_bg" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="577dp"
android:layout_centerInParent="true">
<RelativeLayout
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_40"
android:layout_alignParentRight="true"
android:layout_marginTop="76dp">
</RelativeLayout>
<ImageView
android:id="@+id/iv_dialog_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="76dp"
android:src="@mipmap/icon_new_close" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:scaleType="fitXY"
android:src="@mipmap/icon_warehouse_title" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_dialog_close"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_100"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="@dimen/dp_42"
android:layout_height="@dimen/dp_47"
android:gravity="center">
<ImageView
android:id="@+id/id_img_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/id_tv_ownnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#8F4C07"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
</LinearLayout>
......@@ -11,7 +11,7 @@
android:id="@+id/ll_one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/withdraw_bg"
android:background="@drawable/icon_luck_task"
android:orientation="vertical">
<TextView
......@@ -19,20 +19,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_30"
android:includeFontPadding="false"
android:text="浇水10次"
android:textColor="#642D2D"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/layout_watering_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/dp_32"
android:layout_below="@+id/tv_watering_item_title"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center">
<!-- <com.ym.module.guesssong.widget.ProgressButton
......@@ -48,7 +47,7 @@
android:id="@+id/progess_watering_item"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="150dp"
android:layout_height="8dp"
android:layout_height="10dp"
android:layout_marginRight="12dp"
android:progressDrawable="@drawable/user_progressbar_bg" />
......@@ -59,30 +58,32 @@
android:includeFontPadding="false"
android:text="221"
android:textColor="#8F6E42"
android:textSize="16sp" />
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_ll_right"
android:layout_width="wrap_content"
android:layout_width="@dimen/dp_100"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_25"
android:gravity="center">
android:layout_marginTop="@dimen/dp_8"
android:gravity="right"
android:layout_marginRight="@dimen/dp_8"
>
<ImageView
android:id="@+id/img_icon_item"
android:layout_width="@dimen/dp_22"
android:layout_height="@dimen/dp_22"
android:layout_marginRight="@dimen/dp_3" />
android:layout_marginRight="@dimen/dp_3"
android:src="@mipmap/icon_coin"/>
<TextView
android:id="@+id/tv_watering_item_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+0g"
android:text="+40~100"
android:textColor="#ED5430"
android:textSize="@dimen/sp_18"
android:textStyle="bold" />
......@@ -94,9 +95,10 @@
android:layout_height="wrap_content"
android:layout_below="@+id/id_ll_right"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginRight="@dimen/dp_13"
android:layout_marginBottom="@dimen/dp_4"
android:src="@mipmap/icon_mian_popup_complete" />
android:layout_marginBottom="@dimen/dp_9"
android:src="@mipmap/icon_mian_popup_complete"
/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
......@@ -59,7 +59,11 @@
<dimen name="dp_75">75dp</dimen>
<dimen name="dp_76">76dp</dimen>
<dimen name="dp_79">79dp</dimen>
<dimen name="dp_98">98dp</dimen>
<dimen name="dp_98">92dp</dimen>
<dimen name="dp_96">96dp</dimen>
<dimen name="dp_94">94dp</dimen>
<dimen name="dp_92">92dp</dimen>
<dimen name="dp_90">90dp</dimen>
<dimen name="dp_100">100dp</dimen>
<dimen name="dp_102">102dp</dimen>
<dimen name="dp_106">106dp</dimen>
......
......@@ -67,7 +67,7 @@ dependencies {
api ("com.bx:adsdk:1.3.3"){
exclude group: 'com.google.code.gson'
}
api 'com.ym.admodule:admodule:1.0.2.20'
api 'com.ym.admodule:admodule:1.0.2.23'
api 'com.airbnb.android:lottie:3.1.0'
/* api 'androidx.appcompat:appcompat:1.2.0-alpha02'
api 'com.android.support:design:28.0.0'
......
......@@ -224,15 +224,15 @@
android:resource="@xml/wn_file_paths" />
</provider>
<provider
android:name="com.meishu.sdk.core.service.MeishuFileProvider"
android:authorities="${applicationId}.MeishuFileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/meishu_file_path" />
</provider>
<!-- <provider-->
<!-- android:name="com.meishu.sdk.core.service.MeishuFileProvider"-->
<!-- android:authorities="${applicationId}.MeishuFileProvider"-->
<!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">-->
<!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/meishu_file_path" />-->
<!-- </provider>-->
<meta-data
android:name="TZ_APP_KEY"
......
......@@ -3,6 +3,7 @@ package com.ym.library.module
class FlyBoxEntity {
var id: Int = 0
var type: Int? = 0
var ownNum:Int?=0
var awardNum: Int? = 0
var awardType: Int? = 0//1种子 2金币 3加速剂
var subType: Int? = 0
......
......@@ -30,6 +30,15 @@ public class HomeInfoEntity {
private int subAcceleratorsVideoNum;//看加速剂不足视频剩余次数
private int subSeedVideoNum;//看种子不足视频剩余次数
private int acceleratorsVideoNum;//看视频给加速剂的个数
private int lotteryNum;//转盘剩余次数
public int getLotteryNum() {
return lotteryNum;
}
public void setLotteryNum(int lotteryNum) {
this.lotteryNum = lotteryNum;
}
public int getAcceleratorsVideoNum() {
return acceleratorsVideoNum;
......
......@@ -6,4 +6,5 @@ class TaskCompleteEntity {
var recode: Int? = 0
var cents: Int? = 0
var taskId: Int? = 0
var awardCoins:Int?=0
}
\ No newline at end of file
......@@ -345,5 +345,9 @@ interface IGameApi {
*/
@POST(NetConfig.Game.URL_GAME_VIDEO_TASK_COMPLETE)
fun getTaskCompleteReport(@Query("sid") sid: Int): Observable<Response<NewsEntity>>
/**
* 仓库列表
*/
@GET(NetConfig.Game.URL_GAME_WAREHOUSEDATA)
fun getWarehouseData(): Observable<Response<List<FlyBoxEntity>>>
}
\ No newline at end of file
......@@ -232,7 +232,7 @@ public class NetConfig {
public static final String URL_GAME_FARM_LOTTERY = "app/v1/game/ddcy/lottery";//转盘抽奖
public static final String URL_GAME_FARM_LIST = "app/v1/game/farm/sign_list";//签到列表
public static final String URL_GAME_FARM_DAILY_TASK = "app/v1/game/farm/daily_task";//每日金币任务
public static final String URL_GAME_ACCELERATORS_TASK = "app/v1/game/ddcy/accelerators_task ";//每日加速剂任务
public static final String URL_GAME_ACCELERATORS_TASK = "app/v1/game/ddcy/accelerators_task_receiveV2";//每日加速剂任务
public static final String URL_GAME_INCR_SEED = "app/v1/game/farm/incr_seed";//看视频获得种子
public static final String URL_GAME_INCR_ACCELERATORS = "app/v1/game/farm/incr_accelerators";//看视频获得加速剂
......@@ -243,8 +243,8 @@ public class NetConfig {
public static final String URL_GAME_WITHDRAW_LIST = "app/v1/game/ddcy/withdraw_list";//兑换列表
public static final String URL_GAME_DOWD = "app/v1/game/ddcy/do_wd";//兑换接口
public static final String URL_GAME_WD_HISTORY = "app/v1/game/ddcy/wd_history";//兑换记录
public static final String URL_GAME_ACCELERATORS_TASK_RECEIVE = "app/v1/game/ddcy/accelerators_task_receive";//兑换记录
public static final String URL_GAME_USER_GUIDE = "app/v1/game/ddcy/user_guide";//兑换记录
public static final String URL_GAME_ACCELERATORS_TASK_RECEIVE = "app/v1/game/ddcy/accelerators_task_receiveV2";//加速剂任务领取
public static final String URL_GAME_USER_GUIDE = "app/v1/game/ddcy/user_guide";
public static final String URL_GAME_RED_PACK_LIST="app/v1/game/farm/rp_list";//红包列表
public static final String URL_GAME_RED_PACK_RECEIVE="app/v1/game/farm/rp/receive";//拆红包 参数传红包id
......@@ -272,5 +272,6 @@ public class NetConfig {
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";//看领金币视频任务
public static final String URL_GAME_WAREHOUSEDATA = "app/v1/game/ddcy/warehouseData";//仓库列表
}
}
......@@ -5,13 +5,11 @@ import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
import com.bird.angel.AdConfig;
import com.ym.admodule.config.AdManager;
import com.ym.admodule.listener.ZXADVideoListener;
import com.ym.library.listener.IAdVideoListener;
import com.ym.library.module.NewsEntity;
import com.ym.library.module.ShaveListEntity;
import com.ym.library.net.GameApiClient;
import com.ym.library.router.RounterApi;
import com.ym.library.router.RounterBus;
import com.ym.library.rxbus.BusData;
......
......@@ -17,7 +17,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="16dp"
android:src="@drawable/download_close_icon" />
/>
<TextView
android:layout_width="wrap_content"
......
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