Commit d327cbc0 authored by maxiaoliang's avatar maxiaoliang

芭芭农场1.2.0上线代码

parent 1ceaee9d
......@@ -633,6 +633,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
})
}
//解锁地块本地同步服务端 解锁地块传1 种植种子传2 收获果实传3 解锁倒计时4
fun getUnlockLandNew2(id: Int, type: Int, time: Int) {
GameApiClient.gameApi.getlockLand(id)
......@@ -1108,13 +1109,16 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun showCloudDialog(speedtime: Int, sppedtimes: Int, type: Int) {
MainLooper.get()?.post(Runnable {
// CashExchangeDialog.showCashExchage(this, this)
MainDialog.showDialogCloud(this, speedtime, sppedtimes, View.OnClickListener {
MainDialog.showDialogCloud(this, speedtime, sppedtimes, type, View.OnClickListener {
if (type == 1) {
AdUtils.playRewardAd(
this@GameActivity,
"cloud_acceleration_click",
object : IAdVideoListener {
override fun onAdClose() {
GameApiClient.gameApi.getCloudSpeed()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
......@@ -1139,7 +1143,27 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
})
} else {
GameApiClient.gameApi.getCloudSpeed()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
// callback?.onCloudSpeedSuccess(true, Utils.obj2Str(result))
callUnity("Form_land", "showCloudSpeedAnim", "")
getListLandNew(2)
}
override fun onFailure(
e: Throwable?,
code: String?,
errorMsg: String?
) {
//callback?.onCloudSpeedSuccess(false, errorMsg + "")
}
})
}
}
)
})
}
......
......@@ -606,6 +606,7 @@ object MainDialog {
activity: Activity?,
speedtime: Int,
speedtimes: Int,
type: Int,
onClickListener: View.OnClickListener
) {
if (activity == null) return
......@@ -619,6 +620,7 @@ object MainDialog {
)
EventUtils.onEvent("show_cloud_speed_up_dialog", "云朵加速弹窗")
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad)
val id_img_all_speed = mDialogView?.findViewById<ImageView>(R.id.id_img_all_speed)
AdUtils.showFeedAd(activity, "cloud_speed_bigimage", layoutAd)
mDialogView.findViewById<TextView>(R.id.id_tv_speed_time)?.text = "所有土地获得${speedtime}分钟加速"
mDialogView.findViewById<TextView>(R.id.id_cloud_speed_num)?.text =
......@@ -626,8 +628,12 @@ object MainDialog {
mDialogView.findViewById<ImageView>(R.id.id_img_close_cloud_speed).setOnClickListener {
mDialog.dismiss()
}
mDialogView.findViewById<ImageView>(R.id.id_img_all_speed).setOnClickListener {
if(type==1){
id_img_all_speed.setBackgroundResource(R.drawable.select_all_speed)
}else{
id_img_all_speed.setImageResource(R.drawable.select_all_speed_no_look)
}
id_img_all_speed.setOnClickListener {
EventUtils.onEvent("click_cloud_speed_up_video_btn", "云朵加速视频点击")
onClickListener.onClick(it)
mDialog.dismiss()
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_speed_all_no_look" android:state_pressed="false"/>
<item android:drawable="@drawable/icon_speed_all_no_look_press" android:state_pressed="true"/>
</selector>
\ No newline at end of file
......@@ -9,16 +9,13 @@
<RelativeLayout
android:layout_width="345.5dp"
android:layout_height="358dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_bg_shifei" />
<ImageView
android:id="@+id/id_img_close_cloud_speed"
android:layout_width="52dp"
......@@ -26,7 +23,6 @@
android:layout_alignParentRight="true"
android:layout_marginTop="65dp" />
<LinearLayout
android:id="@+id/id_ll_content"
android:layout_width="wrap_content"
......@@ -64,7 +60,7 @@
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_44"
android:src="@drawable/select_all_speed" />
/>
<TextView
android:id="@+id/id_cloud_speed_num"
......
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