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
991e8526
Commit
991e8526
authored
Apr 01, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings fix subs
album not switching issue
parent
29c64683
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
ScreenController.kt
...l/roompark/presentation/screen/albums/ScreenController.kt
+3
-1
ScreenPresenter.kt
...al/roompark/presentation/screen/albums/ScreenPresenter.kt
+9
-4
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+1
-1
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+2
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenController.kt
View file @
991e8526
...
@@ -34,6 +34,7 @@ import io.reactivex.Observable
...
@@ -34,6 +34,7 @@ import io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
jp.wasabeef.glide.transformations.BlurTransformation
import
jp.wasabeef.glide.transformations.BlurTransformation
import
jp.wasabeef.glide.transformations.ColorFilterTransformation
import
jp.wasabeef.glide.transformations.ColorFilterTransformation
import
timber.log.Timber
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.TimeUnit
import
javax.inject.Inject
import
javax.inject.Inject
...
@@ -178,10 +179,11 @@ class AlbumsScreenController :
...
@@ -178,10 +179,11 @@ class AlbumsScreenController :
private
fun
render
(
viewState
:
AlbumsScreenViewState
.
SubscriptionStatus
)
{
private
fun
render
(
viewState
:
AlbumsScreenViewState
.
SubscriptionStatus
)
{
val
sw
=
toolBar
.
headerToolbar
.
findViewById
<
SwitchMaterial
>(
R
.
id
.
switch1
)
val
sw
=
toolBar
.
headerToolbar
.
findViewById
<
SwitchMaterial
>(
R
.
id
.
switch1
)
Timber
.
d
()
if
(
sw
.
isChecked
!=
viewState
.
subState
)
if
(
sw
.
isChecked
!=
viewState
.
subState
)
{
{
silentCheck
=
true
silentCheck
=
true
sw
.
isChecked
!=
sw
.
isChecked
sw
.
isChecked
=
viewState
.
subState
}
}
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenPresenter.kt
View file @
991e8526
...
@@ -54,7 +54,7 @@ class AlbumsScreenPresenter @Inject constructor(
...
@@ -54,7 +54,7 @@ class AlbumsScreenPresenter @Inject constructor(
val
fetchSubscription
=
interactor
.
getSubscriptions
(
currentAlbumTopic
)
val
fetchSubscription
=
interactor
.
getSubscriptions
(
currentAlbumTopic
)
.
doAfterNext
{
restoreModel
.
sub
=
it
}
.
doAfterNext
{
restoreModel
.
sub
=
it
}
.
map
<
AlbumsScreenViewState
>
{
AlbumsScreenViewState
.
SubscriptionStatus
(
it
.
state
)
}
.
map
<
AlbumsScreenViewState
>
{
AlbumsScreenViewState
.
SubscriptionStatus
(
it
.
state
)
}
.
startWith
(
Observable
.
just
<
AlbumsScreenViewState
>(
AlbumsScreenViewState
.
Idle
()))
//
.startWith(Observable.just<AlbumsScreenViewState>(AlbumsScreenViewState.Idle()))
val
fetchParents
=
interactor
.
fetchHeaderAlbums
()
val
fetchParents
=
interactor
.
fetchHeaderAlbums
()
.
filter
{
!
it
.
isNullOrEmpty
()
}
.
filter
{
!
it
.
isNullOrEmpty
()
}
...
@@ -63,13 +63,18 @@ class AlbumsScreenPresenter @Inject constructor(
...
@@ -63,13 +63,18 @@ class AlbumsScreenPresenter @Inject constructor(
val
fetchSelected
=
requestAlbum
(
selectedIndex
)
val
fetchSelected
=
requestAlbum
(
selectedIndex
)
val
headerItemSelected
=
intent
(
AlbumsScreen
::
onAlbumSelected
)
val
headerItemSelected
=
Observable
.
mergeDelayError
(
arrayListOf
(
intent
(
AlbumsScreen
::
onAlbumSelected
)
.
doOnNext
{
selectedIndex
=
it
.
albumId
}
.
doOnNext
{
selectedIndex
=
it
.
albumId
}
.
doOnNext
{
restoreModel
.
currentIndex
=
it
.
albumId
}
.
doOnNext
{
restoreModel
.
currentIndex
=
it
.
albumId
}
.
flatMap
<
AlbumsScreenViewState
>
{
model
->
.
flatMap
<
AlbumsScreenViewState
>
{
model
->
requestAlbum
(
model
.
albumId
)
requestAlbum
(
model
.
albumId
)
.
startWith
(
Observable
.
just
(
AlbumsScreenViewState
.
HeaderAlbumChoosed
(
item
=
model
)))
.
startWith
(
Observable
.
just
<
AlbumsScreenViewState
>(
AlbumsScreenViewState
.
HeaderAlbumChoosed
(
item
=
model
))
}
)
},
fetchSubscription
))
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
View file @
991e8526
...
@@ -204,7 +204,7 @@ class DealScreenController :
...
@@ -204,7 +204,7 @@ class DealScreenController :
if
(
sw
.
isChecked
!=
viewState
.
subState
)
if
(
sw
.
isChecked
!=
viewState
.
subState
)
{
{
silentCheck
=
true
silentCheck
=
true
sw
.
isChecked
!=
sw
.
isChecked
sw
.
isChecked
=
viewState
.
subState
}
}
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
View file @
991e8526
...
@@ -89,7 +89,7 @@ class SettingsScreenPresenter @Inject constructor(
...
@@ -89,7 +89,7 @@ class SettingsScreenPresenter @Inject constructor(
val
refreshInfo
=
intent
(
SettingsScreen
::
refreshCacheInfo
)
val
refreshInfo
=
intent
(
SettingsScreen
::
refreshCacheInfo
)
.
flatMap
{
fetch
Settings
}
.
flatMap
{
fetch
Cache
}
val
onClearCache
=
intent
(
SettingsScreen
::
clearCache
)
val
onClearCache
=
intent
(
SettingsScreen
::
clearCache
)
.
flatMap
{
.
flatMap
{
...
@@ -100,6 +100,7 @@ class SettingsScreenPresenter @Inject constructor(
...
@@ -100,6 +100,7 @@ class SettingsScreenPresenter @Inject constructor(
)
)
}
}
.
startWith
(
SettingsScreenViewState
.
OnCacheDeleting
(
0f
))
.
startWith
(
SettingsScreenViewState
.
OnCacheDeleting
(
0f
))
.
doOnError
{
Timber
.
e
(
it
)
}
.
onErrorReturn
(
::
parseError
)
.
onErrorReturn
(
::
parseError
)
}
}
...
...
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