Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
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
Vladislav Bogdashkin
Room Park Android
Commits
9e7809d1
Commit
9e7809d1
authored
Mar 18, 2020
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set flag on startup article screen
parent
5fb56b38
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
article.kt
.../com/biganto/visual/roompark/domain/interactor/article.kt
+2
-0
ScreenPresenter.kt
...l/roompark/presentation/screen/article/ScreenPresenter.kt
+6
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/domain/interactor/article.kt
View file @
9e7809d1
...
@@ -17,6 +17,8 @@ class ArticleInteractor @Inject constructor(
...
@@ -17,6 +17,8 @@ class ArticleInteractor @Inject constructor(
fun
fetchArticle
(
articleId
:
Int
):
Observable
<
ArticleModel
>
=
fun
fetchArticle
(
articleId
:
Int
):
Observable
<
ArticleModel
>
=
uc
.
getArticle
(
articleId
)
uc
.
getArticle
(
articleId
)
fun
setArticleRead
(
articleId
:
Int
)
=
uc
.
setRead
(
articleId
)
// Single.just(
// Single.just(
// when (articleId) {
// when (articleId) {
// 2 -> article2
// 2 -> article2
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenPresenter.kt
View file @
9e7809d1
...
@@ -28,8 +28,14 @@ class ArticleScreenPresenter @Inject constructor(
...
@@ -28,8 +28,14 @@ class ArticleScreenPresenter @Inject constructor(
val
prefetchCards
=
interactor
.
fetchArticle
(
selectedArticleId
)
val
prefetchCards
=
interactor
.
fetchArticle
(
selectedArticleId
)
.
map
{
ArticleScreenViewState
.
ArticleLoaded
(
it
)
}
.
map
{
ArticleScreenViewState
.
ArticleLoaded
(
it
)
}
val
setRead
=
interactor
.
setArticleRead
(
selectedArticleId
)
.
andThen
({
ArticleScreenViewState
.
Idle
()})
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
mergeWith
(
prefetchCards
)
.
mergeWith
(
setRead
)
.
doOnError
{
Timber
.
e
(
it
)}
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
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