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
1b404678
Commit
1b404678
authored
Apr 01, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fetch all subs
parent
99b3335f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
+24
-4
settings.kt
...com/biganto/visual/roompark/domain/interactor/settings.kt
+7
-3
subscriptionUseCase.kt
...to/visual/roompark/domain/use_case/subscriptionUseCase.kt
+3
-0
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+9
-0
ScreenViewState.kt
.../roompark/presentation/screen/settings/ScreenViewState.kt
+5
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/domain/interactor/settings.kt
View file @
1b404678
...
...
@@ -2,7 +2,11 @@ package com.biganto.visual.roompark.domain.interactor
import
android.content.Context
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.*
import
com.biganto.visual.roompark.data.repository.db.requrey.model.Subscription
import
com.biganto.visual.roompark.domain.model.CachedDataModel
import
com.biganto.visual.roompark.domain.model.PushSwitchModel
import
com.biganto.visual.roompark.domain.model.SettingsModel
import
com.biganto.visual.roompark.domain.model.SubscriptionModel
import
com.biganto.visual.roompark.domain.use_case.AuthUseCase
import
com.biganto.visual.roompark.domain.use_case.SettingsUseCase
import
com.biganto.visual.roompark.domain.use_case.SubscriptionUseCase
...
...
@@ -23,8 +27,8 @@ class SettingsInteractor @Inject constructor(
){
fun
getSubscriptions
(
topic
:
SubscriptionTopic
)
=
subUc
.
get
Subscriptions
(
topic
)
fun
getSubscriptions
(
):
Observable
<
List
<
Subscription
>?>
=
subUc
.
get
CurrentUserSubscriptions
(
)
fun
switchSubscription
(
model
:
SubscriptionModel
,
newState
:
Boolean
):
Completable
=
when
(
newState
){
...
...
app/src/main/java/com/biganto/visual/roompark/domain/use_case/subscriptionUseCase.kt
View file @
1b404678
...
...
@@ -58,6 +58,9 @@ class SubscriptionUseCase @Inject constructor(
).
subscribeOn
(
Schedulers
.
io
())
}
fun
getCurrentUserSubscriptions
()
=
auth
.
currentUser
().
map
{
it
.
subscriptions
}
fun
getSubscriptions
(
topic
:
SubscriptionTopic
):
Observable
<
SubscriptionModel
>
=
auth
.
currentUser
()
.
map
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
View file @
1b404678
...
...
@@ -34,6 +34,15 @@ class SettingsScreenPresenter @Inject constructor(
.
map
{
settings
}}
.
map
{
SettingsScreenViewState
.
LoadSettingsList
(
it
)}
val
fetchCache
=
interactor
.
getCacheInfo
()
.
doOnNext
{
cached
->
cached
.
sortBy
{
it
.
id
}
}
.
map
{
SettingsScreenViewState
.
LoadCachInfo
(
it
)
}
val
fetchSubscriptions
=
interactor
.
getSubscriptions
()
.
doOnNext
{
cached
->
cached
.
sortBy
{
it
.
id
}
}
.
map
{
SettingsScreenViewState
.
LoadCachInfo
(
it
)
}
val
onSignOut
=
intent
(
SettingsScreen
::
signOut
)
.
flatMap
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenViewState.kt
View file @
1b404678
package
com.biganto.visual.roompark.presentation.screen.settings
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.domain.model.CachedDataModel
import
com.biganto.visual.roompark.domain.model.SettingsModel
import
com.biganto.visual.roompark.domain.model.SubscriptionModel
import
com.biganto.visual.roompark.util.monades.ExceptionString
/**
...
...
@@ -16,4 +18,6 @@ sealed class SettingsScreenViewState : BigantoBaseViewState() {
class
SomeError
(
val
exception
:
ExceptionString
)
:
SettingsScreenViewState
()
class
SignOut
()
:
SettingsScreenViewState
()
class
OnCacheDeleting
(
val
progress
:
Float
)
:
SettingsScreenViewState
()
}
\ No newline at end of file
class
LoadSubscriptions
(
val
list
:
List
<
SubscriptionModel
>)
:
SettingsScreenViewState
()
class
LoadCachInfo
(
val
list
:
List
<
CachedDataModel
>)
}
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