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
3f7f30b5
Commit
3f7f30b5
authored
Apr 03, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes
parent
a4a7079b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
19 deletions
+30
-19
ScreenPresenter.kt
...ual/roompark/presentation/screen/deals/ScreenPresenter.kt
+16
-10
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+1
-4
ScreenPresenter.kt
...roompark/presentation/screen/favorites/ScreenPresenter.kt
+13
-5
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenPresenter.kt
View file @
3f7f30b5
...
...
@@ -4,6 +4,7 @@ import com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.DealsInteractor
import
com.biganto.visual.roompark.domain.model.DealPreviewModel
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
...
...
@@ -20,7 +21,7 @@ class DealsScreenPresenter @Inject constructor(
:
BigantoBasePresenter
<
DealsScreen
,
DealsScreenViewState
>()
{
override
fun
defaultErrorViewStateHandler
()
=
{
e
:
ExceptionString
->
DealsScreenViewState
.
SomeError
(
e
)
}
{
e
:
ExceptionString
->
DealsScreenViewState
.
SomeError
(
e
)
}
override
fun
bindIntents
()
{
...
...
@@ -29,22 +30,27 @@ class DealsScreenPresenter @Inject constructor(
val
fetchDeals
=
interactor
.
fetchDeals
()
.
flatMap
{
deals
->
getStatusList
.
map
{
List
(
deals
.
size
)
{
index
->
DealPreviewModel
(
Pair
(
deals
[
index
],
it
)
)
}
}
.
map
{
List
(
deals
.
size
)
{
index
->
DealPreviewModel
(
Pair
(
deals
[
index
],
it
)
)
}
}
}
.
map
(
DealsScreenViewState
::
DealsLoaded
)
val
state
=
restoreStateObservable
.
mergeWith
(
fetchDeals
)
.
doOnError
{
Timber
.
e
(
it
)}
val
state
=
Observable
.
mergeDelayError
(
arrayListOf
(
restoreStateObservable
,
fetchDeals
)
)
.
doOnError
{
Timber
.
e
(
it
)
}
.
onErrorReturn
(
::
parseError
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
DealsScreenViewState
::
class
.
java
),
DealsScreen
::
render
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
3f7f30b5
...
...
@@ -74,7 +74,7 @@ class EstateScreenController :
.
observeOn
(
AndroidSchedulers
.
mainThread
())
override
fun
tourCardClicked
():
Observable
<
Int
>
=
startToourCard
.
clicks
()
tourScreen
.
clicks
()
.
map
{
1
}
.
debounce
(
320L
,
TimeUnit
.
MILLISECONDS
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
@@ -119,9 +119,6 @@ class EstateScreenController :
@Inject
override
lateinit
var
injectedPresenter
:
EstateScreenPresenter
@BindView
(
R
.
id
.
start_tour_image_view
)
lateinit
var
startToourCard
:
View
@BindView
(
R
.
id
.
flatTypesCustomView
)
lateinit
var
flatTypeView
:
ViewGroup
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenPresenter.kt
View file @
3f7f30b5
...
...
@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.favorites
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.FavoritesInteractor
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
...
...
@@ -19,21 +20,28 @@ class FavoritesScreenPresenter @Inject constructor(
:
BigantoBasePresenter
<
FavoritesScreen
,
FavoritesScreenViewState
>()
{
override
fun
defaultErrorViewStateHandler
()
=
{
e
:
ExceptionString
->
FavoritesScreenViewState
.
SomeError
(
e
)
}
{
e
:
ExceptionString
->
FavoritesScreenViewState
.
SomeError
(
e
)
}
override
fun
bindIntents
()
{
val
prefetchCards
=
interactor
.
getFavoritesForCurrentUser
()
.
map
{
FavoritesScreenViewState
.
FavoriteEstatesLoaded
(
it
)
}
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
doOnError
{
Timber
.
e
(
it
)}
val
state
=
Observable
.
mergeDelayError
(
arrayListOf
(
restoreStateObservable
,
prefetchCards
)
)
.
doOnError
{
Timber
.
e
(
it
)
}
.
onErrorReturn
(
::
parseError
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
FavoritesScreenViewState
::
class
.
java
),
FavoritesScreen
::
render
)
subscribeViewState
(
state
.
cast
(
FavoritesScreenViewState
::
class
.
java
),
FavoritesScreen
::
render
)
}
}
\ No newline at end of file
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