Commit 26d3ffac authored by jyx's avatar jyx

代码优化

parent b626982e
......@@ -79,6 +79,7 @@ class TaskPresenter : BasePresenter<TaskView>() {
view.getCpdModelSuc(data)
}
} else {
view.getCpdModelFail()
view.showToast(response.message)
}
}
......
......@@ -6,4 +6,6 @@ interface TaskView : BaseView {
fun getShCpdTimeSuc(time: Int, CPD: Int, CPD_SYD: Int)
fun getCpdModelSuc(dataBean: CpdModelBean.DataBean)
fun getCpdModelFail()
}
\ No newline at end of file
......@@ -46,8 +46,7 @@ public interface CpdService {
class Factory {
private Factory() {
}
private Factory() { }
private static CpdService sCpdService;
......
......@@ -167,7 +167,9 @@ class TaskActivity : BaseActivity(), TaskView,
mFakeTaskList.add(tzTaskBean)
}
// 多拉取的广告
LogUtil.d(TAG_LOG, "CPD -> getCpdModelSuc")
// 多拉取的CPD广告
if (cpdLoadCountTime++ == cpdMax - 1) {
hideLoading()
srl_task.finishRefresh()
......@@ -187,6 +189,13 @@ class TaskActivity : BaseActivity(), TaskView,
}
}
override fun getCpdModelFail() {
if (cpdLoadCountTime == cpdMax - 1) {
hideLoading()
srl_task.finishRefresh()
}
}
override fun onRefresh(refreshLayout: RefreshLayout) {
loadData()
}
......@@ -343,8 +352,8 @@ class TaskActivity : BaseActivity(), TaskView,
if (mFakeTaskList[position].isShCpd) {
taskDialog = TaskDialog(this)
taskDialog?.setData(mFakeTaskList[position].coralAd, needUseTime, mCoin)
taskDialog?.show()
taskDialog?.setData(mFakeTaskList[position].coralAd, needUseTime, mCoin)
} else {
taskCpdDialog = TaskCpdDialog(this, object : DialogListener() {
override fun onClick(v: View?) {
......
......@@ -14,8 +14,7 @@ import com.tz.sdk.core.ui.ADContainer
/**
* 提示弹框
*/
class TaskDialog(context: Context) :
Dialog(context, R.style.dialog) {
class TaskDialog(context: Context) : Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val tvTitle: TextView
private val tvText1: TextView
......
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