Commit 7b21ac56 authored by xw's avatar xw

[提交人]:王雪伟

[提交简述] :多多花园1.0.2
[实现方案] :1. 调整大图广告大小
        2. 种植弹窗改为原生,加入大图广告
        3. 土地加入生虫状态,看视频除虫
        4. 点击收获时,作物状态立马变为可种植
parent 9aef012b
...@@ -76,7 +76,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -76,7 +76,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
openNotif() openNotif()
} }
"close_notif" -> { "close_notif" -> {
scc?.let { unbindService(it) } if(scc!=null){
unbindService(scc)
}
} }
} }
}, { }, {
...@@ -95,7 +97,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -95,7 +97,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
override fun onDestroy() { override fun onDestroy() {
scc?.let { unbindService(it) } unbindService(scc)
super.onDestroy() super.onDestroy()
if (mRefreshLoginObservable != null) { if (mRefreshLoginObservable != null) {
RxBus.get().unregister("refresh_login", mRefreshLoginObservable!!)//页面销毁的时候要执行 反注册 RxBus.get().unregister("refresh_login", mRefreshLoginObservable!!)//页面销毁的时候要执行 反注册
...@@ -111,12 +113,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -111,12 +113,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
MobclickAgent.onResume(this) MobclickAgent.onResume(this)
Log.d("wxw", "onResume") Log.d("I/Unity", "onResume")
EventUtils.onEvent( EventUtils.onEvent(
"page_status", "page_status",
Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "GameActivity", "onResume")) Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "GameActivity", "onResume"))
) )
callUnity("Form_land", "getLandList", "")
} }
override fun onPause() { override fun onPause() {
...@@ -342,21 +343,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -342,21 +343,21 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
* 获取地块列表 * 获取地块列表
* */ * */
fun getListLand(callback: IUnitySendMessageCallback?) { fun getListLand(callback: IUnitySendMessageCallback?) {
GameApiClient.gameApi.getListLand().compose(RxSchedulers.observableIO2Main()) // GameApiClient.gameApi.getListLand().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<LandListEntity>>() { // .subscribe(object : BaseObserver<NewLandListEntity>() {
override fun onSuccess(result: List<LandListEntity>?) { // override fun onSuccess(result: NewLandListEntity?) {
Log.d("wxw", "地块列表" + "{\"landList\":" + Utils.obj2Str(result) + "}") // Log.d("wxw", "地块列表" + "{\"landList\":" + Utils.obj2Str(result) + "}")
callback?.onFarmLandListSuccess( // callback?.onFarmLandListSuccess(
true, // true,
"{\"landList\":" + Utils.obj2Str(result) + "}" // "{\"landList\":" + Utils.obj2Str(result) + "}"
) // )
} // }
//
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { // override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "地块列表 error") // Log.d("wxw", "地块列表 error")
callback?.onFarmLandListSuccess(false, "LandError") // callback?.onFarmLandListSuccess(false, "LandError")
} // }
}) // })
} }
/** /**
...@@ -365,9 +366,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -365,9 +366,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun getListLandNew(from: Int) { fun getListLandNew(from: Int) {
Log.d("Wxw", "初始化地块列表成功$from") Log.d("Wxw", "初始化地块列表成功$from")
GameApiClient.gameApi.getListLand().compose(RxSchedulers.observableIO2Main()) GameApiClient.gameApi.getListLand().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<LandListEntity>>() { .subscribe(object : BaseObserver<NewLandListEntity>() {
override fun onSuccess(result: List<LandListEntity>?) { override fun onSuccess(result: NewLandListEntity?) {
var json = "{\"landList\":" + Utils.obj2Str(result) + "}" var json = 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)
...@@ -533,59 +534,87 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -533,59 +534,87 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
}) })
} }
}
//解锁地块
// GameApiClient.gameApi.getCloudSpeed().compose(RxSchedulers.observableIO2Main()) fun getUnlockLand(callback: IUnitySendMessageCallback?, id: Int, type: Int) {
Log.d("wxw", "解锁地块 id" + id + "type" + type)//同步
// GameApiClient.gameApi.getUnlockLand(id, type).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)) // result?.id = id
// callback?.onCloudSpeedSuccess(true, Utils.obj2Str(result)) // result?.type = type
// Log.d("wxw", "解锁地块" + Utils.obj2Str(result))
// callback?.onLandUnLockSuccess(true, Utils.obj2Str(result))
// } // }
// //
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { // override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
// Log.d("wxw", "云朵加速 error") // Log.d("wxw", "解锁地块 error")
// callback?.onCloudSpeedSuccess(false, errorMsg + "") // callback?.onLandUnLockSuccess(false, errorMsg + "")
// } // }
// }) // })
} }
//解锁地块 //解锁地块本地同步服务端 解锁地块传1 种植种子传2 收获果实传3 解锁倒计时4
fun getUnlockLand(callback: IUnitySendMessageCallback?, id: Int, type: Int) { fun getUnlockLandNew(id: Int, type: Int, time: Int) {
Log.d("wxw", "解锁地块 id" + id + "type" + type)//同步 Log.d("wxw", "解锁地块 id" + id + "type" + type + "time" + time)//同步
GameApiClient.gameApi.getUnlockLand(id, type).compose(RxSchedulers.observableIO2Main()) GameApiClient.gameApi.getUnlockLand(id, type, time)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() { .subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) { override fun onSuccess(result: StatusEntity?) {
result?.id = id Log.d("wxw", "同步解锁地块")
result?.type = type getListLandNew(2);
Log.d("wxw", "解锁地块" + Utils.obj2Str(result))
callback?.onLandUnLockSuccess(true, Utils.obj2Str(result))
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "解锁地块 error") Log.d("wxw", "同步解锁地块 error")
callback?.onLandUnLockSuccess(false, errorMsg + "")
} }
}) })
} }
//解锁地块本地同步服务端 //看视频除虫
fun getUnlockLandNew(id: Int, type: Int) { fun lookAdVideoCleanWorm(id: Int) {
Log.d("wxw", "解锁地块 id" + id + "type" + type)//同步 this.runOnUiThread(object : Runnable {
GameApiClient.gameApi.getUnlockLand(id, type).compose(RxSchedulers.observableIO2Main()) override fun run() {
.subscribe(object : BaseObserver<StatusEntity>() { MainDialog.showDialogWorm(this@GameActivity, View.OnClickListener {
override fun onSuccess(result: StatusEntity?) { AdUtils.playRewardAd(
Log.d("wxw", "同步解锁地块") this@GameActivity,
if(type==1){ "CleanWorm",
getListLandNew(2); object : IAdVideoListener {
override fun onAdClose() {
getUnlockLandNew(id, 4, 0)
} }
override fun onError(errorMsg: String?) {
} }
})
})
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "同步解锁地块 error")
} }
}) })
} }
fun seedNotEnoughDialog(id: Int, seedPrice: Int, seedVideoNum: Int) {
this.runOnUiThread(object : Runnable {
override fun run() {
MainDialog.showDialogSeedNotEnough(this@GameActivity, id, seedPrice, seedVideoNum,
View.OnClickListener {
//买种子
callUnity("Form_land", "onBuySeed", "")
}, View.OnClickListener {
//看视频领取种子
callUnity("Form_land", "onVideoSeedReceive", "")
})
}
})
}
//看视频解锁地块 //看视频解锁地块
fun lookAdVideoUnLockLand() { fun lookAdVideoUnLockLand() {
AdUtils.playRewardAd( AdUtils.playRewardAd(
...@@ -633,8 +662,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -633,8 +662,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
//金币购买种子 //金币购买种子
fun getBuySeed(callback: IUnitySendMessageCallback?, id: Int) { fun getBuySeed(id: Int, time: Int) {
GameApiClient.gameApi.getBuySeed(id).compose(RxSchedulers.observableIO2Main()) Log.d("wxw", "金币购买种子id" + id + "time" + time);
GameApiClient.gameApi.getBuySeed(id, time).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))
...@@ -714,43 +744,43 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -714,43 +744,43 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
//看视频领取种子 //看视频领取种子
var videoSeedClick = true var videoSeedClick = true
fun getVideoSeedReceive(callback: IUnitySendMessageCallback?, id: Int) { fun getVideoSeedReceive(callback: IUnitySendMessageCallback?, id: Int) {
if (videoSeedClick) { // if (videoSeedClick) {
videoSeedClick = false // videoSeedClick = false
AdUtils.playRewardAd( // AdUtils.playRewardAd(
this@GameActivity, // this@GameActivity,
"receive_seed_click", // "receive_seed_click",
object : IAdVideoListener { // object : IAdVideoListener {
override fun onAdClose() { // override fun onAdClose() {
videoSeedClick = true // videoSeedClick = true
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?) {
result?.id = id // result?.id = id
Log.d("wxw", "看视频领取种子" + Utils.obj2Str(result)) // Log.d("wxw", "看视频领取种子" + Utils.obj2Str(result))
callback?.onIncrVideoSeedSuccess(true, Utils.obj2Str(result)) // callback?.onIncrVideoSeedSuccess(true, Utils.obj2Str(result))
} // }
//
override fun onFailure( // override fun onFailure(
e: Throwable?, // e: Throwable?,
code: String?, // code: String?,
errorMsg: String? // errorMsg: String?
) { // ) {
Log.d("wxw", "看视频领取种子 error") // Log.d("wxw", "看视频领取种子 error")
callback?.onIncrVideoSeedSuccess(false, errorMsg + "") // callback?.onIncrVideoSeedSuccess(false, errorMsg + "")
} // }
}) // })
} // }
//
override fun onError(errorMsg: String?) { // override fun onError(errorMsg: String?) {
videoSeedClick = true // videoSeedClick = true
} // }
}) // })
} // }
} }
//看视频领取种子 本地处理 新 //看视频领取种子 本地处理 新
fun getVideoSeedReceiveNew(id: Int) { fun getVideoSeedReceiveNew(id: Int, time: Int) {
if (videoSeedClick) { if (videoSeedClick) {
videoSeedClick = false videoSeedClick = false
AdUtils.playRewardAd( AdUtils.playRewardAd(
...@@ -759,7 +789,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -759,7 +789,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
object : IAdVideoListener { object : IAdVideoListener {
override fun onAdClose() { override fun onAdClose() {
videoSeedClick = true videoSeedClick = true
GameApiClient.gameApi.getVideoSeedReceive(id) GameApiClient.gameApi.getVideoSeedReceive(id, time)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() { .subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) { override fun onSuccess(result: StatusEntity?) {
...@@ -939,13 +969,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -939,13 +969,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
private var myNotifService: NotificationService? = null private var myNotifService: NotificationService? = null
private var scc: ServiceConnection? = null private var scc: ServiceConnection = object : ServiceConnection {
//打开通知栏
private fun openNotif() {
if (SettingPreference.getNotice()) {
val intent = Intent(this, NotificationService::class.java)
scc = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName, service: IBinder) { override fun onServiceConnected(name: ComponentName, service: IBinder) {
val myBinder: NotificationService.MyBinder = val myBinder: NotificationService.MyBinder =
service as NotificationService.MyBinder service as NotificationService.MyBinder
...@@ -954,6 +978,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -954,6 +978,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override fun onServiceDisconnected(name: ComponentName) {} override fun onServiceDisconnected(name: ComponentName) {}
} }
//打开通知栏
private fun openNotif() {
if (SettingPreference.getNotice()) {
val intent = Intent(this, NotificationService::class.java)
bindService(intent, scc as ServiceConnection, BIND_AUTO_CREATE) bindService(intent, scc as ServiceConnection, BIND_AUTO_CREATE)
} }
} }
...@@ -1024,7 +1053,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1024,7 +1053,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
fun showCloudDialog(speedtime: Int, sppedtimes: Int) { fun showCloudDialog(speedtime: Int, sppedtimes: Int) {
Log.d("wxw", "雲朵加速");
MainLooper.get()?.post(Runnable { MainLooper.get()?.post(Runnable {
// CashExchangeDialog.showCashExchage(this, this) // CashExchangeDialog.showCashExchage(this, this)
MainDialog.showDialogCloud(this, speedtime, sppedtimes, View.OnClickListener { MainDialog.showDialogCloud(this, speedtime, sppedtimes, View.OnClickListener {
......
...@@ -2,6 +2,7 @@ package com.ym.game.adapter ...@@ -2,6 +2,7 @@ package com.ym.game.adapter
import android.animation.AnimatorSet import android.animation.AnimatorSet
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.text.Html import android.text.Html
...@@ -31,10 +32,10 @@ import com.ym.modulecommon.base.NoDoubleClickListener ...@@ -31,10 +32,10 @@ import com.ym.modulecommon.base.NoDoubleClickListener
class CashExchangeAdapter : class CashExchangeAdapter :
BaseRecyclerAdapter<WithDrawEntity2.WdList, CashExchangeAdapter.ViewHolder> { BaseRecyclerAdapter<WithDrawEntity2.WdList, CashExchangeAdapter.ViewHolder> {
private var mContext: Context? = null private var mContext: Activity? = null
private var dialog:Dialog?=null private var dialog:Dialog?=null
constructor( constructor(
content: Context?, content: Activity?,
mDialog: Dialog mDialog: Dialog
) : super() { ) : super() {
mContext = content mContext = content
...@@ -52,7 +53,9 @@ class CashExchangeAdapter : ...@@ -52,7 +53,9 @@ class CashExchangeAdapter :
} else { } else {
holder.item_mark?.visibility = View.GONE holder.item_mark?.visibility = View.GONE
} }
holder.item_icon?.let { setImage(it, bean.id) } if (holder.item_icon!=null&&bean.id!=null){
setImage(holder.item_icon!!, bean.id)
}
holder.item_cash?.text = bean.cashStr holder.item_cash?.text = bean.cashStr
holder.item_unit?.text = bean.unit holder.item_unit?.text = bean.unit
holder.item_progress?.max = bean.targetNum!! holder.item_progress?.max = bean.targetNum!!
...@@ -161,37 +164,37 @@ class CashExchangeAdapter : ...@@ -161,37 +164,37 @@ class CashExchangeAdapter :
} }
} }
fun setImage(img: ImageView, id: Int) { fun setImage(img: ImageView?, id: Int) {
when (id) { when (id) {
0 -> { 0 -> {
img.setImageResource(R.mipmap.ic_zuanshi) img?.setImageResource(R.mipmap.ic_zuanshi)
} }
1 -> { 1 -> {
img.setImageResource(R.mipmap.icon_flower_one) img?.setImageResource(R.mipmap.icon_flower_one)
} }
2 -> { 2 -> {
img.setImageResource(R.mipmap.icon_flower_two) img?.setImageResource(R.mipmap.icon_flower_two)
} }
3 -> { 3 -> {
img.setImageResource(R.mipmap.icon_flower_three) img?.setImageResource(R.mipmap.icon_flower_three)
} }
4 -> { 4 -> {
img.setImageResource(R.mipmap.icon_flower_four) img?.setImageResource(R.mipmap.icon_flower_four)
} }
5 -> { 5 -> {
img.setImageResource(R.mipmap.icon_flower_five) img?.setImageResource(R.mipmap.icon_flower_five)
} }
6 -> { 6 -> {
img.setImageResource(R.mipmap.icon_flower_six) img?.setImageResource(R.mipmap.icon_flower_six)
} }
7 -> { 7 -> {
img.setImageResource(R.mipmap.icon_flower_seven) img?.setImageResource(R.mipmap.icon_flower_seven)
} }
8 -> { 8 -> {
img.setImageResource(R.mipmap.icon_flower_eight) img?.setImageResource(R.mipmap.icon_flower_eight)
} }
9 -> { 9 -> {
img.setImageResource(R.mipmap.icon_flower_eight) img?.setImageResource(R.mipmap.icon_flower_eight)
} }
} }
} }
......
package com.ym.game.view package com.ym.game.view
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.view.Gravity import android.view.Gravity
...@@ -27,7 +28,7 @@ object CashExchangeDialog : CashExchangeContract.View { ...@@ -27,7 +28,7 @@ object CashExchangeDialog : CashExchangeContract.View {
private var cashExchangeAdapter: CashExchangeAdapter? = null private var cashExchangeAdapter: CashExchangeAdapter? = null
//展示兑换窗口 //展示兑换窗口
fun showCashExchage(context: Context?, mListener: IDialogViewCloseCallback) { fun showCashExchage(context: Activity?, mListener: IDialogViewCloseCallback) {
if (context == null) { if (context == null) {
return return
} }
...@@ -67,6 +68,9 @@ object CashExchangeDialog : CashExchangeContract.View { ...@@ -67,6 +68,9 @@ object CashExchangeDialog : CashExchangeContract.View {
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if (context.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
......
...@@ -97,6 +97,9 @@ object MainDialog { ...@@ -97,6 +97,9 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
...@@ -198,6 +201,9 @@ object MainDialog { ...@@ -198,6 +201,9 @@ object MainDialog {
}) })
mDialog.setCanceledOnTouchOutside(false) mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false) mDialog.setCancelable(false)
if(context.isFinishing){
return
}
mDialog.show() mDialog.show()
} }
...@@ -234,9 +240,9 @@ object MainDialog { ...@@ -234,9 +240,9 @@ object MainDialog {
} }
} }
//
fun showopenBox( fun showopenBox(
context: Context?, context: Activity?,
type: Int, type: Int,
adType: String, adType: String,
rewardCount: Int, rewardCount: Int,
...@@ -342,12 +348,15 @@ object MainDialog { ...@@ -342,12 +348,15 @@ object MainDialog {
}) })
mDialog.setCanceledOnTouchOutside(false) mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false) mDialog.setCancelable(false)
if(context.isFinishing){
return
}
mDialog.show() mDialog.show()
} }
//福利中心开宝箱 //福利中心开宝箱
fun showWelfareOpenBox( fun showWelfareOpenBox(
context: Context?, context: Activity?,
results: List<FlyBoxEntity>, results: List<FlyBoxEntity>,
mListener: IDialogViewCloseCallback mListener: IDialogViewCloseCallback
) { ) {
...@@ -416,12 +425,15 @@ object MainDialog { ...@@ -416,12 +425,15 @@ object MainDialog {
}) })
mDialog.setCanceledOnTouchOutside(false) mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false) mDialog.setCancelable(false)
if(context.isFinishing){
return
}
mDialog.show() mDialog.show()
} }
//提现弹窗 //提现弹窗
fun showWithDraw( fun showWithDraw(
context: Context?, context: Activity?,
status: Int, status: Int,
title: String, title: String,
reason: String, reason: String,
...@@ -430,8 +442,8 @@ object MainDialog { ...@@ -430,8 +442,8 @@ object MainDialog {
id: Int?, id: Int?,
type: Int?, type: Int?,
jine: String?, jine: String?,
isWelfarePage:Boolean, isWelfarePage: Boolean,
dialog:Dialog dialog: Dialog
) { ) {
if (context == null) { if (context == null) {
...@@ -458,7 +470,7 @@ object MainDialog { ...@@ -458,7 +470,7 @@ object MainDialog {
EventUtils.onEvent("show_xinshou0.3", "新手0.3") EventUtils.onEvent("show_xinshou0.3", "新手0.3")
} else if (type == 4) { } else if (type == 4) {
EventUtils.onEvent("show_fuli0.3", "福利0.3") EventUtils.onEvent("show_fuli0.3", "福利0.3")
} else if (type == 7){ } else if (type == 7) {
EventUtils.onEvent("welfare_withdraw_success_dialog_show") EventUtils.onEvent("welfare_withdraw_success_dialog_show")
} else if (type == 8) { } else if (type == 8) {
EventUtils.onEvent("attendance_withdraw_success_dialog_show") EventUtils.onEvent("attendance_withdraw_success_dialog_show")
...@@ -511,14 +523,14 @@ object MainDialog { ...@@ -511,14 +523,14 @@ object MainDialog {
imggoon.setOnClickListener { imggoon.setOnClickListener {
if (buttonStatus == 0) { if (buttonStatus == 0) {
mDialog.dismiss() mDialog.dismiss()
} else if (buttonStatus == 1){ } else if (buttonStatus == 1) {
mDialog.dismiss() mDialog.dismiss()
dialog.dismiss() dialog.dismiss()
if (!isWelfarePage) { if (!isWelfarePage) {
JumpUtils.jumpWelfareActivity() JumpUtils.jumpWelfareActivity()
} }
// JumpUtils.h5Jump("每日福利", Constant.Param.WelfareCenter, false, context as Activity) // JumpUtils.h5Jump("每日福利", Constant.Param.WelfareCenter, false, context as Activity)
}else if (buttonStatus == 2){ } else if (buttonStatus == 2) {
mDialog.dismiss() mDialog.dismiss()
dialog.dismiss() dialog.dismiss()
} }
...@@ -529,6 +541,9 @@ object MainDialog { ...@@ -529,6 +541,9 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(context.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
...@@ -547,6 +562,9 @@ object MainDialog { ...@@ -547,6 +562,9 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
...@@ -580,8 +598,12 @@ object MainDialog { ...@@ -580,8 +598,12 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
// 云朵加速的弹窗 // 云朵加速的弹窗
fun showDialogCloud( fun showDialogCloud(
activity: Activity?, activity: Activity?,
...@@ -602,7 +624,8 @@ object MainDialog { ...@@ -602,7 +624,8 @@ object MainDialog {
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad) val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad)
AdUtils.showFeedAd(activity, "cloud_speed_bigimage", layoutAd) AdUtils.showFeedAd(activity, "cloud_speed_bigimage", layoutAd)
mDialogView.findViewById<TextView>(R.id.id_tv_speed_time)?.text = "所有土地获得${speedtime}分钟加速" 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<TextView>(R.id.id_cloud_speed_num)?.text =
"每天晚上0点重置视频次数(剩余${speedtimes}次)"
mDialogView.findViewById<ImageView>(R.id.id_img_close_cloud_speed).setOnClickListener { mDialogView.findViewById<ImageView>(R.id.id_img_close_cloud_speed).setOnClickListener {
mDialog.dismiss() mDialog.dismiss()
} }
...@@ -621,8 +644,108 @@ object MainDialog { ...@@ -621,8 +644,108 @@ object MainDialog {
}) })
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
//生虫弹窗
fun showDialogWorm(
activity: Activity?,
onClickListener: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView = showBottomDialog(
R.layout.dialog_worm,
activity,
mDialog,
0,
Gravity.CENTER
)
EventUtils.onEvent("show_clean_worm_dialog", "除虫弹窗")
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad)
AdUtils.showFeedAd(activity, "clean_worm", layoutAd)
mDialogView.findViewById<ImageView>(R.id.id_img_close_clean_worm).setOnClickListener {
mDialog.dismiss()
}
mDialogView.findViewById<ImageView>(R.id.id_img_clean_worm).setOnClickListener {
EventUtils.onEvent("click_clean_worm_video_btn", "除虫看视频点击")
onClickListener.onClick(it)
mDialog.dismiss()
}
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) {
onDestroy()
AdUtils.loadFeedCacheAdToCache(activity)
}
})
mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false)
if(activity.isFinishing){
return
}
mDialog?.show()
}
//种子不足弹窗
fun showDialogSeedNotEnough(
activity: Activity?,
id: Int?,
seedPrice: Int?,
seedVideo: Int?,
buySeedOnClickListener: View.OnClickListener,
receiveSeedOnClickListener: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView = showBottomDialog(
R.layout.dialog_seed_not_enough,
activity,
mDialog,
0,
Gravity.CENTER
)
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad)
AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layoutAd)
mDialogView.findViewById<TextView>(R.id.id_tv_seed_price)?.text = "$seedPrice"
mDialogView.findViewById<TextView>(R.id.id_tv_seed_video_num)?.text =
"每天晚上0点重置视频次数(剩余${seedVideo}次)"
var seedImg = mDialogView.findViewById<ImageView>(R.id.id_seed_not_enough_img);
if (id != null) {
setImage(seedImg, id)
}
mDialogView.findViewById<ImageView>(R.id.id_img_close_seed_dialog).setOnClickListener {
mDialog.dismiss()
}
//买种子
mDialogView.findViewById<RelativeLayout>(R.id.id_img_bug_seed).setOnClickListener {
buySeedOnClickListener.onClick(it)
mDialog.dismiss()
}
//看视频领取种子
mDialogView.findViewById<ImageView>(R.id.id_img_receive_seed).setOnClickListener {
receiveSeedOnClickListener.onClick(it)
mDialog.dismiss()
}
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) {
onDestroy()
AdUtils.loadFeedCacheAdToCache(activity)
}
})
mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false)
if(activity.isFinishing){
return
}
mDialog?.show()
}
/** /**
* 添加点击缩放效果 * 添加点击缩放效果
*/ */
...@@ -641,7 +764,6 @@ object MainDialog { ...@@ -641,7 +764,6 @@ object MainDialog {
} }
} }
fun onDestroy() { fun onDestroy() {
if (adView != null) { if (adView != null) {
if (adView is NativeExpressADView) { if (adView is NativeExpressADView) {
......
...@@ -66,7 +66,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti ...@@ -66,7 +66,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
var anim_mask_layout: ViewGroup? = null var anim_mask_layout: ViewGroup? = null
//展示拼图窗口 //展示拼图窗口
fun showPuzzleDialog(context: Context?,mListener: IDialogViewCloseCallback) { fun showPuzzleDialog(context: Activity?,mListener: IDialogViewCloseCallback) {
if (context == null) { if (context == null) {
return return
} }
...@@ -119,6 +119,9 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti ...@@ -119,6 +119,9 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if (context.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
......
...@@ -52,6 +52,12 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View, ...@@ -52,6 +52,12 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
fun init(mContext: Activity?, mListener: IDialogViewCloseCallback) { fun init(mContext: Activity?, mListener: IDialogViewCloseCallback) {
this.mListener = mListener this.mListener = mListener
this.mContext = mContext this.mContext = mContext
if (mContext==null){
return
}
if (mContext.isFinishing){
return
}
// ToponManager.initNativeAd((mContext as Activity), AdID.AD_DAILY_DRIP_BIGIMAGE) // ToponManager.initNativeAd((mContext as Activity), AdID.AD_DAILY_DRIP_BIGIMAGE)
// ToponManager.initNativeAd((mContext as Activity), AdID.AD_LUCKY_DAILY_WATER_VIDEO) // ToponManager.initNativeAd((mContext as Activity), AdID.AD_LUCKY_DAILY_WATER_VIDEO)
// ToponManager.initRewardAd((mContext as Activity), AdID.AD_LUCKY_WATER_HIGH_VIDEO) // ToponManager.initRewardAd((mContext as Activity), AdID.AD_LUCKY_WATER_HIGH_VIDEO)
......
...@@ -44,6 +44,12 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View, ...@@ -44,6 +44,12 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
fun init(mContext: Activity?, mListener: IDialogViewCloseCallback) { fun init(mContext: Activity?, mListener: IDialogViewCloseCallback) {
this.mListener = mListener this.mListener = mListener
this.mContext = mContext this.mContext = mContext
if (mContext==null){
return
}
if (mContext.isFinishing){
return
}
RxBusUtil.getDefault().register(this) RxBusUtil.getDefault().register(this)
mPresenter = SpeedWaterPresenter(this) mPresenter = SpeedWaterPresenter(this)
view = LayoutInflater.from(mContext).inflate(R.layout.layout_popup_speedwater, null) view = LayoutInflater.from(mContext).inflate(R.layout.layout_popup_speedwater, null)
......
...@@ -124,6 +124,9 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View { ...@@ -124,6 +124,9 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if (context.isFinishing){
return
}
mDialog?.show() mDialog?.show()
} }
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/worm_btn" android:state_pressed="false"/>
<item android:drawable="@drawable/worm_btn_press" android:state_pressed="true"/>
</selector>
\ No newline at end of file
...@@ -112,15 +112,16 @@ ...@@ -112,15 +112,16 @@
android:textColor="#864F1C" /> android:textColor="#864F1C" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
<FrameLayout <FrameLayout
android:id="@+id/layout_get_drop_ad" android:id="@+id/layout_get_drop_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="18dp" android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="10dp" android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="18dp" android:layout_marginBottom="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_5"
android:background="@color/white" android:background="@color/white"
android:padding="@dimen/dp_10"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
...@@ -170,13 +170,14 @@ ...@@ -170,13 +170,14 @@
android:id="@+id/layout_get_drop_ad" android:id="@+id/layout_get_drop_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="18dp" android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="5dp" android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="18dp" android:layout_marginBottom="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_5"
android:background="@color/white" android:background="@color/white"
android:padding="@dimen/dp_10"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -115,11 +115,11 @@ ...@@ -115,11 +115,11 @@
android:id="@+id/layout_get_drop_ad2" android:id="@+id/layout_get_drop_ad2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="18dp" android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="5dp" android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="18dp" android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_10"
android:background="@color/white" android:background="@color/white"
android:padding="@dimen/dp_10"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
......
...@@ -170,13 +170,14 @@ ...@@ -170,13 +170,14 @@
android:id="@+id/layout_get_drop_ad" android:id="@+id/layout_get_drop_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="18dp" android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="5dp" android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="18dp" android:layout_marginBottom="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_5"
android:background="@color/white" android:background="@color/white"
android:padding="@dimen/dp_10"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ 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="440dp"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15">
<ImageView
android:layout_width="match_parent"
android:layout_height="370dp"
android:layout_alignParentBottom="true"
android:scaleType="fitXY"
android:src="@mipmap/seed_bg" />
<ImageView
android:id="@+id/id_img_close_seed_dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="75dp"
android:src="@mipmap/icon_new_close" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="420dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginBottom="20dp"
android:layout_marginLeft="@dimen/dp_15"
android:background="@mipmap/seed_bg2">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_50"
android:src="@drawable/seed_title" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_115"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:scaleX="0.8"
android:scaleY="0.8"
android:src="@drawable/icon_light"
android:visibility="visible" />
<ImageView
android:id="@+id/id_seed_not_enough_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/icon_zhongzi_one"
android:visibility="visible" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/id_img_bug_seed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/id_img_receive_seed"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_10">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@drawable/seed_bug_seed_btn" />
<TextView
android:id="@+id/id_tv_seed_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingBottom="7dp"
android:text="0"
android:textColor="#F9D348"
android:textSize="25dp"
android:textStyle="bold" />
</RelativeLayout>
<ImageView
android:id="@+id/id_img_receive_seed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_40"
android:src="@drawable/seed_ad_receive_seed" />
<TextView
android:id="@+id/id_tv_seed_video_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点重置视频次数(剩余10次)"
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="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_10"
android:background="@color/white"
android:visibility="gone" />
</LinearLayout>
<?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_clean_worm"
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/worm_title" />
<LinearLayout
android:id="@+id/id_ll_content"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_centerHorizontal="true"
android:layout_marginLeft="28dp"
android:layout_marginTop="@dimen/dp_115"
android:layout_marginRight="@dimen/dp_26"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/worm_icon" />
</LinearLayout>
<ImageView
android:id="@+id/id_img_clean_worm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_20"
android:src="@drawable/select_clean_worm" />
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:id="@+id/layout_get_drop_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_5"
android:background="@color/white"
android:visibility="gone" />
</LinearLayout>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -39,6 +39,15 @@ public class LandListEntity { ...@@ -39,6 +39,15 @@ public class LandListEntity {
private int acceleratorsNum;//加速剂数量 private int acceleratorsNum;//加速剂数量
private int targetVideoNum;//解锁需看视频数量 private int targetVideoNum;//解锁需看视频数量
private int currentVideoNum;//当前已看视频数量 private int currentVideoNum;//当前已看视频数量
private int stopSecond;//暂停时间点
public int getStopSecond() {
return stopSecond;
}
public void setStopSecond(int stopSecond) {
this.stopSecond = stopSecond;
}
public int getTargetVideoNum() { public int getTargetVideoNum() {
return targetVideoNum; return targetVideoNum;
......
package com.ym.library.module;
import java.util.List;
/**
* @author (wangXuewei)
* @datetime 2020-12-05 16:34 GMT+8
* @detail :
*/
public class NewLandListEntity {
/**
* landList : [{"id":1,"name":"红玫瑰","unlockPrice":0,"seedPrice":5,"profit":7,"second":0,"countDownSecond":0,"status":3,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":60},{"start":41,"countdown":120},{"start":46,"countdown":300},{"start":51,"countdown":480},{"start":71,"countdown":600},{"start":81,"countdown":960},{"start":91,"countdown":1200},{"start":96,"countdown":1500},{"start":141,"countdown":1800},{"start":146,"countdown":3600},{"start":100000,"countdown":3600}],"fruitNum":15,"acceleratorsNum":0,"targetVideoNum":0,"currentVideoNum":0,"stopSecond":0},{"id":2,"name":"紫玫瑰","unlockPrice":5,"seedPrice":10,"profit":15,"second":0,"countDownSecond":0,"status":3,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":120},{"start":41,"countdown":240},{"start":46,"countdown":480},{"start":51,"countdown":600},{"start":71,"countdown":960},{"start":81,"countdown":1200},{"start":91,"countdown":1500},{"start":96,"countdown":1800},{"start":141,"countdown":2400},{"start":146,"countdown":3600},{"start":100000,"countdown":3600}],"fruitNum":5,"acceleratorsNum":0,"targetVideoNum":0,"currentVideoNum":0,"stopSecond":0},{"id":3,"name":"铃兰","unlockPrice":10,"seedPrice":20,"profit":32,"second":0,"countDownSecond":0,"status":1,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":240},{"start":41,"countdown":360},{"start":46,"countdown":480},{"start":51,"countdown":720},{"start":71,"countdown":1080},{"start":81,"countdown":1500},{"start":91,"countdown":1800},{"start":96,"countdown":2400},{"start":141,"countdown":2700},{"start":146,"countdown":3600},{"start":100000,"countdown":3600}],"fruitNum":4,"acceleratorsNum":0,"targetVideoNum":1,"currentVideoNum":0,"stopSecond":0},{"id":4,"name":"菊花","unlockPrice":50,"seedPrice":30,"profit":52,"second":0,"countDownSecond":0,"status":1,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":480},{"start":41,"countdown":600},{"start":46,"countdown":720},{"start":51,"countdown":960},{"start":71,"countdown":1200},{"start":81,"countdown":1680},{"start":91,"countdown":2160},{"start":96,"countdown":2700},{"start":141,"countdown":3000},{"start":146,"countdown":3600},{"start":100000,"countdown":3600}],"fruitNum":8,"acceleratorsNum":0,"targetVideoNum":1,"currentVideoNum":0,"stopSecond":0},{"id":5,"name":"蝴蝶兰","unlockPrice":100,"seedPrice":50,"profit":90,"second":0,"countDownSecond":0,"status":1,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":720},{"start":41,"countdown":960},{"start":46,"countdown":1200},{"start":51,"countdown":1800},{"start":71,"countdown":2400},{"start":81,"countdown":3000},{"start":91,"countdown":3600},{"start":96,"countdown":4500},{"start":141,"countdown":5400},{"start":146,"countdown":5400},{"start":100000,"countdown":5400}],"fruitNum":2,"acceleratorsNum":0,"targetVideoNum":1,"currentVideoNum":0,"stopSecond":0},{"id":6,"name":"郁金香","unlockPrice":200,"seedPrice":100,"profit":144,"second":0,"countDownSecond":0,"status":3,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":960},{"start":41,"countdown":1200},{"start":46,"countdown":1800},{"start":51,"countdown":2400},{"start":71,"countdown":3000},{"start":81,"countdown":3600},{"start":91,"countdown":4500},{"start":96,"countdown":5400},{"start":141,"countdown":7200},{"start":146,"countdown":7200},{"start":100000,"countdown":7200}],"fruitNum":2,"acceleratorsNum":0,"targetVideoNum":1,"currentVideoNum":0,"stopSecond":0},{"id":7,"name":"风信子","unlockPrice":300,"seedPrice":200,"profit":256,"second":0,"countDownSecond":0,"status":1,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":1200},{"start":41,"countdown":1800},{"start":46,"countdown":2400},{"start":51,"countdown":3000},{"start":71,"countdown":3600},{"start":81,"countdown":4500},{"start":91,"countdown":5400},{"start":96,"countdown":7200},{"start":141,"countdown":9000},{"start":146,"countdown":9000},{"start":100000,"countdown":9000}],"fruitNum":3,"acceleratorsNum":0,"targetVideoNum":1,"currentVideoNum":0,"stopSecond":0},{"id":8,"name":"七色花","unlockPrice":500,"seedPrice":300,"profit":388,"second":0,"countDownSecond":0,"status":1,"seedNum":0,"cloudSecond":10,"acceleratorsSecond":15,"guideStatus":0,"growList":[{"start":31,"countdown":1800},{"start":41,"countdown":2400},{"start":46,"countdown":3000},{"start":51,"countdown":3600},{"start":71,"countdown":4500},{"start":81,"countdown":5400},{"start":91,"countdown":7200},{"start":96,"countdown":9000},{"start":141,"countdown":10800},{"start":146,"countdown":10800},{"start":100000,"countdown":10800}],"fruitNum":1,"acceleratorsNum":0,"targetVideoNum":1,"currentVideoNum":0,"stopSecond":0}]
* rate : 50
* configNum : 2
*/
private int rate;
private int configNum;
private float timeRate;
private List<LandListEntity> landList;
public float getTimeRate() {
return timeRate;
}
public void setTimeRate(float timeRate) {
this.timeRate = timeRate;
}
public int getRate() {
return rate;
}
public void setRate(int rate) {
this.rate = rate;
}
public int getConfigNum() {
return configNum;
}
public void setConfigNum(int configNum) {
this.configNum = configNum;
}
public List<LandListEntity> getLandList() {
return landList;
}
public void setLandList(List<LandListEntity> landList) {
this.landList = landList;
}
}
...@@ -38,7 +38,7 @@ interface IGameApi { ...@@ -38,7 +38,7 @@ interface IGameApi {
* @return * @return
*/ */
@GET(NetConfig.Game.URL_GAME_LIST_LAND) @GET(NetConfig.Game.URL_GAME_LIST_LAND)
fun getListLand(): Observable<Response<List<LandListEntity>>> fun getListLand(): Observable<Response<NewLandListEntity>>
/** /**
* 云朵加速 * 云朵加速
...@@ -58,7 +58,8 @@ interface IGameApi { ...@@ -58,7 +58,8 @@ interface IGameApi {
@POST(NetConfig.Game.URL_GAME_UNLOCK_LAND) @POST(NetConfig.Game.URL_GAME_UNLOCK_LAND)
fun getUnlockLand( fun getUnlockLand(
@Query("id") id: Int, @Query("id") id: Int,
@Query("type") type: Int @Query("type") type: Int,
@Query("second") second: Int
): Observable<Response<StatusEntity>> ): Observable<Response<StatusEntity>>
/** /**
...@@ -77,7 +78,7 @@ interface IGameApi { ...@@ -77,7 +78,7 @@ interface IGameApi {
* @return * @return
*/ */
@POST(NetConfig.Game.URL_GAME_BUY_SEED) @POST(NetConfig.Game.URL_GAME_BUY_SEED)
fun getBuySeed(@Query("id") id: Int): Observable<Response<StatusEntity>> fun getBuySeed(@Query("id") id: Int,@Query("second") second: Int): Observable<Response<StatusEntity>>
/** /**
* 仓库 * 仓库
...@@ -131,7 +132,7 @@ interface IGameApi { ...@@ -131,7 +132,7 @@ interface IGameApi {
* @return * @return
*/ */
@POST(NetConfig.Game.URL_GAME_INCR_SEED) @POST(NetConfig.Game.URL_GAME_INCR_SEED)
fun getVideoSeedReceive(@Query("id") id: Int): Observable<Response<StatusEntity>> fun getVideoSeedReceive(@Query("id") id: Int,@Query("second") second: Int): Observable<Response<StatusEntity>>
/** /**
* 看视频获得加速剂 * 看视频获得加速剂
......
...@@ -234,8 +234,11 @@ public class NetConfig { ...@@ -234,8 +234,11 @@ public class NetConfig {
public static final String URL_GAME_WAREHOUSEDATA = "app/v1/game/ddcy/warehouseData";//仓库列表 public static final String URL_GAME_WAREHOUSEDATA = "app/v1/game/ddcy/warehouseData";//仓库列表
//=========================================花园========================================= //=========================================花园=========================================
public static final String URL_GAME_LIST_LAND = "app/v1/game/ddhy/list_land";//花园地块列表 // public static final String URL_GAME_LIST_LAND = "app/v1/game/ddhy/list_land";//花园地块列表
public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/ddhy/unlock_land";//花园 解锁地块/种植种子/收获果实 public static final String URL_GAME_LIST_LAND = "app/v1/game/ddhy/list_land_V2";//花园地块列表
// public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/ddhy/unlock_land";//花园 解锁地块/种植种子/收获果实
public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/ddhy/unlock_land_V2";//花园 解锁地块/种植种子/收获果实/解锁倒计时
public static final String URL_GAME_ORDER_LIST = "app/v1/game/ddhy/list_order";//花园 订单列表 public static final String URL_GAME_ORDER_LIST = "app/v1/game/ddhy/list_order";//花园 订单列表
public static final String URL_GAME_WITHDRAW_LIST = "app/v1/game/ddhy/withdraw_list";//兑换列表 public static final String URL_GAME_WITHDRAW_LIST = "app/v1/game/ddhy/withdraw_list";//兑换列表
public static final String URL_GAME_DOWD = "app/v1/game/ddhy/do_wd";//兑换接口 public static final String URL_GAME_DOWD = "app/v1/game/ddhy/do_wd";//兑换接口
......
...@@ -70,9 +70,9 @@ object AdUtils { ...@@ -70,9 +70,9 @@ object AdUtils {
ADConfig.AD_IMG_FADE, ADConfig.AD_IMG_FADE,
actionName, actionName,
ZXADSizeConfig( ZXADSizeConfig(
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280 // Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 56, Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt() ((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
), ),
activity, activity,
view view
...@@ -103,8 +103,8 @@ object AdUtils { ...@@ -103,8 +103,8 @@ object AdUtils {
AdManager.loadFeedAdToCache( AdManager.loadFeedAdToCache(
ADConfig.AD_IMG_FADE, activity, ZXADSizeConfig( ADConfig.AD_IMG_FADE, activity, ZXADSizeConfig(
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280 // Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 56, Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt() ((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
) )
) )
} }
......
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="135"
android:fromXScale="0.7"
android:fromYScale="0.7"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0"/>
<alpha
android:duration="90"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="150"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="0.6"
android:toYScale="0.6"/>
<alpha
android:duration="150"
android:fromAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="0.0"/>
</set>
\ No newline at end of file
...@@ -110,14 +110,13 @@ ...@@ -110,14 +110,13 @@
android:id="@+id/layout_ad" android:id="@+id/layout_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" android:layout_marginLeft="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="40dp"
android:layout_marginRight="15dp" android:layout_marginBottom="10dp"
android:layout_marginRight="5dp"
android:background="@color/white" android:background="@color/white"
android:padding="10dp"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
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