Commit e6494907 by 徐健

修改用户版首页缓存时机

parent 0a5dc009
......@@ -133,14 +133,22 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
}
}, Action {
homeList.sortWith(compareBy { it.type })
//更新本地缓存数据
Observable.interval(5000, TimeUnit.SECONDS)
.compose(RxUtils.applySchedulers(mView))
.subscribe {
SharedPreferencesEditor.putString(CACHE_HOME_PAGER_DATA, Gson().toJson(homeList))
SharedPreferencesEditor.putString(IS_NEW_CACHE_HOME_PAGER_DATA, true.toString())
SharedPreferencesEditor.putString(
HOME_PAGER_DATA_CACHE_VERISON,
RxAppTool.getAppVersionCode(BaseApp.getApp()).toString()
)
}
mView.homeDataResponse(homeList)
//更新本地缓存数据
SharedPreferencesEditor.putString(CACHE_HOME_PAGER_DATA, Gson().toJson(homeList))
SharedPreferencesEditor.putString(IS_NEW_CACHE_HOME_PAGER_DATA, true.toString())
SharedPreferencesEditor.putString(
HOME_PAGER_DATA_CACHE_VERISON,
RxAppTool.getAppVersionCode(BaseApp.getApp()).toString()
)
HomeLogPrinter.printLongLog(
HomePresenterImpl::class.java.simpleName,
Gson().toJson(homeList)
......
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