Commit ba1bed4e authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent fd3309b6
......@@ -52,7 +52,7 @@ class InsertScreenAdManager {
}
override fun adClose() {
wifiAdStatusListener?.adClose()
}
})
}
......@@ -76,7 +76,7 @@ class InsertScreenAdManager {
}
override fun adClose() {
wifiAdStatusListener?.adClose()
}
})
}
......
......@@ -133,7 +133,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
public void reportAddCoinMsg(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.reportAddCoinMsg(vo),
new BaseSubscriber<BaseResponse<Object>>() {
new BaseSubscriber<BaseResponse<JsonObject>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
......@@ -145,7 +145,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
public void onNext(BaseResponse<JsonObject> baseResponse) {
if (isLinkView()) return;
}
});
......
package com.mints.flowbox.mvp.presenters
import android.app.Activity
import com.mints.flowbox.MintsApplication
import com.mints.flowbox.mvp.model.BaseResponse
import com.mints.flowbox.mvp.views.VideoAdManagerView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import rx.android.schedulers.AndroidSchedulers
import java.util.*
class TzVideoAdPresenter : BasePresenter<VideoAdManagerView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return
loanApplication = activity.application as MintsApplication
loanService = loanApplication.loanService
subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(loanApplication.defaultSubscribeScheduler())
.subscribe(object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<Any>) {}
})
}
fun dispose() {
loanService = null
loanApplication = null
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe()
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.mints.flowbox.mvp.presenters;
import android.app.Activity;
import com.google.gson.JsonObject;
import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.mvp.model.BaseResponse;
import com.mints.flowbox.mvp.views.VideoAdManagerView;
......@@ -30,7 +31,7 @@ public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> {
subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(loanApplication.defaultSubscribeScheduler())
.subscribe(new BaseSubscriber<BaseResponse<Object>>() {
.subscribe(new BaseSubscriber<BaseResponse<JsonObject>>() {
@Override
public void onCompleted() {
......@@ -42,7 +43,7 @@ public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
public void onNext(BaseResponse<JsonObject> baseResponse) {
}
});
......
......@@ -715,8 +715,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
val rateBig = BigDecimal("10000")
val cashStr = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
if (data.gromoreCoin > 0) {
tvAwardContent.text = "${data.gromoreCoin}金币已到账"
if (AppConfig.awardCoin > 0) {
tvAwardContent.text = "${AppConfig.awardCoin}金币已到账"
tvAwardNext.visibility = View.GONE
}
......
......@@ -126,6 +126,14 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
insertScreenAdManager?.setInsertScreenAdStatusListener(object :
WifiAdStatusListener {
override fun adSuccess() {
}
override fun adFail() {
}
override fun adClose() {
try {
if (turnTableData?.surplus!! <= 0) {
return
......@@ -142,14 +150,6 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
e.printStackTrace()
}
}
override fun adFail() {
}
override fun adClose() {
}
})
switchButton?.isOpened =
......
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