Commit 1ceaee9d authored by maxiaoliang's avatar maxiaoliang

提交最后代码

parent 5cc21ecc
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
android:launchMode="singleTask" /> <!-- 友盟配置 --> android:launchMode="singleTask" /> <!-- 友盟配置 -->
<meta-data <meta-data
android:name="UMENG_APPKEY" android:name="UMENG_APPKEY"
android:value="5f9bb48945b2b751a91fb2d5" /> android:value="5fe446a944bb94418a636569" />
<meta-data <meta-data
android:name="UMENG_CHANNEL" android:name="UMENG_CHANNEL"
android:value="${UMENG_CHANNEL_VALUE}" /> <!-- 微信配置 --> android:value="${UMENG_CHANNEL_VALUE}" /> <!-- 微信配置 -->
......
...@@ -58,6 +58,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -58,6 +58,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
TurntableDialog.initTurntableAnim() TurntableDialog.initTurntableAnim()
getUserInfo() getUserInfo()
checkUpdateApp() checkUpdateApp()
getBottomInfo()
mRefreshLoginObservable?.observeOn(AndroidSchedulers.mainThread())?.subscribe({ mRefreshLoginObservable?.observeOn(AndroidSchedulers.mainThread())?.subscribe({
when (it) { when (it) {
"not_login" -> { "not_login" -> {
...@@ -101,7 +102,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -101,7 +102,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
override fun onResponse(call: Call, response: Response) { override fun onResponse(call: Call, response: Response) {
Log.d("wxw","xiaomanUrl") Log.d("wxw", "xiaomanUrl")
if (response.isSuccessful) { if (response.isSuccessful) {
val result = response.body()?.string() val result = response.body()?.string()
runOnUiThread { runOnUiThread {
...@@ -111,7 +112,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -111,7 +112,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (xiaoMan.code == "0") { if (xiaoMan.code == "0") {
mXiaoManPlaceMateId = xiaoMan.data.placeMaterialId mXiaoManPlaceMateId = xiaoMan.data.placeMaterialId
json.xiaoManPath = xiaoMan.data.materialPath json.xiaoManPath = xiaoMan.data.materialPath
Log.d("wxw","xiaomanUrl"+ json.xiaoManPath) Log.d("wxw", "xiaomanUrl" + json.xiaoManPath)
//小满上报 //小满上报
if (MyConstant.isReportXiaoman) { if (MyConstant.isReportXiaoman) {
runOnUiThread { runOnUiThread {
...@@ -344,7 +345,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -344,7 +345,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
AdUtils.playRewardAd(this, "box_click", object : IAdVideoListener { AdUtils.playRewardAd(this, "box_click", object : IAdVideoListener {
override fun onAdClose() { override fun onAdClose() {
flyBoxIsClick = true flyBoxIsClick = true
getFlyBoxReceive() getFlyBoxReceive(1)
} }
override fun onError(errorMsg: String?) { override fun onError(errorMsg: String?) {
...@@ -386,6 +387,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -386,6 +387,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (result != null) { if (result != null) {
NetConfig.H5.mDFWType = result.isPopup; NetConfig.H5.mDFWType = result.isPopup;
} }
callback?.onHomeSuccess(true, Utils.obj2Str(result)) callback?.onHomeSuccess(true, Utils.obj2Str(result))
} }
...@@ -623,7 +625,22 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -623,7 +625,22 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() { .subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) { override fun onSuccess(result: StatusEntity?) {
getListLandNew(2); getListLandNew(2)
getBottomInfo()
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
//解锁地块本地同步服务端 解锁地块传1 种植种子传2 收获果实传3 解锁倒计时4
fun getUnlockLandNew2(id: Int, type: Int, time: Int) {
GameApiClient.gameApi.getlockLand(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
getListLandNew(2)
getBottomInfo()
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
...@@ -642,7 +659,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -642,7 +659,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
"CleanWorm", "CleanWorm",
object : IAdVideoListener { object : IAdVideoListener {
override fun onAdClose() { override fun onAdClose() {
getUnlockLandNew(id, 4, 0)
getUnlockLandNew2(id, 4, 0)
} }
override fun onError(errorMsg: String?) { override fun onError(errorMsg: String?) {
...@@ -657,14 +675,20 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -657,14 +675,20 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
} }
fun seedNotEnoughDialog(id: Int, seedPrice: Int, seedVideoNum: Int) { //种子不足
fun seedNotEnoughDialog(id: Int, seedPrice: Int, seedVideoNum: Int, seednum: Int) {
this.runOnUiThread(object : Runnable { this.runOnUiThread(object : Runnable {
override fun run() { override fun run() {
MainDialog.showDialogSeedNotEnough(this@GameActivity, id, seedPrice, seedVideoNum, MainDialog.showDialogSeedNotEnough(this@GameActivity,
id,
seedPrice,
seedVideoNum,
seednum,
View.OnClickListener { View.OnClickListener {
//买种子 //买种子
callUnity("Form_land", "onBuySeed", "") callUnity("Form_land", "onBuySeed", "")
}, View.OnClickListener { },
View.OnClickListener {
//看视频领取种子 //看视频领取种子
callUnity("Form_land", "onVideoSeedReceive", "") callUnity("Form_land", "onVideoSeedReceive", "")
}) })
...@@ -898,8 +922,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -898,8 +922,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
fun getFlyBoxReceive() { fun getFlyBoxReceive(type: Int) {
GameApiClient.gameApi.getopenBox() GameApiClient.gameApi.getopenBox(type)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<FlyBoxEntity>() { .subscribe(object : BaseObserver<FlyBoxEntity>() {
override fun onSuccess(result: FlyBoxEntity?) { override fun onSuccess(result: FlyBoxEntity?) {
...@@ -924,7 +948,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -924,7 +948,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
fun getRedPackPlanReceive() { fun getRedPackPlanReceive() {
GameApiClient.gameApi.getOpenPlantBox() GameApiClient.gameApi.getopenBox(2)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<FlyBoxEntity>() { .subscribe(object : BaseObserver<FlyBoxEntity>() {
override fun onSuccess(result: FlyBoxEntity?) { override fun onSuccess(result: FlyBoxEntity?) {
...@@ -1080,7 +1104,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1080,7 +1104,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
} }
fun showCloudDialog(speedtime: Int, sppedtimes: Int) { // 云朵加速
fun showCloudDialog(speedtime: Int, sppedtimes: Int, type: Int) {
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 {
...@@ -1126,4 +1151,168 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1126,4 +1151,168 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
} }
/**
* 获取底部信息
*/
fun getBottomInfo() {
GameApiClient.gameApi.getGameBottomInfo().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<BottomInfoEntity>() {
override fun onSuccess(result: BottomInfoEntity?) {
if (result != null) {
// callback?.onBottomSuccess(true, Utils.obj2Str(result))
callUnity("TitleView", "BottomMessageData", Utils.obj2Str(result))
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
//callback?.onHomeSuccess(false, errorMsg + "")
}
})
}
/**
* 种子商店
*/
private var isseedclick = false
fun SeedStore() {
if (!isseedclick) {
isseedclick = true
MainLooper.get()?.post(Runnable {
SeedStoreDialog().showSeedStore(this)
})
MainLooper.get()?.postDelayed(Runnable {
isseedclick = false
}, 2000)
}
}
/**
* 杀虫剂
*/
private var isPesticidesclick = false
fun Pesticides(howmany: Int, num: Int) {
if (!isPesticidesclick) {
isPesticidesclick = true
Log.e("MXL", "杀虫剂点击" + num)
MainLooper.get()?.post(Runnable {
if (howmany > 0) {
if (num > 0) {//数量大于0展示弹窗否则看视频获取
MainDialog.showHaveDroporWarm(
this,
2,
0,
howmany,
num,
View.OnClickListener {
lookVideo("bottom_shachongji", 2, 0)
})
} else {
lookVideo("bottom_shachongji", 2, 0)
}
} else {
Utils.showToast(AppliContext.get(), "今日次数已用完,明天再来吧~")
}
})
MainLooper.get()?.postDelayed(Runnable {
isPesticidesclick = false
}, 1000)
}
}
/**
* 浇水弹窗
*/
private var isWaterclick = false
fun wateringSpeed(time: Int, howmany: Int, num: Int) {
if (!isWaterclick) {
isWaterclick = true
MainLooper.get()?.post(Runnable {
if (howmany > 0) {
if (num > 0) {//数量大于0展示弹窗否则看视频获取
MainDialog.showHaveDroporWarm(
this,
1,
time,
howmany,
num,
View.OnClickListener {
lookVideo("bottom_jiaoshui", 1, 0)
})
} else {
//看视频
lookVideo("bottom_jiaoshui", 1, 0)
}
} else {
Utils.showToast(AppliContext.get(), "今日次数已用完,明天再来吧~")
}
}
)
MainLooper.get()?.postDelayed(Runnable {
isWaterclick = false
}, 1000)
}
}
//
fun lookVideo(actionname: String, type: Int, id: Int) {
AdUtils.playRewardAd(this, actionname, object : IAdVideoListener {
override fun onAdClose() {
GameApiClient.gameApi.addprop(id, type)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<AddPropEntity>() {
override fun onSuccess(result: AddPropEntity?) {
if (result != null) {
MainDialog.showAddDrop(
this@GameActivity,
result.awardNum,
result.type,
result.id,
View.OnClickListener {
getBottomInfo()
})
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
override fun onError(errorMsg: String?) {
}
})
}
//飞行宝箱
fun showflyBox(num: Int) {
MainLooper.get()?.post(Runnable {
MainDialog.showGetBox(this, num, View.OnClickListener {
if (num > 0) {
if (flyBoxIsClick) {
flyBoxIsClick = false
AdUtils.playRewardAd(this, "box_click", object : IAdVideoListener {
override fun onAdClose() {
flyBoxIsClick = true
getFlyBoxReceive(1)
}
override fun onError(errorMsg: String?) {
flyBoxIsClick = true
}
})
}
} else {
Utils.showToast(AppliContext.get(), "今日次数已用完,明天再来吧~")
}
})
})
}
} }
\ No newline at end of file
...@@ -56,4 +56,7 @@ interface IUnitySendMessageCallback { ...@@ -56,4 +56,7 @@ interface IUnitySendMessageCallback {
//查询碎片角标 //查询碎片角标
fun onGetCardList(isSuccess: Boolean, result: String) fun onGetCardList(isSuccess: Boolean, result: String)
//首页底部信息
fun onBottomSuccess(isSuccess: Boolean, result: String)
} }
\ No newline at end of file
package com.ym.game.adapter
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.ym.bbnc.R
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.view.MainDialog
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.listener.IAdVideoListener
import com.ym.library.module.AddPropEntity
import com.ym.library.module.FlyBoxEntity
import com.ym.library.module.SeedListEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil
import com.ym.library.rxbus.Subscribe
import com.ym.library.rxbus.ThreadMode
import com.ym.library.utils.AdUtils
import com.ym.library.utils.EventUtils
import com.ym.library.utils.Utils
import com.ym.modulecommon.AppliContext
class SeedStoreAdapter : BaseRecyclerAdapter<SeedListEntity, SeedStoreAdapter.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.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)
}
}
holder.item_ownnum?.text = "拥有 ${bean.ownNum} 个"
holder.item_buy?.addClickScale()
holder.item_buy?.setOnClickListener {
if (bean.subSeedVideoNum > 0) {
EventUtils.onEvent("seed_video_btn"+bean.id+"_click","种子"+bean.id+"购买按钮点击")
AdUtils.playRewardAd(
mContext as Activity,
"seed_video_show",
object : IAdVideoListener {
override fun onAdClose() {
GameApiClient.gameApi.addprop(bean.id, 3)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<AddPropEntity>() {
override fun onSuccess(result: AddPropEntity?) {
if (result != null) {
MainDialog.showAddDrop(
mContext as Activity,
result.awardNum,
result.type,
result.id, View.OnClickListener {
RxBusUtil.getDefault()
.send(RxBusConstant.RX_SEED_STORE_LIST)
}
)
}
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
}
})
}
override fun onError(errorMsg: String?) {
}
})
}else{
Utils.showToast(mContext, "今日次数已用完,明天再来吧~")
}
}
}
/**
* 添加点击缩放效果
*/
fun View.addClickScale(scale: Float = 0.9f, duration: Long = 150) {
this.setOnTouchListener { _, event ->
when (event.action) {
MotionEvent.ACTION_DOWN -> {
this.animate().scaleX(scale).scaleY(scale).setDuration(duration).start()
}
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
this.animate().scaleX(1f).scaleY(1f).setDuration(duration).start()
}
}
// 点击事件处理,交给View自身
this.onTouchEvent(event)
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppliContext.get())
.inflate(R.layout.item_layout_seedstore, parent, false)
)
}
class ViewHolder : RecyclerView.ViewHolder {
var item_img: ImageView?
var item_ownnum: TextView?
var item_buy: ImageView?
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)
item_buy = itemView.findViewById<ImageView>(R.id.id_img_buy_seed)
}
}
}
\ No newline at end of file
package com.ym.game.contract
import com.ym.library.module.SeedListEntity
class SeedStoreContract {
interface View {
fun SeedListResult(result: List<SeedListEntity>)
}
interface Presenter {
fun getSeedList()
}
}
\ No newline at end of file
...@@ -51,7 +51,7 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter { ...@@ -51,7 +51,7 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
fun getFlyBoxReceive(activity: Activity) { fun getFlyBoxReceive(activity: Activity) {
GameApiClient.gameApi.geClockBoxReceive() GameApiClient.gameApi.getopenBox(3)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<FlyBoxEntity>() { .subscribe(object : BaseObserver<FlyBoxEntity>() {
override fun onSuccess(result: FlyBoxEntity?) { override fun onSuccess(result: FlyBoxEntity?) {
......
package com.ym.game.presenter
import com.ym.game.contract.SeedStoreContract
import com.ym.game.contract.WareHouseContract
import com.ym.library.module.FlyBoxEntity
import com.ym.library.module.SeedListEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
class SeedStorePresenter : SeedStoreContract.Presenter {
var mView: SeedStoreContract.View
constructor(mView: SeedStoreContract.View) {
this.mView = mView
}
override fun getSeedList() {
GameApiClient.gameApi.getlistseed().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<List<SeedListEntity>>() {
override fun onSuccess(result: List<SeedListEntity>?) {
if (result != null) {
mView?.SeedListResult(result)
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
})
}
}
\ No newline at end of file
...@@ -93,7 +93,7 @@ object MainDialog { ...@@ -93,7 +93,7 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){ if (activity.isFinishing) {
return return
} }
mDialog?.show() mDialog?.show()
...@@ -197,7 +197,7 @@ object MainDialog { ...@@ -197,7 +197,7 @@ object MainDialog {
}) })
mDialog.setCanceledOnTouchOutside(false) mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false) mDialog.setCancelable(false)
if(context.isFinishing){ if (context.isFinishing) {
return return
} }
mDialog.show() mDialog.show()
...@@ -344,7 +344,7 @@ object MainDialog { ...@@ -344,7 +344,7 @@ object MainDialog {
}) })
mDialog.setCanceledOnTouchOutside(false) mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false) mDialog.setCancelable(false)
if(context.isFinishing){ if (context.isFinishing) {
return return
} }
mDialog.show() mDialog.show()
...@@ -421,7 +421,7 @@ object MainDialog { ...@@ -421,7 +421,7 @@ object MainDialog {
}) })
mDialog.setCanceledOnTouchOutside(false) mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false) mDialog.setCancelable(false)
if(context.isFinishing){ if (context.isFinishing) {
return return
} }
mDialog.show() mDialog.show()
...@@ -438,8 +438,8 @@ object MainDialog { ...@@ -438,8 +438,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) {
...@@ -466,7 +466,7 @@ object MainDialog { ...@@ -466,7 +466,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")
...@@ -474,7 +474,7 @@ object MainDialog { ...@@ -474,7 +474,7 @@ object MainDialog {
if (id != null) { if (id != null) {
when (id) { when (id) {
1 -> { 1 -> {
Log.e("MXL","show_baicai") Log.e("MXL", "show_baicai")
EventUtils.onEvent("show_baicai", "白菜" + jine) EventUtils.onEvent("show_baicai", "白菜" + jine)
} }
2 -> { 2 -> {
...@@ -520,14 +520,14 @@ object MainDialog { ...@@ -520,14 +520,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()
} }
...@@ -538,7 +538,7 @@ object MainDialog { ...@@ -538,7 +538,7 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(context.isFinishing){ if (context.isFinishing) {
return return
} }
mDialog?.show() mDialog?.show()
...@@ -559,7 +559,7 @@ object MainDialog { ...@@ -559,7 +559,7 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){ if (activity.isFinishing) {
return return
} }
mDialog?.show() mDialog?.show()
...@@ -595,11 +595,12 @@ object MainDialog { ...@@ -595,11 +595,12 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){ if (activity.isFinishing) {
return return
} }
mDialog?.show() mDialog?.show()
} }
// 云朵加速的弹窗 // 云朵加速的弹窗
fun showDialogCloud( fun showDialogCloud(
activity: Activity?, activity: Activity?,
...@@ -620,7 +621,8 @@ object MainDialog { ...@@ -620,7 +621,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()
} }
...@@ -632,7 +634,7 @@ object MainDialog { ...@@ -632,7 +634,7 @@ object MainDialog {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){ if (activity.isFinishing) {
return return
} }
mDialog?.show() mDialog?.show()
...@@ -666,19 +668,20 @@ object MainDialog { ...@@ -666,19 +668,20 @@ object MainDialog {
onClickListener.onClick(it) onClickListener.onClick(it)
mDialog.dismiss() mDialog.dismiss()
} }
var cleanWormBtnNoVideo = mDialogView.findViewById<ImageView>(R.id.id_img_clean_worm_no_video) var cleanWormBtnNoVideo =
mDialogView.findViewById<ImageView>(R.id.id_img_clean_worm_no_video)
cleanWormBtnNoVideo.setOnClickListener { cleanWormBtnNoVideo.setOnClickListener {
EventUtils.onEvent("click_clean_worm_btn", "除虫点击") EventUtils.onEvent("click_clean_worm_btn", "除虫点击")
onClickNoVideoListener.onClick(it) onClickNoVideoListener.onClick(it)
mDialog.dismiss() mDialog.dismiss()
} }
//需要看视频 //需要看视频
if (isShow){ if (isShow) {
cleanWormBtn.visibility=View.VISIBLE cleanWormBtn.visibility = View.VISIBLE
cleanWormBtnNoVideo.visibility=View.GONE cleanWormBtnNoVideo.visibility = View.GONE
}else{ } else {
cleanWormBtn.visibility=View.GONE cleanWormBtn.visibility = View.GONE
cleanWormBtnNoVideo.visibility=View.VISIBLE cleanWormBtnNoVideo.visibility = View.VISIBLE
} }
...@@ -690,7 +693,7 @@ object MainDialog { ...@@ -690,7 +693,7 @@ object MainDialog {
}) })
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){ if (activity.isFinishing) {
return return
} }
mDialog?.show() mDialog?.show()
...@@ -703,6 +706,7 @@ object MainDialog { ...@@ -703,6 +706,7 @@ object MainDialog {
id: Int?, id: Int?,
seedPrice: Int?, seedPrice: Int?,
seedVideo: Int?, seedVideo: Int?,
seednum: Int?,
buySeedOnClickListener: View.OnClickListener, buySeedOnClickListener: View.OnClickListener,
receiveSeedOnClickListener: View.OnClickListener receiveSeedOnClickListener: View.OnClickListener
) { ) {
...@@ -717,6 +721,7 @@ object MainDialog { ...@@ -717,6 +721,7 @@ object MainDialog {
) )
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad_seed) val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad_seed)
AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layoutAd) AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layoutAd)
mDialogView.findViewById<TextView>(R.id.tv_seed_num)?.text = "+${seednum}"
mDialogView.findViewById<TextView>(R.id.id_tv_seed_price)?.text = "$seedPrice" mDialogView.findViewById<TextView>(R.id.id_tv_seed_price)?.text = "$seedPrice"
mDialogView.findViewById<TextView>(R.id.id_tv_seed_video_num)?.text = mDialogView.findViewById<TextView>(R.id.id_tv_seed_video_num)?.text =
"每天晚上0点重置视频次数 (剩余${seedVideo}次)" "每天晚上0点重置视频次数 (剩余${seedVideo}次)"
...@@ -745,15 +750,212 @@ object MainDialog { ...@@ -745,15 +750,212 @@ object MainDialog {
}) })
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){ if (activity.isFinishing) {
return return
} }
mDialog?.show() mDialog?.show()
} }
/**
* 恭喜获得宝箱
*/
fun showGetBox(
activity: Activity,
adNum: Int,
adListener: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_layout_get_box,
activity,
mDialog,
0,
Gravity.CENTER
)
EventUtils.onEvent("box_show", "宝箱弹窗展示")
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_get_box_close)
val tv_get_box_num = mDialogView?.findViewById<TextView>(R.id.tv_get_box_num)
val btn_get_box_btn =
mDialogView?.findViewById<ImageView>(R.id.btn_get_box_btn)
// val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_feed_ad)
tv_get_box_num.text = "今天剩余${adNum}次"
btn_get_box_btn.setOnClickListener {
adListener.onClick(it)
EventUtils.onEvent("box_video_btn_click", "宝箱视频按钮点击")
mDialog?.dismiss()
}
// FilterUtils.addClickAlpha(btn_get_box_btn)
iv_close?.setOnClickListener {
mDialog?.dismiss()
}
// AdUtils.showFeedAd(activity, "get_box_dialog", layout_ad)
mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false)
if (!activity?.isFinishing) {
mDialog?.show()
}
}
/**
* 获得杀虫剂或者浇水
*/
fun showAddDrop(
activity: Activity,
adNum: Int,
type: Int,
id: Int,
adListener: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_layout_get_add_drop,
activity,
mDialog,
0,
Gravity.CENTER
)
// EventUtils.onEvent("", "")
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_close)
val img_bg = mDialogView?.findViewById<ImageView>(R.id.img_bg)
val img_icon = mDialogView?.findViewById<ImageView>(R.id.img_icon)
val img_zhongzi = mDialogView?.findViewById<ImageView>(R.id.img_zhongzi)
val id_tv_num = mDialogView?.findViewById<TextView>(R.id.id_tv_num)
val img_get =
mDialogView?.findViewById<ImageView>(R.id.img_get)
// val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_feed_ad)
when (type) {
1 -> {
img_icon.visibility = View.VISIBLE
img_bg.setBackgroundResource(R.mipmap.icon_bg_get_jiaoshui)
img_icon.setBackgroundResource(R.mipmap.icon_bg_jiasuji)
img_zhongzi.visibility = View.GONE
}
2 -> {
img_icon.visibility = View.VISIBLE
img_bg.setBackgroundResource(R.mipmap.icon_bg_get_shachongji)
img_icon.setBackgroundResource(R.mipmap.icon_bg_shachongji)
img_zhongzi.visibility = View.GONE
}
3 -> {
img_icon.visibility = View.GONE
img_zhongzi.visibility = View.VISIBLE
img_bg.setBackgroundResource(R.mipmap.icon_bg_three)
setImage(img_zhongzi, id)
}
}
id_tv_num.text = "+${adNum}"
img_get.setOnClickListener {
adListener.onClick(it)
// EventUtils.onEvent("box_video_btn_click", "宝箱视频按钮点击")
mDialog?.dismiss()
}
// FilterUtils.addClickAlpha(btn_get_box_btn)
iv_close?.setOnClickListener {
mDialog?.dismiss()
}
// AdUtils.showFeedAd(activity, "get_box_dialog", layout_ad)
mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false)
if (!activity?.isFinishing) {
mDialog?.show()
}
}
/**
*拥有杀虫剂或者浇水次数弹窗
*/
fun showHaveDroporWarm(
activity: Activity,
type: Int,
time: Int,
howmany: Int,
Num: Int,
adListener: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_layout_drop_or_warm,
activity,
mDialog,
0,
Gravity.CENTER
)
// EventUtils.onEvent("", "")
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_close)
val img_bg = mDialogView?.findViewById<ImageView>(R.id.img_bg)
val img_icon = mDialogView?.findViewById<ImageView>(R.id.img_icon)
val tv_jiasu_time = mDialogView?.findViewById<TextView>(R.id.tv_jiasu_time)
val id_tv_num = mDialogView?.findViewById<TextView>(R.id.id_tv_num)
val tv_shengxu_num = mDialogView?.findViewById<TextView>(R.id.tv_shengxu_num)
val img_get =
mDialogView?.findViewById<ImageView>(R.id.img_get)
// val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_feed_ad)
when (type) {
1 -> {
EventUtils.onEvent("jiaoshui_show","浇水弹窗曝光")
img_bg.setBackgroundResource(R.mipmap.icon_bg_one)
img_icon.setBackgroundResource(R.mipmap.icon_bg_jiasuji)
img_get.setBackgroundResource(R.drawable.select_get_one)
tv_jiasu_time.text = "浇水使作物提前 ${time} 分钟成熟"
}
2 -> {
EventUtils.onEvent("kill_show","杀虫剂弹窗曝光")
img_bg.setBackgroundResource(R.mipmap.icon_bg_two)
img_icon.setBackgroundResource(R.mipmap.icon_bg_shachongji)
img_get.setBackgroundResource(R.drawable.select_get_two)
tv_jiasu_time.text = "使用杀虫剂可以为作物除虫"
}
}
id_tv_num.text = "已拥有 ${Num}"
tv_shengxu_num.text = "今天剩余${howmany}次"
img_get.setOnClickListener {
if(type==1){
EventUtils.onEvent("jiaoshui_video_btn_click","浇水弹窗获得浇水次数按钮点击")
}else if(type==2){
EventUtils.onEvent("kill_video_btn_click","获得杀虫剂按钮点击")
}
adListener.onClick(it)
// EventUtils.onEvent("box_video_btn_click", "宝箱视频按钮点击")
mDialog?.dismiss()
}
// FilterUtils.addClickAlpha(btn_get_box_btn)
iv_close?.setOnClickListener {
mDialog?.dismiss()
}
// AdUtils.showFeedAd(activity, "get_box_dialog", layout_ad)
mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false)
if (!activity?.isFinishing) {
mDialog?.show()
}
}
/** /**
* 添加点击缩放效果 * 添加点击缩放效果
......
package com.ym.game.view
import android.annotation.SuppressLint
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.RecyclerView
import com.ym.bbnc.R
import com.ym.game.adapter.SeedStoreAdapter
import com.ym.game.contract.SeedStoreContract
import com.ym.game.presenter.SeedStorePresenter
import com.ym.library.module.SeedListEntity
import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil
import com.ym.library.rxbus.Subscribe
import com.ym.library.rxbus.ThreadMode
import com.ym.library.utils.EventUtils
class SeedStoreDialog : SeedStoreContract.View {
private var context: Context? = null
private var mDialog: Dialog? = null
private var mPresenter: SeedStorePresenter? = null
private var adapter: SeedStoreAdapter? = null
//展示种子商店弹窗
fun showSeedStore(context: Context?) {
if (context == null) {
return
}
this.context = context
EventUtils.onEvent("seed_show", "种子商店弹窗曝光")
mPresenter = SeedStorePresenter(this)
mPresenter?.getSeedList()
RxBusUtil.getDefault().register(this)
mDialog = Dialog(context, R.style.UpdateVersionCompatDialogTheme75)
val mDialogView =
MainDialog.showBottomDialog(
R.layout.dialog_layout_seed_store,
context,
mDialog!!,
0,
Gravity.CENTER
)
val rl = mDialog?.findViewById<RecyclerView>(R.id.rl_seed_store)
rl?.layoutManager =
GridLayoutManager(context,3)
adapter = SeedStoreAdapter(context)
rl?.adapter = adapter
mDialogView?.findViewById<ImageView>(R.id.iv_close).setOnClickListener {
mDialog?.dismiss()
RxBusUtil.getDefault().unregister(this)
}
mDialog?.setOnCancelListener {
RxBusUtil.getDefault().unregister(this)
}
mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false)
mDialog?.show()
}
@SuppressLint()
@Subscribe(code = RxBusConstant.RX_SEED_STORE_LIST, threadMode = ThreadMode.MAIN)
fun updateList() {
mPresenter?.getSeedList()
}
override fun SeedListResult(result: List<SeedListEntity>) {
adapter?.clear()
adapter?.appendToList(result)
adapter?.notifyDataSetChanged()
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_open_box" android:state_pressed="false"/>
<item android:drawable="@drawable/icon_open_box_press" android:state_pressed="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_get_one" android:state_pressed="false"/>
<item android:drawable="@mipmap/icon_get_one_press" android:state_pressed="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_get_two" android:state_pressed="false"/>
<item android:drawable="@mipmap/icon_get_two_press" android:state_pressed="true"/>
</selector>
\ No newline at end of file
...@@ -7,118 +7,86 @@ ...@@ -7,118 +7,86 @@
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="345.5dp"
android:layout_height="370dp" android:layout_height="358dp"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"> >
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="313dp" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:background="@mipmap/icon_bg_shifei" />
android:scaleType="fitXY"
android:src="@mipmap/icon_main_dialog_get_drops_bg" />
<ImageView <ImageView
android:id="@+id/id_img_close_cloud_speed" android:id="@+id/id_img_close_cloud_speed"
android:layout_width="wrap_content" android:layout_width="52dp"
android:layout_height="wrap_content" android:layout_height="52dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginTop="65dp" 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 <LinearLayout
android:layout_width="wrap_content" android:id="@+id/id_ll_content"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_centerHorizontal="true" android:layout_height="wrap_content"
android:layout_marginTop="35dp" android:layout_centerHorizontal="true"
android:src="@drawable/icon_speed_cloud_title" /> android:layout_marginLeft="28dp"
android:layout_marginTop="110dp"
android:layout_marginRight="@dimen/dp_26"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<LinearLayout <TextView
android:id="@+id/id_ll_content" android:id="@+id/id_tv_speed_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="150dp" android:layout_height="wrap_content"
android:layout_below="@+id/id_tv_gongxi_get" android:text="所有土地获得20分钟加速"
android:layout_centerHorizontal="true" android:textColor="#6A231A"
android:layout_marginLeft="28dp" android:textSize="@dimen/sp_15"
android:layout_marginTop="@dimen/dp_121" android:textStyle="bold" />
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 <ImageView
android:id="@+id/id_img_all_speed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_centerInParent="true"
android:layout_centerHorizontal="true" android:src="@mipmap/icon_cloud"
android:layout_marginBottom="@dimen/dp_36" android:visibility="visible" />
android:src="@drawable/select_all_speed" />
<TextView </LinearLayout>
android:id="@+id/id_cloud_speed_num"
android:layout_width="wrap_content" <ImageView
android:layout_height="wrap_content" android:id="@+id/id_img_all_speed"
android:layout_alignParentBottom="true" android:layout_width="wrap_content"
android:layout_centerHorizontal="true" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10" android:layout_alignParentBottom="true"
android:includeFontPadding="false" android:layout_centerHorizontal="true"
android:text="每天晚上0点重置视频次数 (剩余30次)" android:layout_marginBottom="@dimen/dp_44"
android:textColor="#864F1C" /> android:src="@drawable/select_all_speed" />
</RelativeLayout>
<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_22"
android:includeFontPadding="false"
android:text="每天晚上0点重置视频次数 (剩余30次)"
android:textColor="#864F1C"
android:textSize="10sp" />
</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="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_40" android:layout_marginTop="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_5" android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_10"
android:background="@color/white" android:background="@color/white"
android:visibility="gone" /> android:visibility="gone" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="345.5dp"
android:layout_height="358dp"
android:orientation="vertical">
<ImageView
android:id="@+id/img_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_bg_one" />
<ImageView
android:id="@+id/iv_close"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_alignParentRight="true"
android:layout_marginTop="60dp" />
<TextView
android:id="@+id/tv_jiasu_time"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_34"
android:layout_centerHorizontal="true"
android:layout_marginTop="103dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="浇水使作物提前10分钟成熟"
android:textColor="#6A231A"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="113dp">
<ImageView
android:id="@+id/img_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_bg_shachongji" />
<TextView
android:id="@+id/id_tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="117dp"
android:includeFontPadding="false"
android:text="已拥有"
android:textColor="#6A231A"
android:textSize="@dimen/sp_18"
android:textStyle="bold" />
</RelativeLayout>
<ImageView
android:id="@+id/img_get"
android:layout_width="228dp"
android:layout_height="51dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="262.5dp" />
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_shengxu_num"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_below="@+id/img_get"
android:layout_centerHorizontal="true"
android:gravity="center"
android:includeFontPadding="false"
android:text="今天剩余x次"
android:textColor="#864F1C"
android:textSize="10sp" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="345.5dp"
android:layout_height="358dp"
android:orientation="vertical">
<ImageView
android:id="@+id/img_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_bg_get_shachongji" />
<ImageView
android:id="@+id/iv_close"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_alignParentRight="true"
android:layout_marginTop="60dp" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="113dp">
<ImageView
android:id="@+id/img_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_bg_shachongji"
android:visibility="gone" />
<ImageView
android:id="@+id/img_zhongzi"
android:layout_width="61dp"
android:layout_height="69dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_20"
android:src="@mipmap/img_cabbage"
android:visibility="gone" />
<TextView
android:id="@+id/id_tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_115"
android:includeFontPadding="false"
android:text="+2"
android:textColor="#6A231A"
android:textSize="@dimen/sp_20"
android:textStyle="bold" />
</RelativeLayout>
<ImageView
android:id="@+id/img_get"
android:layout_width="228dp"
android:layout_height="51dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="270dp"
android:src="@drawable/btn_selector" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<!-- <RelativeLayout-->
<!-- android:layout_width="332dp"-->
<!-- android:layout_height="316dp">-->
<!-- <ImageView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:background="@mipmap/icon_bg_302" />-->
<!-- <RelativeLayout-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_centerHorizontal="true"-->
<!-- android:layout_marginTop="-1dp"-->
<!-- android:background="@mipmap/icon_title_bg_220">-->
<!-- <com.ym.game.wedget.FontTextView-->
<!-- android:id="@+id/id_tv_worm_title"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="48dp"-->
<!-- android:layout_centerHorizontal="true"-->
<!-- android:gravity="center"-->
<!-- android:includeFontPadding="false"-->
<!-- android:text="恭喜获得宝箱"-->
<!-- android:textColor="#722E01"-->
<!-- android:textSize="22sp" />-->
<!-- </RelativeLayout>-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_get_box_close"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:layout_marginTop="-4dp"-->
<!-- android:layout_marginRight="-4dp"-->
<!-- android:src="@mipmap/icon_new_close" />-->
<!-- <LinearLayout-->
<!-- android:id="@+id/id_ll_content"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/iv_get_box_close"-->
<!-- android:layout_centerHorizontal="true"-->
<!-- android:gravity="center"-->
<!-- android:orientation="vertical">-->
<!-- <com.ym.game.wedget.FontTextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_centerHorizontal="true"-->
<!-- android:layout_marginTop="@dimen/dp_28"-->
<!-- android:layout_marginBottom="@dimen/dp_19"-->
<!-- android:gravity="center"-->
<!-- android:includeFontPadding="false"-->
<!-- android:text="随机获得金币、加速剂、种子"-->
<!-- android:textColor="#722E01"-->
<!-- android:textSize="@dimen/sp_17" />-->
<!-- <ImageView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginBottom="@dimen/dp_24"-->
<!-- android:background="@mipmap/icon_box" />-->
<!-- <ImageView-->
<!-- android:id="@+id/btn_get_box_btn"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginBottom="@dimen/dp_10"-->
<!-- android:src="@mipmap/icon_box_open" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_get_box_num"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:includeFontPadding="false"-->
<!-- android:text="今天剩余x次"-->
<!-- android:textColor="#9C5900"-->
<!-- android:textSize="13sp"/>-->
<!-- </LinearLayout>-->
<!-- </RelativeLayout>-->
<RelativeLayout
android:layout_width="345.5dp"
android:layout_height="358dp"
android:background="@drawable/icon_bg_get_box"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_get_box_close"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_alignParentRight="true"
android:layout_marginTop="60dp" />
<ImageView
android:layout_width="131dp"
android:layout_height="133dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="135dp"
android:background="@mipmap/icon_box" />
<TextView
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="103.5dp"
android:gravity="center"
android:includeFontPadding="false"
android:lineSpacingExtra="5dp"
android:text="开宝箱可随机获得\n种子、杀虫剂、浇水次数"
android:textColor="#722E01"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_get_box_btn"
android:layout_width="228dp"
android:layout_height="51dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="262.5dp"
android:src="@drawable/select_get_box" />
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_get_box_num"
android:layout_width="wrap_content"
android:layout_height="27dp"
android:layout_below="@+id/btn_get_box_btn"
android:layout_centerHorizontal="true"
android:gravity="center"
android:includeFontPadding="false"
android:text="今天剩余x次"
android:textColor="#864F1C"
android:textSize="10sp" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="344dp"
android:layout_height="514.5dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_bg_seed_store" />
<ImageView
android:id="@+id/iv_close"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_alignParentRight="true"
android:layout_marginTop="60dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_seed_store"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="126dp"
android:layout_marginBottom="@dimen/dp_30"/>
</RelativeLayout>
</LinearLayout>
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/rl_zhongzi"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
...@@ -74,8 +75,20 @@ ...@@ -74,8 +75,20 @@
android:scaleY="1.5" android:scaleY="1.5"
android:src="@mipmap/baicai_fruit" android:src="@mipmap/baicai_fruit"
android:visibility="visible" /> android:visibility="visible" />
</RelativeLayout> </RelativeLayout>
<TextView
android:id="@+id/tv_seed_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rl_zhongzi"
android:layout_centerHorizontal="true"
android:text=""
android:textColor="#6A231A"
android:textSize="20sp"
android:textStyle="bold"/>
<RelativeLayout <RelativeLayout
android:id="@+id/id_img_bug_seed" android:id="@+id/id_img_bug_seed"
...@@ -83,7 +96,8 @@ ...@@ -83,7 +96,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@id/id_img_receive_seed" android:layout_above="@id/id_img_receive_seed"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_10"> android:layout_marginBottom="@dimen/dp_10"
android:visibility="gone">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -110,7 +124,7 @@ ...@@ -110,7 +124,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_40" android:layout_marginBottom="@dimen/dp_50"
android:src="@drawable/select_seed_receive" /> android:src="@drawable/select_seed_receive" />
<TextView <TextView
...@@ -119,7 +133,7 @@ ...@@ -119,7 +133,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_10" android:layout_marginBottom="@dimen/dp_20"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="每天晚上0点重置视频次数 (剩余10次)" android:text="每天晚上0点重置视频次数 (剩余10次)"
android:textColor="#864F1C" /> android:textColor="#864F1C" />
......
<?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:layout_marginBottom="23.5dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/id_img_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/img_cabbage"/>
<TextView
android:id="@+id/id_tv_ownnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="222"
android:textColor="#8F4C07"
android:textSize="@dimen/sp_14"
android:layout_marginTop="@dimen/dp_12" />
<ImageView
android:id="@+id/id_img_buy_seed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_buy_seed"
android:layout_marginTop="7dp"
/>
</LinearLayout>
PACKAGE_NAME=com.ym.bbnc PACKAGE_NAME=com.ym.bbnc
VERSION_CODE=11 VERSION_CODE=13
VERSION_NAME=1.1.0 VERSION_NAME=1.2.0
\ No newline at end of file \ No newline at end of file
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.
package com.ym.library.module
class AddPropEntity {
var type: Int = 0
var awardNum: Int = 0
var id: Int = 0
}
\ No newline at end of file
package com.ym.library.module
class BottomInfoEntity {
var accNum: Int = 0//加速剂数量
var clearBugNum: Int = 0//除虫剂数量
var accSecond: Int = 0//加速剂减少秒数
}
\ No newline at end of file
...@@ -3,4 +3,5 @@ package com.ym.library.module ...@@ -3,4 +3,5 @@ package com.ym.library.module
class GuideEntity { class GuideEntity {
var status: Int = 0 var status: Int = 0
var video: Int = 0
} }
\ No newline at end of file
...@@ -29,10 +29,19 @@ public class HomeInfoEntity { ...@@ -29,10 +29,19 @@ public class HomeInfoEntity {
private int maxClockNum;//所需打卡数量 private int maxClockNum;//所需打卡数量
private int subAcceleratorsVideoNum;//看加速剂不足视频剩余次数 private int subAcceleratorsVideoNum;//看加速剂不足视频剩余次数
private int subSeedVideoNum;//看种子不足视频剩余次数 private int subSeedVideoNum;//看种子不足视频剩余次数
private int subClearBugVideoNum;;//看视频获取除虫剂剩余看视频次数
private int acceleratorsVideoNum;//看视频给加速剂的个数 private int acceleratorsVideoNum;//看视频给加速剂的个数
private int lotteryNum;//转盘剩余次数 private int lotteryNum;//转盘剩余次数
private int isPopup;//是否选过商品 private int isPopup;//是否选过商品
public int getSubClearBugVideoNum() {
return subClearBugVideoNum;
}
public void setSubClearBugVideoNum(int subClearBugVideoNum) {
this.subClearBugVideoNum = subClearBugVideoNum;
}
public int getIsPopup() { public int getIsPopup() {
return isPopup; return isPopup;
} }
......
...@@ -40,6 +40,15 @@ public class LandListEntity { ...@@ -40,6 +40,15 @@ public class LandListEntity {
private int targetVideoNum;//解锁需看视频数量 private int targetVideoNum;//解锁需看视频数量
private int currentVideoNum;//当前已看视频数量 private int currentVideoNum;//当前已看视频数量
private int stopSecond;//暂停时间点 private int stopSecond;//暂停时间点
private int seedVideoNum;
public int getSeedVideoNum() {
return seedVideoNum;
}
public void setSeedVideoNum(int seedVideoNum) {
this.seedVideoNum = seedVideoNum;
}
public int getStopSecond() { public int getStopSecond() {
return stopSecond; return stopSecond;
......
package com.ym.library.module
class SeedListEntity {
var id: Int = 0
var ownNum: Int = 0
var subSeedVideoNum: Int = 0
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.ym.library.net ...@@ -3,6 +3,7 @@ package com.ym.library.net
import android.text.TextUtils import android.text.TextUtils
import com.ym.admodule.BuildConfig import com.ym.admodule.BuildConfig
import com.ym.library.MyConstant import com.ym.library.MyConstant
import com.ym.library.down.VersionClient
import com.ym.modulecommon.net.DecryptInterceptor import com.ym.modulecommon.net.DecryptInterceptor
import com.ym.modulecommon.net.NetConfig import com.ym.modulecommon.net.NetConfig
import com.ym.modulecommon.utils.PhoneUtils import com.ym.modulecommon.utils.PhoneUtils
...@@ -55,8 +56,11 @@ object GameApiClient { ...@@ -55,8 +56,11 @@ object GameApiClient {
.addInterceptor(logInterceptor.apply { .addInterceptor(logInterceptor.apply {
level = if(BuildConfig.DEBUG)HttpLoggingInterceptor.Level.BODY else{HttpLoggingInterceptor.Level.NONE} level = if(BuildConfig.DEBUG)HttpLoggingInterceptor.Level.BODY else{HttpLoggingInterceptor.Level.NONE}
}) })
// .addInterceptor(GameApiClient.logInterceptor.apply {
// level = HttpLoggingInterceptor.Level.BODY
// })
// .retryOnConnectionFailure(false) // .retryOnConnectionFailure(false)
.addInterceptor(DecryptInterceptor()) // .addInterceptor(DecryptInterceptor())
.hostnameVerifier { hostname, session -> .hostnameVerifier { hostname, session ->
true true
} }
......
...@@ -61,7 +61,14 @@ interface IGameApi { ...@@ -61,7 +61,14 @@ interface IGameApi {
@Query("type") type: Int, @Query("type") type: Int,
@Query("second") second: Int @Query("second") second: Int
): Observable<Response<StatusEntity>> ): Observable<Response<StatusEntity>>
/**
* 看视频除虫
* @return
*/
@POST(NetConfig.Game.URL_GAME_CLEAR_BUG)
fun getlockLand(
@Query("id") id: Int
): Observable<Response<StatusEntity>>
/** /**
* 加速剂 * 加速剂
* @param id 地块列表id * @param id 地块列表id
...@@ -78,7 +85,10 @@ interface IGameApi { ...@@ -78,7 +85,10 @@ interface IGameApi {
* @return * @return
*/ */
@POST(NetConfig.Game.URL_GAME_BUY_SEED) @POST(NetConfig.Game.URL_GAME_BUY_SEED)
fun getBuySeed(@Query("id") id: Int,@Query("second") second: Int): Observable<Response<StatusEntity>> fun getBuySeed(
@Query("id") id: Int,
@Query("second") second: Int
): Observable<Response<StatusEntity>>
/** /**
* 仓库 * 仓库
...@@ -132,7 +142,10 @@ interface IGameApi { ...@@ -132,7 +142,10 @@ interface IGameApi {
* @return * @return
*/ */
@POST(NetConfig.Game.URL_GAME_INCR_SEED) @POST(NetConfig.Game.URL_GAME_INCR_SEED)
fun getVideoSeedReceive(@Query("id") id: Int,@Query("second") second: Int): Observable<Response<StatusEntity>> fun getVideoSeedReceive(
@Query("id") id: Int,
@Query("second") second: Int
): Observable<Response<StatusEntity>>
/** /**
* 看视频获得加速剂 * 看视频获得加速剂
...@@ -150,22 +163,22 @@ interface IGameApi { ...@@ -150,22 +163,22 @@ interface IGameApi {
* @return * @return
*/ */
@POST(NetConfig.Game.URL_GAME_OPEN_BOX) @POST(NetConfig.Game.URL_GAME_OPEN_BOX)
fun getopenBox(): Observable<Response<FlyBoxEntity>> fun getopenBox(@Query("type") type: Int): Observable<Response<FlyBoxEntity>>
/** // /**
* 打卡普通打卡任务领取 // * 打卡普通打卡任务领取
*/ // */
@POST(NetConfig.Game.URL_CLOCK_BOX_RECEIVE) // @POST(NetConfig.Game.URL_CLOCK_BOX_RECEIVE)
fun geClockBoxReceive(): Observable<Response<FlyBoxEntity>> // fun geClockBoxReceive(): Observable<Response<FlyBoxEntity>>
/** // /**
* 底部拆红包奖励 // * 底部拆红包奖励
* @param // * @param
* @paramq // * @paramq
* @return // * @return
*/ // */
@POST(NetConfig.Game.URL_GAME_OPEN_PLANT_BOX) // @POST(NetConfig.Game.URL_GAME_OPEN_BOX)
fun getOpenPlantBox(): Observable<Response<FlyBoxEntity>> // fun getOpenPlantBox(): Observable<Response<FlyBoxEntity>>
/** /**
* 看视频上报 * 看视频上报
...@@ -270,7 +283,7 @@ interface IGameApi { ...@@ -270,7 +283,7 @@ interface IGameApi {
//打卡提现 //打卡提现
@POST(NetConfig.Game.URL_GAME_DO_WD) @POST(NetConfig.Game.URL_GAME_DO_WD)
fun getDoWd(@Query("clockId") clockId:Int): Observable<Response<ExchangeEntity>> fun getDoWd(@Query("clockId") clockId: Int): Observable<Response<ExchangeEntity>>
/** /**
* 任务页列表 * 任务页列表
...@@ -332,6 +345,7 @@ interface IGameApi { ...@@ -332,6 +345,7 @@ interface IGameApi {
// 收金币获得卡片 // 收金币获得卡片
@GET(NetConfig.Game.URL_COLLECT_CARD_ADD_CARD) @GET(NetConfig.Game.URL_COLLECT_CARD_ADD_CARD)
fun addCard(): Observable<Response<AddCardEntity?>> fun addCard(): Observable<Response<AddCardEntity?>>
/** /**
* 首页列表数据 * 首页列表数据
* @param * @param
...@@ -359,9 +373,35 @@ interface IGameApi { ...@@ -359,9 +373,35 @@ interface IGameApi {
): Observable<Response<BubbleOrBoxReceiveEntity?>> ): Observable<Response<BubbleOrBoxReceiveEntity?>>
@GET(NetConfig.Game.URL_GAME_AD_TIME_CD) @GET(NetConfig.Game.URL_GAME_AD_TIME_CD)
fun getAdTimeCD():Observable<Response<StatusEntity?>> fun getAdTimeCD(): Observable<Response<StatusEntity?>>
@POST(NetConfig.Game.URL_GAME_AD_VIDEO_REPORT) @POST(NetConfig.Game.URL_GAME_AD_VIDEO_REPORT)
fun adVideoReport(@Query("slot") slot:String): Observable<Response<Any>> fun adVideoReport(@Query("slot") slot: String): Observable<Response<Any>>
/**
* 获取农场底部数据
* @param
* @param
* @return
*/
@GET(NetConfig.Game.URL_GAME_BOTTOM_INFO)
fun getGameBottomInfo(): Observable<Response<BottomInfoEntity>>
/**
* 底部看视频领加速剂、除虫剂
* @param
* @param
* @return
*/
@POST(NetConfig.Game.URL_GAME_ADD_PROP)
fun addprop(@Query("id") id: Int,@Query("type") type: Int): Observable<Response<AddPropEntity>>
/**
* 种子列表
* @param
* @param
* @return
*/
@GET(NetConfig.Game.URL_GAME_LIST_SEED)
fun getlistseed(): Observable<Response<List<SeedListEntity>>>
} }
\ No newline at end of file
...@@ -225,7 +225,7 @@ public class NetConfig { ...@@ -225,7 +225,7 @@ public class NetConfig {
public static final String URL_GAME_CLOUD_SPEED = "app/v1/game/farm/cloud_speed";//云朵加速 public static final String URL_GAME_CLOUD_SPEED = "app/v1/game/farm/cloud_speed";//云朵加速
public static final String URL_GAME_HOME_INFO = "app/v1/game/farm/home_info";//首页信息 public static final String URL_GAME_HOME_INFO = "app/v1/game/farm/home_info";//首页信息
// public static final String URL_GAME_LIST_LAND = "app/v1/game/farm/list_land";//地块列表 // public static final String URL_GAME_LIST_LAND = "app/v1/game/farm/list_land";//地块列表
public static final String URL_GAME_OPEN_BOX = "app/v1/game/farm/open_box";//开宝箱 public static final String URL_GAME_OPEN_BOX = "app/v1/game/bbnc/open_box";//开宝箱
public static final String URL_GAME_ORDER_DATA = "app/v1/game/farm/order_data";//订单数据 public static final String URL_GAME_ORDER_DATA = "app/v1/game/farm/order_data";//订单数据
public static final String URL_GAME_ORDER_RECEIVE = "app/v1/game/farm/order_receive";//订单领取 public static final String URL_GAME_ORDER_RECEIVE = "app/v1/game/farm/order_receive";//订单领取
// public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/farm/unlock_land";//解锁地块/种植种子/收获果实 // public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/farm/unlock_land";//解锁地块/种植种子/收获果实
...@@ -255,7 +255,7 @@ public class NetConfig { ...@@ -255,7 +255,7 @@ public class NetConfig {
public static final String URL_GAME_CLOUD_CHECK = "app/v1/game/farm/cloud_check";//云朵加速判断 public static final String URL_GAME_CLOUD_CHECK = "app/v1/game/farm/cloud_check";//云朵加速判断
public static final String URL_GAME_OPEN_PLANT_BOX = "app/v1/game/ddcy/open_plant_box";//底部拆红包 // public static final String URL_GAME_OPEN_PLANT_BOX = "app/v1/game/farm/open_plant_box";//底部拆红包
public static final String URL_GAME_CLOCK_LIST = "app/v1/game/ddcy/clock_list";//打卡提现列表 public static final String URL_GAME_CLOCK_LIST = "app/v1/game/ddcy/clock_list";//打卡提现列表
public static final String URL_GAME_DO_WD = "app/v1/game/ddcy/clock_wd";//打卡提现 public static final String URL_GAME_DO_WD = "app/v1/game/ddcy/clock_wd";//打卡提现
...@@ -272,7 +272,7 @@ public class NetConfig { ...@@ -272,7 +272,7 @@ public class NetConfig {
public static final String URL_COLLECT_CARD_ADV_PUT_OR_ADD = "app/v1/collect-card/advPutOrAdd";//看广告单个图片获取或者拼图 public static final String URL_COLLECT_CARD_ADV_PUT_OR_ADD = "app/v1/collect-card/advPutOrAdd";//看广告单个图片获取或者拼图
public static final String URL_COLLECT_CARD_ADD_CARD = "app/v1/collect-card/addCard";//收金币获得卡片 public static final String URL_COLLECT_CARD_ADD_CARD = "app/v1/collect-card/addCard";//收金币获得卡片
public static final String URL_GAME_HOME_WD_LIST = "app/v1/game/ddcy/home_wd_list";//首页展示果实列表 public static final String URL_GAME_HOME_WD_LIST = "app/v1/game/ddcy/home_wd_list";//首页展示果实列表
public static final String URL_CLOCK_BOX_RECEIVE = "app/v1/game/ddcy/clock_box_receive";//打卡普通打卡任务领取 // public static final String URL_CLOCK_BOX_RECEIVE = "app/v1/game/ddcy/clock_box_receive";//打卡普通打卡任务领取
public static final String URL_GAME_VIDEO_TASK_COMPLETE = "app/v1/game/video_task_complete";//看领金币视频任务 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";//仓库列表 public static final String URL_GAME_WAREHOUSEDATA = "app/v1/game/ddcy/warehouseData";//仓库列表
...@@ -281,7 +281,14 @@ public class NetConfig { ...@@ -281,7 +281,14 @@ public class NetConfig {
public static final String URL_GAME_LIST_LAND = "app/v1/game/ddhy/list_land_V2";//菜园地块列表 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";//菜园 解锁地块/种植种子/收获果实
public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/ddhy/unlock_land_V2";//菜园 解锁地块/种植种子/收获果实/解锁倒计时 public static final String URL_GAME_UNLOCK_LAND = "app/v1/game/ddhy/unlock_land_V2";//菜园 解锁地块/种植种子/收获果实/解锁倒计时
public static final String URL_GAME_CLEAR_BUG = "app/v1/game/bbnc/clear_bug";//菜园 解锁地块/种植种子/收获果实/解锁倒计时
//看广告间隔 //看广告间隔
public static final String URL_GAME_AD_TIME_CD = "app/v1/game/video_cd"; public static final String URL_GAME_AD_TIME_CD = "app/v1/game/video_cd";
//底部信息
public static final String URL_GAME_BOTTOM_INFO = "app/v1/game/bbnc/bottom_info";
//获取杀虫剂或者加速剂
public static final String URL_GAME_ADD_PROP = "app/v1/game/bbnc/add_prop";
//种子列表
public static final String URL_GAME_LIST_SEED = "app/v1/game/bbnc/list_seed";
} }
} }
...@@ -45,5 +45,6 @@ public class RxBusConstant { ...@@ -45,5 +45,6 @@ public class RxBusConstant {
public final static int RX_WITH_DRAW_LIST = 30001; public final static int RX_WITH_DRAW_LIST = 30001;
//加速剂任务列表 //加速剂任务列表
public final static int RX_SPEED_WATER_TASK_LIST = 30002; public final static int RX_SPEED_WATER_TASK_LIST = 30002;
public final static int RX_SEED_STORE_LIST = 40001;
} }
...@@ -57,12 +57,46 @@ object AdUtils { ...@@ -57,12 +57,46 @@ object AdUtils {
} }
override fun onAdShow() { override fun onAdShow() {
if (actionName.equals("jiacishu")){ if (actionName.equals("jiacishu")) {
EventUtils.onEvent("dfw_touzi_video_show", "大富翁骰子视频曝光"); EventUtils.onEvent("dfw_touzi_video_show", "大富翁骰子视频曝光");
} }
if (actionName.equals("kengwei")){ if (actionName.equals("kengwei")) {
EventUtils.onEvent("dfw_qipan_video_show", "大富翁棋盘视频曝光"); EventUtils.onEvent("dfw_qipan_video_show", "大富翁棋盘视频曝光");
} }
if (actionName.equals("CleanWorm")) {
EventUtils.onEvent("clean_worm_video_show", "除虫视频曝光");
}
if (actionName.equals("unlockLand")) {
EventUtils.onEvent("unlock_video_show", "解锁土地视频曝光");
}
if (actionName.equals("receive_seed_click")) {
EventUtils.onEvent("seed_video2_show", "种子不足视频曝光");
}
if (actionName.equals("accelerator_receive_click")) {
EventUtils.onEvent("jiaoshui_video2_show", "加速剂不足视频曝光");
}
if (actionName.equals("cloud_acceleration_click")) {
EventUtils.onEvent("alljiasu_video_show", "施肥视频曝光");
}
if (actionName.equals("bottom_shachongji")) {
EventUtils.onEvent("kill_video_show", "获得杀虫剂视频曝光");
}
if (actionName.equals("bottom_jiaoshui")) {
EventUtils.onEvent("jiaoshui_video1_show", "获得浇水次数视频曝光");
}
if (actionName.equals("box_click")) {
EventUtils.onEvent("box_video_show", "飞行宝箱视频曝光");
}
if (actionName.equals("bottom_open_red_envelope_click")) {
EventUtils.onEvent("hongbao_video_show", "次数红包视频曝光");
}
if (actionName.equals("welfare_task")) {
EventUtils.onEvent("fuli_video_show", "福利任务视频曝光");
}
if (actionName.equals("seed_video_show")) {
EventUtils.onEvent("seed_video_show", "种子购买视频曝光");
}
Utils.showToast(activity, "看完视频可获得奖励") Utils.showToast(activity, "看完视频可获得奖励")
// AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_VIDEO, activity!!) // AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_VIDEO, activity!!)
handler?.sendEmptyMessageDelayed(0, 2000) handler?.sendEmptyMessageDelayed(0, 2000)
......
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