Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
e6494907
Commit
e6494907
authored
Dec 19, 2019
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户版首页缓存时机
parent
0a5dc009
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
HomePresenterImpl.kt
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+14
-6
No files found.
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
e6494907
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment