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
6634361d
Commit
6634361d
authored
Dec 01, 2019
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provide article id via injection
parent
5d14095e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
ScreenDI.kt
...o/visual/roompark/presentation/screen/article/ScreenDI.kt
+3
-0
ScreenPresenter.kt
...l/roompark/presentation/screen/article/ScreenPresenter.kt
+4
-2
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenDI.kt
View file @
6634361d
...
...
@@ -8,8 +8,10 @@ import dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
javax.inject.Named
const
val
ARTICLE_SCREEN_ARTICLEID
=
"ARTICLE_SCREEN_ARTICLEID_KEY"
@PerScreen
@Component
(
modules
=
[
ArticleScreenModule
::
class
],
...
...
@@ -21,6 +23,7 @@ interface ArticleScreenComponent {
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
,
@BindsInstance
@Named
(
ARTICLE_SCREEN_ARTICLEID
)
articleId
:
Int
):
ArticleScreenComponent
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenPresenter.kt
View file @
6634361d
...
...
@@ -7,6 +7,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
javax.inject.Inject
import
javax.inject.Named
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
...
...
@@ -14,7 +15,8 @@ import javax.inject.Inject
class
ArticleScreenPresenter
@Inject
constructor
(
private
val
interactor
:
ArticleInteractor
private
val
interactor
:
ArticleInteractor
,
@Named
(
ARTICLE_SCREEN_ARTICLEID
)
private
val
selectedArticleId
:
Int
)
:
BigantoBasePresenter
<
ArticleScreen
,
ArticleScreenViewState
>()
{
override
fun
defaultErrorViewStateHandler
()=
...
...
@@ -23,7 +25,7 @@ class ArticleScreenPresenter @Inject constructor(
override
fun
bindIntents
()
{
val
prefetchCards
=
interactor
.
fetchArticles
(
2
)
val
prefetchCards
=
interactor
.
fetchArticles
(
selectedArticleId
)
.
map
{
ArticleScreenViewState
.
ArticleLoaded
(
it
)
}
val
state
=
restoreStateObservable
...
...
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