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
47136304
Commit
47136304
authored
Apr 09, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix update cache info; add delay to show progress bar
parent
abd6e913
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
settings.kt
...com/biganto/visual/roompark/domain/interactor/settings.kt
+3
-3
settingsUseCase.kt
...iganto/visual/roompark/domain/use_case/settingsUseCase.kt
+5
-5
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+2
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/domain/interactor/settings.kt
View file @
47136304
...
@@ -36,9 +36,9 @@ class SettingsInteractor @Inject constructor(
...
@@ -36,9 +36,9 @@ class SettingsInteractor @Inject constructor(
}
}
private
val
plans
private
val
plans
:
Observable
<
CachedDataModel
>
get
()
=
settingsUseCase
.
planTypesSize
.
map
{
get
()
=
settingsUseCase
.
planTypesSize
.
map
{
CachedDataModel
(
activity
.
resources
.
getString
(
R
.
string
.
plans_cache
),
it
,
1
)
CachedDataModel
(
activity
.
resources
.
getString
(
R
.
string
.
plans_cache
),
it
,
1
)
}
}
private
val
tours
private
val
tours
...
@@ -64,7 +64,7 @@ class SettingsInteractor @Inject constructor(
...
@@ -64,7 +64,7 @@ class SettingsInteractor @Inject constructor(
fun
deleteCacheFiles
()
=
settingsUseCase
.
clearAllCache
()
fun
deleteCacheFiles
()
=
settingsUseCase
.
clearAllCache
()
fun
getCacheInfo
()
=
fun
getCacheInfo
()
:
Observable
<
MutableList
<
CachedDataModel
>>
=
Observable
.
concatArray
(
plans
,
tours
,
feeds
,
albums
,
overall
).
toList
().
toObservable
()
Observable
.
concatArray
(
plans
,
tours
,
feeds
,
albums
,
overall
).
toList
().
toObservable
()
fun
fetchSettings
():
Observable
<
SettingsModel
>
=
Observable
.
just
(
sampleSettings
)
fun
fetchSettings
():
Observable
<
SettingsModel
>
=
Observable
.
just
(
sampleSettings
)
...
...
app/src/main/java/com/biganto/visual/roompark/domain/use_case/settingsUseCase.kt
View file @
47136304
...
@@ -19,18 +19,18 @@ class SettingsUseCase @Inject constructor(
...
@@ -19,18 +19,18 @@ class SettingsUseCase @Inject constructor(
fun
clearAllCache
()
=
fileContract
.
deleteAllFiles
()
fun
clearAllCache
()
=
fileContract
.
deleteAllFiles
()
val
planTypesSize
val
planTypesSize
get
()
=
Observable
.
just
(
fileContract
.
getPlansSize
())
get
()
=
Observable
.
defer
{
Observable
.
just
(
fileContract
.
getPlansSize
())
}
val
albumsSize
val
albumsSize
get
()
=
Observable
.
just
(
fileContract
.
getAlbumSize
())
get
()
=
Observable
.
defer
{
Observable
.
just
(
fileContract
.
getAlbumSize
())
}
val
feedsSize
val
feedsSize
get
()
=
Observable
.
just
(
fileContract
.
getFeedSize
())
get
()
=
Observable
.
defer
{
Observable
.
just
(
fileContract
.
getFeedSize
())
}
val
toursSize
val
toursSize
get
()
=
Observable
.
just
(
fileContract
.
getToursSize
())
get
()
=
Observable
.
defer
{
Observable
.
just
(
fileContract
.
getToursSize
())
}
val
overallSize
val
overallSize
get
()
=
Observable
.
just
(
fileContract
.
allCacheSize
())
get
()
=
Observable
.
defer
{
Observable
.
just
(
fileContract
.
allCacheSize
())
}
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
View file @
47136304
...
@@ -11,6 +11,7 @@ import io.reactivex.Observable
...
@@ -11,6 +11,7 @@ import io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
timber.log.Timber
import
java.util.concurrent.TimeUnit
import
javax.inject.Inject
import
javax.inject.Inject
/**
/**
...
@@ -99,6 +100,7 @@ class SettingsScreenPresenter @Inject constructor(
...
@@ -99,6 +100,7 @@ class SettingsScreenPresenter @Inject constructor(
it
.
first
/
it
.
second
.
toFloat
()
it
.
first
/
it
.
second
.
toFloat
()
)
)
}
}
.
delay
(
500
,
TimeUnit
.
MILLISECONDS
)
.
startWith
(
SettingsScreenViewState
.
OnCacheDeleting
(
0f
))
.
startWith
(
SettingsScreenViewState
.
OnCacheDeleting
(
0f
))
.
doOnError
{
Timber
.
e
(
it
)
}
.
doOnError
{
Timber
.
e
(
it
)
}
}
}
...
...
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