Commit b1311615 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 98809533
...@@ -308,7 +308,7 @@ public class VideoAdingManager { ...@@ -308,7 +308,7 @@ public class VideoAdingManager {
int randomWeight = r.nextInt(weight) + 1; int randomWeight = r.nextInt(weight) + 1;
LogUtil.d(TAG, "2、权重随机值:" + randomWeight); LogUtil.d(TAG, "2、权重随机值:" + randomWeight);
ToastUtil.show(MintsApplication.getContext(), "权重随机值:" + randomWeight); // ToastUtil.show(MintsApplication.getContext(), "权重随机值:" + randomWeight);
for (WeightBean weightBean : weightList) { for (WeightBean weightBean : weightList) {
randomWeight -= weightBean.getWeight(); randomWeight -= weightBean.getWeight();
......
...@@ -128,7 +128,7 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView ...@@ -128,7 +128,7 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG_POSTID(); ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG_POSTID();
break; break;
} }
ToastUtil.show(MintsApplication.getContext(), "ylh vedio:" + ylhPostId); // ToastUtil.show(MintsApplication.getContext(), "ylh vedio:" + ylhPostId);
if (rewardVideoAD != null) { if (rewardVideoAD != null) {
rewardVideoAD = null; rewardVideoAD = null;
} }
......
...@@ -15,7 +15,6 @@ import com.mints.goodmoney.utils.LogUtil ...@@ -15,7 +15,6 @@ import com.mints.goodmoney.utils.LogUtil
import com.mints.library.net.neterror.BaseSubscriber import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable import com.mints.library.net.neterror.Throwable
import com.mints.library.utils.json.JsonUtil import com.mints.library.utils.json.JsonUtil
import kotlin.collections.HashMap
class TaskPresenter : BasePresenter<TaskView>() { class TaskPresenter : BasePresenter<TaskView>() {
...@@ -30,12 +29,15 @@ class TaskPresenter : BasePresenter<TaskView>() { ...@@ -30,12 +29,15 @@ class TaskPresenter : BasePresenter<TaskView>() {
override fun onCompleted() { override fun onCompleted() {
} }
override fun onError(e: Throwable) {} override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) { override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
val message = baseResponse.message
val data = baseResponse.data val data = baseResponse.data
when (code) { when (code) {
200 -> { 200 -> {
......
...@@ -28,7 +28,8 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -28,7 +28,8 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
private var currentFragment: Fragment? = null private var currentFragment: Fragment? = null
private var mainFragment: Fragment? = null private var mainFragment: Fragment? = null
private var bookStoreFragment: Fragment? = null private var bookStoreFragment: Fragment? = null
// private var newsFragment: Fragment? = null
// private var newsFragment: Fragment? = null
private var xmlyGameFragment: Fragment? = null private var xmlyGameFragment: Fragment? = null
private var liebaoGameFragment: Fragment? = null private var liebaoGameFragment: Fragment? = null
private var kuYinyueFragment: Fragment? = null private var kuYinyueFragment: Fragment? = null
...@@ -48,10 +49,6 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -48,10 +49,6 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
} else if (curPosition == 3) { } else if (curPosition == 3) {
liebaoGameFragment?.onHiddenChanged(hidden) liebaoGameFragment?.onHiddenChanged(hidden)
} }
} else {
if (curPosition == 1) {
liebaoGameFragment?.onHiddenChanged(hidden)
}
} }
super.onHiddenChanged(hidden) super.onHiddenChanged(hidden)
...@@ -109,14 +106,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -109,14 +106,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
currentFragment = xmlyGameFragment currentFragment = xmlyGameFragment
} }
xtFragmentMoney.setxTabDisplayNum(2) xtFragmentMoney.setxTabDisplayNum(1)
val newTab4 = xtFragmentMoney.newTab() val newTab4 = xtFragmentMoney.newTab()
newTab4.text = "听书" newTab4.text = "听书"
val newTab5 = xtFragmentMoney.newTab()
newTab5.text = "游戏"
// xtFragmentMoney.addTab(newTab3)
xtFragmentMoney.addTab(newTab4) xtFragmentMoney.addTab(newTab4)
xtFragmentMoney.addTab(newTab5)
xtFragmentMoney.addOnTabSelectedListener(this) xtFragmentMoney.addOnTabSelectedListener(this)
} }
...@@ -191,17 +184,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -191,17 +184,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
} }
1 -> { 1 -> {
if (AppConfig.showAdFlag) { if (bookStoreFragment == null) {
if (bookStoreFragment == null) { bookStoreFragment = ZhangyueFragment()
bookStoreFragment = ZhangyueFragment()
}
addOrShowFragment(childFragmentManager, bookStoreFragment!!, FRAGMENT_TAG_BOOKSTORE)
} else {
if (liebaoGameFragment == null) {
liebaoGameFragment = LiebaoGameFragment()
}
addOrShowFragment(childFragmentManager, liebaoGameFragment!!, FRAGMENT_TAG_GAME)
} }
addOrShowFragment(childFragmentManager, bookStoreFragment!!, FRAGMENT_TAG_BOOKSTORE)
} }
// 2 -> { // 2 -> {
// if (newsFragment == null) { // if (newsFragment == null) {
......
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