Commit 274da8b4 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 304a686e
......@@ -8,7 +8,6 @@ import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.duben.xixiplaylet.R
import com.duben.xixiplaylet.ad.express.ExpressAdCallback
import com.duben.xixiplaylet.ad.express.MainExpressManager
import com.duben.xixiplaylet.common.Constant
import com.duben.xixiplaylet.manager.LocalVedioManager
import com.duben.xixiplaylet.mvp.model.*
......@@ -77,8 +76,6 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
println("mcg _______")
hotPage = 1
srlMainPage.resetNoMoreData()
MainExpressManager.instance.destroy()
loadAd()
picContentPresenter.getHomePageImageList(mType, hotPage, Constant.PAGE_SIZE)
}
......@@ -103,7 +100,6 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
if (data.list.size < Constant.PAGE_SIZE) {
srlMainPage.finishLoadMoreWithNoMoreData()
} else {
loadAd()
srlMainPage.finishLoadMore()
}
hotStyleAdapter.addData(getAdapterData(data.list))
......@@ -146,24 +142,6 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
return data
}
private fun loadAd() {
if (UserManager.getInstance().vipFlag) return
MainExpressManager.instance.loadAd(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
}
override fun renderSuccess(adView: FrameLayout?): Boolean {
adView?.let { addAdView(it) }
return false
}
override fun loadFail() {
}
})
}
private fun addAdView(adView: FrameLayout) {
// 默认每各6个加1个
var insertIndex = 2
......@@ -186,7 +164,6 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
override fun onDestroyView() {
super.onDestroyView()
MainExpressManager.instance.destroy()
}
}
\ No newline at end of file
......@@ -83,7 +83,6 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_THREE) {
if (AntiShake.check(ll_my_record?.id)) return
if (!TextUtils.isEmpty(userManager?.userID)) {
myPresenter.showTurn()
myPresenter.getMyInfo()
......
......@@ -16,8 +16,8 @@
<Tumblr Enable="false" />
<Email Enable="false" />
<ShortMessage Enable="false" />
<Wechat AppId="wx7e946f66585ca00a" AppSecret="6fe41783e736bea36504b271cea484f1" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" />
<WechatMoments AppId="wx7e946f66585ca00a" AppSecret="6fe41783e736bea36504b271cea484f1" />
<Wechat AppId="wx10e29b733b8c71c7" AppSecret="93add1e49825bd4992ba8b6792630a7d" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" />
<WechatMoments AppId="wx10e29b733b8c71c7" AppSecret="93add1e49825bd4992ba8b6792630a7d" />
<QQ Enable="false" />
<Instapaper Enable="false" />
<Pocket Enable="false" />
......
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