Commit 21900601 by konghaorui

修复首页数据显示问题

parent 9adaa2d4
......@@ -15,7 +15,6 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent
import com.ydl.component.home.HomeActivity
import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
......@@ -141,7 +140,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.navigation()
}
bt_to_home.setOnClickListener {
startActivity(Intent(this, HomeActivity::class.java))
FragmentContainerActivity.start(this,"YdlHomeFragment")
}
}
......
......@@ -8,6 +8,7 @@ import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment
import com.yidianling.im.ui.page.NewMultiMessageFragment
......@@ -63,6 +64,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContra
if ("TrendsHomeFragment" == fragmentName) {
return TrendsHomeFragment()
}
if ("YdlHomeFragment" == fragmentName) {
return YdlHomeFragment()
}
return PlayFragment()
}
}
......@@ -46,7 +46,7 @@ ext {
"m-consultant" : "0.0.52",
"m-fm" : "0.0.24",
"m-user" : "0.0.42",
"m-home" : "0.0.7",
"m-home" : "0.0.8.2",
"m-im" : "0.0.4.1",
"m-dynamic" : "0.0.2",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -243,6 +243,11 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
mView.homeDataFail(msg)
}
}, Action {
if (homeList.size != 9){
mView.homeDataFail("")
return@Action
}
homeList.sortWith(compareBy { it.type })
//更新本地缓存数据,这边顶部数据保存了两份,一个10001,一个10002,防止第二次进来读取的时候homeDataResponse回调中的remove(0)把10002删除
......
......@@ -332,8 +332,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
if (home_swipe_refresh_layout != null) {
home_swipe_refresh_layout.isRefreshing = false
}
if (!TextUtils.isEmpty(msg)){
ToastHelper.show(msg)
}
}
override fun couponDataResponse(data: List<CouponBean>) {
showCouponDialog(data)
......
......@@ -20,7 +20,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Action
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
import java.util.*
import java.util.concurrent.TimeUnit
......@@ -135,6 +134,12 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
mHomeDisposable?.dispose()
}
}, Action {
if (homeList.size!=11){
mView.homeDataFail("")
return@Action
}
homeList.sortWith(compareBy { it.type })
//更新本地缓存数据
......
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