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
403a7924
Commit
403a7924
authored
Apr 09, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete tour db data
parent
47136304
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
5 deletions
+69
-5
ToursRepository.kt
...nto/visual/roompark/data/data_provider/ToursRepository.kt
+42
-0
IDb.kt
...ava/com/biganto/visual/roompark/data/repository/db/IDb.kt
+3
-0
RequeryRepository.kt
.../roompark/data/repository/db/requrey/RequeryRepository.kt
+7
-0
AppComponent.kt
...ava/com/biganto/visual/roompark/di/dagger/AppComponent.kt
+2
-0
DataModule.kt
.../java/com/biganto/visual/roompark/di/dagger/DataModule.kt
+4
-0
TourContract.kt
...m/biganto/visual/roompark/domain/contract/TourContract.kt
+2
-0
settingsUseCase.kt
...iganto/visual/roompark/domain/use_case/settingsUseCase.kt
+7
-4
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+1
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/ToursRepository.kt
0 → 100644
View file @
403a7924
package
com.biganto.visual.roompark.data.data_provider
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.file.FileModule
import
com.biganto.visual.roompark.domain.contract.TourContract
import
com.biganto.visual.roompark.domain.model.AuthInfoModel
import
io.reactivex.Completable
import
io.reactivex.Observable
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 29.10.2019.
*/
//@Singleton
class
ToursRepository
@Inject
constructor
(
private
val
files
:
FileModule
,
private
val
db
:
IDb
):
TourContract
{
override
fun
getMultiTourId
(
building
:
Int
,
number
:
Int
):
Observable
<
AuthInfoModel
>
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
override
fun
getOffer
(
offerId
:
Int
):
Observable
<
AuthInfoModel
>
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
override
fun
deleteToursDbInfo
():
Completable
=
Completable
.
merge
(
arrayListOf
(
db
.
dropTourFileJuncTable
(),
db
.
dropFileTable
(),
db
.
dropTourTable
()
))
.
doOnComplete
{
Timber
.
w
(
"Completed --"
)
}
.
doOnError
{
Timber
.
e
(
it
)
}
}
app/src/main/java/com/biganto/visual/roompark/data/repository/db/IDb.kt
View file @
403a7924
...
...
@@ -69,4 +69,7 @@ interface IDb {
fun
getTourPreview
(
tourId
:
String
):
ReactiveResult
<
TourPreviewEntity
>
fun
getTourPreviewsObservableResult
(
estateId
:
Int
):
Observable
<
ReactiveResult
<
TourPreviewEntity
>>
fun
getEstateTourPreviews
(
estateId
:
Int
):
Observable
<
List
<
TourPreviewEntity
>>
fun
dropFileTable
():
Completable
fun
dropTourFileJuncTable
():
Completable
fun
dropTourTable
():
Completable
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/RequeryRepository.kt
View file @
403a7924
...
...
@@ -14,6 +14,7 @@ import io.reactivex.BackpressureStrategy
import
io.reactivex.Completable
import
io.reactivex.Observable
import
io.reactivex.Single
import
io.reactivex.rxkotlin.toCompletable
import
io.reactivex.schedulers.Schedulers
import
io.requery.Persistable
import
io.requery.android.sqlite.DatabaseSource
...
...
@@ -51,6 +52,12 @@ class RequeryRepository @Inject constructor(
)
:
IDb
{
override
fun
dropTourTable
()
=
store
.
delete
(
TourPreviewEntity
::
class
).
get
().
toCompletable
()
override
fun
dropTourFileJuncTable
()
=
store
.
delete
(
TourFileJunctionEntity
::
class
).
get
().
toCompletable
()
override
fun
dropFileTable
()
=
store
.
delete
(
FileEntity
::
class
).
get
().
toCompletable
()
private
inline
fun
<
reified
T
:
Persistable
>
fetchAll
()
=
store
.
select
(
T
::
class
)
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/AppComponent.kt
View file @
403a7924
...
...
@@ -62,6 +62,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun
provideUtils
():
DeviceUtilsContract
fun
provideTour
():
TourContract
fun
provideAppContext
():
Application
fun
provideFileSystem
():
FileModule
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/DataModule.kt
View file @
403a7924
...
...
@@ -51,6 +51,10 @@ abstract class ContractRepositoryModule {
@Binds
@Singleton
abstract
fun
provideDeviceContract
(
impl
:
DeviceUtilsRepository
):
DeviceUtilsContract
@Binds
@Singleton
abstract
fun
provideTourContract
(
impl
:
ToursRepository
):
TourContract
}
...
...
app/src/main/java/com/biganto/visual/roompark/domain/contract/TourContract.kt
View file @
403a7924
package
com.biganto.visual.roompark.domain.contract
import
com.biganto.visual.roompark.domain.model.AuthInfoModel
import
io.reactivex.Completable
import
io.reactivex.Observable
...
...
@@ -10,4 +11,5 @@ import io.reactivex.Observable
interface
TourContract
{
fun
getMultiTourId
(
building
:
Int
,
number
:
Int
)
:
Observable
<
AuthInfoModel
>
fun
getOffer
(
offerId
:
Int
)
:
Observable
<
AuthInfoModel
>
fun
deleteToursDbInfo
():
Completable
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/use_case/settingsUseCase.kt
View file @
403a7924
...
...
@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.domain.use_case
import
com.biganto.visual.roompark.data.data_provider.AuthContractModule
import
com.biganto.visual.roompark.domain.contract.FilesContract
import
com.biganto.visual.roompark.domain.contract.TourContract
import
io.reactivex.Observable
import
javax.inject.Inject
...
...
@@ -11,12 +12,14 @@ import javax.inject.Inject
class
SettingsUseCase
@Inject
constructor
(
private
val
authContract
:
AuthContractModule
,
private
val
fileContract
:
FilesContract
private
val
fileContract
:
FilesContract
,
private
val
tourContract
:
TourContract
){
fun
signOut
()
=
authContract
.
signOut
()
fun
clearAllCache
()
=
fileContract
.
deleteAllFiles
()
fun
clearAllCache
():
Observable
<
Pair
<
Int
,
Int
>>
=
tourContract
.
deleteToursDbInfo
()
.
andThen
(
fileContract
.
deleteAllFiles
())
val
planTypesSize
get
()
=
Observable
.
defer
{
Observable
.
just
(
fileContract
.
getPlansSize
())
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
View file @
403a7924
...
...
@@ -96,6 +96,7 @@ class SettingsScreenPresenter @Inject constructor(
.
flatMap
{
interactor
.
deleteCacheFiles
()
.
map
<
SettingsScreenViewState
>
{
Timber
.
d
(
" got progress: ${it.first} / ${it.second.toFloat()}"
)
SettingsScreenViewState
.
OnCacheDeleting
(
it
.
first
/
it
.
second
.
toFloat
()
)
...
...
app/src/main/res/layout/activity_main.xml
View file @
403a7924
...
...
@@ -127,7 +127,7 @@
android:fitsSystemWindows=
"true"
android:visibility=
"gone"
app:elevation=
"0dp"
app:itemBackground=
"@color/color
OpacityBackgroundInv
"
app:itemBackground=
"@color/color
Primary
"
app:itemHorizontalTranslationEnabled=
"false"
app:itemIconTint=
"@drawable/bottom_navigation_icon_selector"
app:labelVisibilityMode=
"unlabeled"
...
...
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