Commit 47ec6836 authored by jyx's avatar jyx

代码优化

parent ccabf673
......@@ -45,6 +45,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
private val picContentPresenter by lazy { PicContentPresenter() }
private var hotPage = 1 // 分页
private var hotPageSize = Constant.PAGE_SIZE // 分页
private lateinit var hotStyleAdapter: NewHotStyleAdapter
......@@ -64,6 +65,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
override fun onResume() {
super.onResume()
hotPageSize = if (UserManager.getInstance().vipFlag) 12 else 9
onRefresh()
}
......@@ -79,14 +81,14 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
srlMainPage.resetNoMoreData()
MainExpressManager.instance.destroy()
loadAd()
picContentPresenter.getHomePageImageList(mType, hotPage, Constant.PAGE_SIZE)
picContentPresenter.getHomePageImageList(mType, hotPage, hotPageSize)
}
}
override fun onLoadMore(refreshLayout: RefreshLayout) {
hotPage = ++hotPage
picContentPresenter.getHomePageImageList(mType, hotPage, Constant.PAGE_SIZE)
picContentPresenter.getHomePageImageList(mType, hotPage, hotPageSize)
}
override fun getHomePageImageListSuc(data: BannerList) {
......@@ -100,7 +102,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
srlMainPage.finishRefresh(true)
hotStyleAdapter.setNewInstance(getAdapterData(data.list))
} else {
if (data.list.size < Constant.PAGE_SIZE) {
if (data.list.size < hotPageSize) {
srlMainPage.finishLoadMoreWithNoMoreData()
} else {
loadAd()
......
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