Commit 21900601 by konghaorui

修复首页数据显示问题

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