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
64cd117d
Commit
64cd117d
authored
Jan 16, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround
parent
991bfac7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
19 deletions
+28
-19
FilesRepository.kt
...nto/visual/roompark/data/data_provider/FilesRepository.kt
+15
-3
AppComponent.kt
...ava/com/biganto/visual/roompark/di/dagger/AppComponent.kt
+3
-4
DataModule.kt
.../java/com/biganto/visual/roompark/di/dagger/DataModule.kt
+6
-8
settings.kt
...com/biganto/visual/roompark/domain/interactor/settings.kt
+2
-2
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+2
-2
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/FilesRepository.kt
View file @
64cd117d
...
@@ -6,6 +6,7 @@ import com.biganto.visual.roompark.data.repository.db.IDb
...
@@ -6,6 +6,7 @@ import com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.file.FileModule
import
com.biganto.visual.roompark.data.repository.file.FileModule
import
com.biganto.visual.roompark.domain.contract.FilesContract
import
com.biganto.visual.roompark.domain.contract.FilesContract
import
com.biganto.visual.roompark.util.extensions.folderSize
import
com.biganto.visual.roompark.util.extensions.folderSize
import
timber.log.Timber
import
java.io.File
import
java.io.File
import
javax.inject.Inject
import
javax.inject.Inject
import
kotlin.reflect.full.primaryConstructor
import
kotlin.reflect.full.primaryConstructor
...
@@ -23,11 +24,22 @@ class FilesContractModule @Inject constructor(
...
@@ -23,11 +24,22 @@ class FilesContractModule @Inject constructor(
):
FilesContract
{
):
FilesContract
{
private
inline
fun
<
reified
T
:
FileModule
.
FileDirectory
>
getDirectory
():
T
?
=
private
inline
fun
<
reified
T
:
FileModule
.
FileDirectory
>
getDirectory
():
T
?
{
T
::
class
.
primaryConstructor
?.
call
()
val
type
=
T
::
class
Timber
.
d
(
"Type is :$type"
)
val
inst
=
type
.
primaryConstructor
?.
call
(
null
,
null
)
Timber
.
d
(
"inst is :$inst"
)
//val inst2 = type.constructors.first().call()
//Timber.d("inst2 is :$inst2")
return
inst
}
private
inline
fun
<
reified
T
:
FileModule
.
FileDirectory
>
getFile
():
File
{
private
inline
fun
<
reified
T
:
FileModule
.
FileDirectory
>
getFile
():
File
{
val
d
=
getDirectory
<
T
>()
?:
error
(
"Unresolved class type"
)
Timber
.
d
(
"type: ${T::class}"
)
val
d
=
getDirectory
<
T
>()
Timber
.
d
(
"d: ${d}"
)
if
(
d
==
null
)
error
(
"Unresolved class type"
)
return
FileModule
.
getDirectory
(
context
,
d
)
return
FileModule
.
getDirectory
(
context
,
d
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/AppComponent.kt
View file @
64cd117d
...
@@ -9,10 +9,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul
...
@@ -9,10 +9,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.data.repository.file.FileModule
import
com.biganto.visual.roompark.data.repository.file.FileModule
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.domain.contract.*
import
com.biganto.visual.roompark.domain.contract.DealContract
import
com.biganto.visual.roompark.domain.contract.DevProgressContract
import
com.biganto.visual.roompark.domain.contract.FeedsContract
import
com.squareup.picasso.Picasso
import
com.squareup.picasso.Picasso
import
dagger.BindsInstance
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Component
...
@@ -56,6 +53,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
...
@@ -56,6 +53,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun
estateRep
():
DealContract
fun
estateRep
():
DealContract
fun
filesRep
():
FilesContract
fun
provideLocal
():
ILocalStore
fun
provideLocal
():
ILocalStore
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/DataModule.kt
View file @
64cd117d
package
com.biganto.visual.roompark.di.dagger
package
com.biganto.visual.roompark.di.dagger
import
com.biganto.visual.roompark.data.data_provider.AlbumsContractModule
import
com.biganto.visual.roompark.data.data_provider.*
import
com.biganto.visual.roompark.data.data_provider.AuthContractModule
import
com.biganto.visual.roompark.data.data_provider.EstateRepository
import
com.biganto.visual.roompark.data.data_provider.FeedsContractModule
import
com.biganto.visual.roompark.data.local.LocalStorage
import
com.biganto.visual.roompark.data.local.LocalStorage
import
com.biganto.visual.roompark.data.repository.api.IRoomParkApi
import
com.biganto.visual.roompark.data.repository.api.IRoomParkApi
import
com.biganto.visual.roompark.data.repository.api.retrofit.RetrofitRepository
import
com.biganto.visual.roompark.data.repository.api.retrofit.RetrofitRepository
...
@@ -11,10 +8,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul
...
@@ -11,10 +8,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.data.repository.db.requrey.RequeryRepository
import
com.biganto.visual.roompark.data.repository.db.requrey.RequeryRepository
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.domain.contract.*
import
com.biganto.visual.roompark.domain.contract.DealContract
import
com.biganto.visual.roompark.domain.contract.DevProgressContract
import
com.biganto.visual.roompark.domain.contract.FeedsContract
import
dagger.Binds
import
dagger.Binds
import
dagger.Component
import
dagger.Component
import
dagger.Module
import
dagger.Module
...
@@ -43,6 +37,10 @@ abstract class ContractRepositoryModule {
...
@@ -43,6 +37,10 @@ abstract class ContractRepositoryModule {
@Binds
@Binds
@Singleton
@Singleton
abstract
fun
provideEstateContract
(
impl
:
EstateRepository
):
DealContract
abstract
fun
provideEstateContract
(
impl
:
EstateRepository
):
DealContract
@Binds
@Singleton
abstract
fun
provideFilesContract
(
impl
:
FilesContractModule
):
FilesContract
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/domain/interactor/settings.kt
View file @
64cd117d
package
com.biganto.visual.roompark.domain.interactor
package
com.biganto.visual.roompark.domain.interactor
import
android.
app.Activity
import
android.
content.Context
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.CachedDataModel
import
com.biganto.visual.roompark.domain.model.CachedDataModel
import
com.biganto.visual.roompark.domain.model.PushSwitchModel
import
com.biganto.visual.roompark.domain.model.PushSwitchModel
...
@@ -18,7 +18,7 @@ import javax.inject.Inject
...
@@ -18,7 +18,7 @@ import javax.inject.Inject
class
SettingsInteractor
@Inject
constructor
(
class
SettingsInteractor
@Inject
constructor
(
private
val
auth
:
AuthUseCase
,
private
val
auth
:
AuthUseCase
,
private
val
settingsUseCase
:
SettingsUseCase
,
private
val
settingsUseCase
:
SettingsUseCase
,
private
val
activity
:
Activity
private
val
activity
:
Context
){
){
private
val
plans
private
val
plans
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
View file @
64cd117d
package
com.biganto.visual.roompark.presentation.screen.settings
package
com.biganto.visual.roompark.presentation.screen.settings
import
android.
app.Activity
import
android.
content.Context
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.SettingsInteractor
import
com.biganto.visual.roompark.domain.interactor.SettingsInteractor
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
com.biganto.visual.roompark.util.monades.ExceptionString
...
@@ -17,7 +17,7 @@ import javax.inject.Inject
...
@@ -17,7 +17,7 @@ import javax.inject.Inject
class
SettingsScreenPresenter
@Inject
constructor
(
class
SettingsScreenPresenter
@Inject
constructor
(
private
val
interactor
:
SettingsInteractor
,
private
val
interactor
:
SettingsInteractor
,
private
val
activity
:
Activity
private
val
activity
:
Context
)
)
:
BigantoBasePresenter
<
SettingsScreen
,
SettingsScreenViewState
>()
{
:
BigantoBasePresenter
<
SettingsScreen
,
SettingsScreenViewState
>()
{
...
...
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