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
726ddcfd
Commit
726ddcfd
authored
Nov 26, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve singleton component dependencies
parent
438b5ce5
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
77 additions
and
61 deletions
+77
-61
AlbumsRepository.kt
...to/visual/roompark/data/data_provider/AlbumsRepository.kt
+2
-2
FeedsRepository.kt
...nto/visual/roompark/data/data_provider/FeedsRepository.kt
+2
-2
UserHolder.kt
...java/com/biganto/visual/roompark/data/local/UserHolder.kt
+1
-2
RetrofitRepository.kt
...ompark/data/repository/api/retrofit/RetrofitRepository.kt
+5
-1
RetrofitModule.kt
...oompark/data/repository/api/retrofit/di/RetrofitModule.kt
+6
-2
RequeryRepository.kt
.../roompark/data/repository/db/requrey/RequeryRepository.kt
+2
-2
AppComponent.kt
...ava/com/biganto/visual/roompark/di/dagger/AppComponent.kt
+19
-1
DataModule.kt
.../java/com/biganto/visual/roompark/di/dagger/DataModule.kt
+19
-6
albumsUseCase.kt
.../biganto/visual/roompark/domain/use_case/albumsUseCase.kt
+2
-2
ScreenController.kt
...ual/roompark/presentation/screen/auth/ScreenController.kt
+0
-1
ScreenController.kt
...al/roompark/presentation/screen/feeds/ScreenController.kt
+3
-0
ScreenDI.kt
...nto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
+5
-15
ScreenPresenter.kt
...ual/roompark/presentation/screen/feeds/ScreenPresenter.kt
+1
-1
ScreenDI.kt
.../visual/roompark/presentation/screen/settings/ScreenDI.kt
+5
-12
ScreenDI.kt
...to/visual/roompark/presentation/screen/splash/ScreenDI.kt
+5
-12
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/AlbumsRepository.kt
View file @
726ddcfd
...
@@ -62,7 +62,7 @@ class AlbumsContractModule @Inject constructor(
...
@@ -62,7 +62,7 @@ class AlbumsContractModule @Inject constructor(
private
fun
fetchTopLevelAlbums
():
Observable
<
List
<
AlbumPreviewModel
>>
=
private
fun
fetchTopLevelAlbums
():
Observable
<
List
<
AlbumPreviewModel
>>
=
Observable
.
mergeDelayError
(
Observable
.
mergeDelayError
(
arrayListOf
(
fetchTopLevelAlbumsApi
,
fetchTopLevelAlbumsDb
)
arrayListOf
(
fetchTopLevelAlbumsApi
,
fetchTopLevelAlbumsDb
)
).
take
(
1
).
map
{
fromEntity
(
it
,
::
fromEntity
)
}
).
map
{
fromEntity
(
it
,
::
fromEntity
)
}
private
fun
fetchAlbumsApi
(
parentAlbumId
:
Int
)
=
private
fun
fetchAlbumsApi
(
parentAlbumId
:
Int
)
=
...
@@ -92,7 +92,7 @@ class AlbumsContractModule @Inject constructor(
...
@@ -92,7 +92,7 @@ class AlbumsContractModule @Inject constructor(
private
fun
fetchAlbums
(
parentId
:
Int
):
Observable
<
List
<
AlbumPreviewModel
>>
=
private
fun
fetchAlbums
(
parentId
:
Int
):
Observable
<
List
<
AlbumPreviewModel
>>
=
Observable
.
mergeDelayError
(
Observable
.
mergeDelayError
(
arrayListOf
(
fetchAlbumsApi
(
parentId
),
fetchAlbumsDb
(
parentId
))
arrayListOf
(
fetchAlbumsApi
(
parentId
),
fetchAlbumsDb
(
parentId
))
).
take
(
1
).
map
{
fromEntity
(
it
,
::
fromEntity
)
}
).
map
{
fromEntity
(
it
,
::
fromEntity
)
}
}
}
app/src/main/java/com/biganto/visual/roompark/data/data_provider/FeedsRepository.kt
View file @
726ddcfd
...
@@ -80,7 +80,7 @@ class FeedsContractModule @Inject constructor(
...
@@ -80,7 +80,7 @@ class FeedsContractModule @Inject constructor(
).
take
(
1
).
map
{
fromEntity
(
feedId
,
it
)
}
).
take
(
1
).
map
{
fromEntity
(
feedId
,
it
)
}
private
fun
fetchFeedsApi
()
=
private
val
fetchFeedsApi
=
api
.
getFeeds
()
api
.
getFeeds
()
.
doOnNext
{
Timber
.
d
(
"raw0 $it"
)
}
.
doOnNext
{
Timber
.
d
(
"raw0 $it"
)
}
.
map
{
fromRawList
(
it
,
::
fromRaw
)}
.
map
{
fromRawList
(
it
,
::
fromRaw
)}
...
@@ -95,7 +95,7 @@ class FeedsContractModule @Inject constructor(
...
@@ -95,7 +95,7 @@ class FeedsContractModule @Inject constructor(
fun
fetchAllFeeds
():
Observable
<
List
<
FeedModel
>>
=
fun
fetchAllFeeds
():
Observable
<
List
<
FeedModel
>>
=
Observable
.
mergeDelayError
(
Observable
.
mergeDelayError
(
arrayListOf
(
fetchFeedsApi
()
,
fetchFeedsDb
)
arrayListOf
(
fetchFeedsApi
,
fetchFeedsDb
)
).
map
{
fromEntity
(
it
,
::
fromEntity
)
}
).
map
{
fromEntity
(
it
,
::
fromEntity
)
}
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/data/local/UserHolder.kt
View file @
726ddcfd
package
com.biganto.visual.roompark.data.local
package
com.biganto.visual.roompark.data.local
import
android.app.Application
import
android.app.Application
import
android.content.Context
import
com.afollestad.rxkprefs.Pref
import
com.afollestad.rxkprefs.Pref
import
com.afollestad.rxkprefs.rxkPrefs
import
com.afollestad.rxkprefs.rxkPrefs
import
com.biganto.visual.androidplayer.data.repository.local.ILocalStore
import
com.biganto.visual.androidplayer.data.repository.local.ILocalStore
...
@@ -30,7 +29,7 @@ class LocalStorage(){
...
@@ -30,7 +29,7 @@ class LocalStorage(){
fun
provideStore
(
app
:
Application
):
ILocalStore
=
UserHolder
(
app
)
fun
provideStore
(
app
:
Application
):
ILocalStore
=
UserHolder
(
app
)
}
}
class
UserHolder
@Inject
constructor
(
val
context
:
Context
)
:
ILocalStore
class
UserHolder
@Inject
constructor
(
val
context
:
Application
)
:
ILocalStore
{
{
init
{
init
{
Timber
.
d
(
" inited"
)
Timber
.
d
(
" inited"
)
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/RetrofitRepository.kt
View file @
726ddcfd
...
@@ -23,6 +23,10 @@ class RetrofitRepository @Inject constructor(retrofit: Retrofit) : IRoomParkApi
...
@@ -23,6 +23,10 @@ class RetrofitRepository @Inject constructor(retrofit: Retrofit) : IRoomParkApi
private
val
api
=
retrofit
.
create
(
IRoomParkMobileApi
::
class
.
java
)
private
val
api
=
retrofit
.
create
(
IRoomParkMobileApi
::
class
.
java
)
init
{
Timber
.
d
(
"Module inited"
)
}
override
fun
authenticate
(
login
:
String
,
pwd
:
String
):
Observable
<
AuthRaw
>
=
override
fun
authenticate
(
login
:
String
,
pwd
:
String
):
Observable
<
AuthRaw
>
=
api
.
authoriz
(
email
=
login
,
pwd
=
pwd
)
api
.
authoriz
(
email
=
login
,
pwd
=
pwd
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
...
@@ -118,7 +122,7 @@ enum class PlanTypeCatalog(val planId:Int, val planName:String ){
...
@@ -118,7 +122,7 @@ enum class PlanTypeCatalog(val planId:Int, val planName:String ){
internal
class
RetrofitResponseValidation
<
T
>
:
ObservableTransformer
<
Response
<
T
>,
T
>
{
internal
class
RetrofitResponseValidation
<
T
>
:
ObservableTransformer
<
Response
<
T
>,
T
>
{
override
fun
apply
(
responseObservable
:
Observable
<
Response
<
T
>>):
ObservableSource
<
T
>
{
override
fun
apply
(
responseObservable
:
Observable
<
Response
<
T
>>):
ObservableSource
<
T
>
{
return
responseObservable
.
switchMap
{
resp
->
return
responseObservable
.
switchMap
{
resp
->
//
Timber.d("reutrned code: %s",resp.code())
Timber
.
d
(
"reutrned code: %s"
,
resp
.
code
())
if
(
resp
.
code
()
==
200
||
resp
.
code
()
==
206
)
if
(
resp
.
code
()
==
200
||
resp
.
code
()
==
206
)
if
(
resp
.
body
()
==
null
)
if
(
resp
.
body
()
==
null
)
return
@switchMap
Completable
.
complete
().
toObservable
<
T
>().
doOnNext
{
Timber
.
d
(
"Completed responseBody"
)}
return
@switchMap
Completable
.
complete
().
toObservable
<
T
>().
doOnNext
{
Timber
.
d
(
"Completed responseBody"
)}
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/di/RetrofitModule.kt
View file @
726ddcfd
package
com.biganto.visual.roompark.data.repository.api.retrofit.di
package
com.biganto.visual.roompark.data.repository.api.retrofit.di
import
android.
content.Context
import
android.
app.Application
import
com.biganto.visual.roompark.data.repository.api.retrofit.IRoomParkMobileApi
import
com.biganto.visual.roompark.data.repository.api.retrofit.IRoomParkMobileApi
import
com.biganto.visual.roompark.data.repository.api.retrofit.raw.ErrorRaw
import
com.biganto.visual.roompark.data.repository.api.retrofit.raw.ErrorRaw
import
com.biganto.visual.roompark.data.repository.api.retrofit.util.*
import
com.biganto.visual.roompark.data.repository.api.retrofit.util.*
...
@@ -40,6 +40,10 @@ class RetrofitModule{
...
@@ -40,6 +40,10 @@ class RetrofitModule{
//
//
// var versionControl = AppVersionManager(context)
// var versionControl = AppVersionManager(context)
init
{
Timber
.
d
(
"Module inited"
)
}
private
inline
fun
<
reified
T
>
genericType
()
=
object
:
TypeToken
<
T
>()
{}.
type
private
inline
fun
<
reified
T
>
genericType
()
=
object
:
TypeToken
<
T
>()
{}.
type
private
fun
gsonConverterFactory
()
=
GsonConverterFactory
.
create
(
private
fun
gsonConverterFactory
()
=
GsonConverterFactory
.
create
(
...
@@ -96,7 +100,7 @@ class RetrofitModule{
...
@@ -96,7 +100,7 @@ class RetrofitModule{
@Provides
@Provides
@Singleton
@Singleton
// @Named("roomParkApi")
// @Named("roomParkApi")
fun
provideRetrofitRoomParkApi
(
context
:
Context
):
Retrofit
=
fun
provideRetrofitRoomParkApi
(
context
:
Application
):
Retrofit
=
Retrofit
.
Builder
()
Retrofit
.
Builder
()
.
baseUrl
(
IRoomParkMobileApi
.
BASE_URL
)
.
baseUrl
(
IRoomParkMobileApi
.
BASE_URL
)
.
client
(
client
(
AppVersionManager
(
context
),
LiveNetworkMonitor
(
context
)))
.
client
(
client
(
AppVersionManager
(
context
),
LiveNetworkMonitor
(
context
)))
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/RequeryRepository.kt
View file @
726ddcfd
package
com.biganto.visual.roompark.data.repository.db.requrey
package
com.biganto.visual.roompark.data.repository.db.requrey
import
android.
content.Context
import
android.
app.Application
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.model.*
import
com.biganto.visual.roompark.data.repository.db.requrey.model.*
import
com.biganto.visual.roompark.di.dagger.DATABASE_VERSION
import
com.biganto.visual.roompark.di.dagger.DATABASE_VERSION
...
@@ -26,7 +26,7 @@ import javax.inject.Inject
...
@@ -26,7 +26,7 @@ import javax.inject.Inject
class
DbModule
{
class
DbModule
{
@Provides
@Provides
fun
provideStore
(
context
:
Context
):
KotlinReactiveEntityStore
<
Persistable
>
{
fun
provideStore
(
context
:
Application
):
KotlinReactiveEntityStore
<
Persistable
>
{
Timber
.
d
(
"Kotlin store creating.."
)
Timber
.
d
(
"Kotlin store creating.."
)
val
source
=
DatabaseSource
(
context
,
Models
.
DEFAULT
,
"BigantoPerfect"
,
DATABASE_VERSION
)
val
source
=
DatabaseSource
(
context
,
Models
.
DEFAULT
,
"BigantoPerfect"
,
DATABASE_VERSION
)
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/AppComponent.kt
View file @
726ddcfd
package
com.biganto.visual.roompark.di.dagger
package
com.biganto.visual.roompark.di.dagger
import
com.biganto.visual.androidplayer.data.repository.local.ILocalStore
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkApplication
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.retrofit.di.RetrofitModule
import
com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModule
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.domain.contract.AuthContract
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.domain.contract.DevProgressContract
import
com.biganto.visual.roompark.domain.contract.FeedsContract
import
dagger.BindsInstance
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Component
import
dagger.android.AndroidInjectionModule
import
dagger.android.AndroidInjectionModule
...
@@ -33,13 +38,26 @@ import javax.inject.Singleton
...
@@ -33,13 +38,26 @@ import javax.inject.Singleton
AndroidSupportInjectionModule
::
class
,
AndroidSupportInjectionModule
::
class
,
// MappingProvider::class,
// MappingProvider::class,
ActivityModule
::
class
,
ActivityModule
::
class
,
//
ContractRepositoryModule::class,
ContractRepositoryModule
::
class
,
AppActivityModule
::
class
])
AppActivityModule
::
class
])
interface
AppComponent
:
AndroidInjector
<
RoomParkApplication
>{
interface
AppComponent
:
AndroidInjector
<
RoomParkApplication
>{
fun
authC
():
AuthContract
fun
authC
():
AuthContract
fun
feedsC
():
FeedsContract
fun
feedsAlb
():
DevProgressContract
fun
provideLocal
():
ILocalStore
fun
provideApi
():
IRoomParkApi
fun
providedb
():
IDb
@Component
.
Factory
@Component
.
Factory
interface
Factory
{
interface
Factory
{
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/DataModule.kt
View file @
726ddcfd
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.AuthContractModule
import
com.biganto.visual.roompark.data.data_provider.FeedsContractModule
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
import
com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModule
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.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.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
...
@@ -14,14 +23,18 @@ interface DataComponent{
...
@@ -14,14 +23,18 @@ interface DataComponent{
}
}
//@Module(includes = [DataModule::class,RetrofitModule::class,DbModul
e::class])
@Module
(
includes
=
[
DataModule
::
class
,
RetrofitModule
::
class
,
DbModule
::
class
,
LocalStorag
e
::
class
])
//abstract class ContractRepositoryModule @Inject constructor(
abstract
class
ContractRepositoryModule
{
// val authC:AuthContract
//){
@Binds
//
abstract
fun
provideAuth
(
contract
:
AuthContractModule
):
AuthContract
@Binds
abstract
fun
provideFeedsContract
(
impl
:
FeedsContractModule
):
FeedsContract
//}
@Binds
abstract
fun
provideDevProgressContract
(
impl
:
AlbumsContractModule
):
DevProgressContract
}
...
...
app/src/main/java/com/biganto/visual/roompark/domain/use_case/albumsUseCase.kt
View file @
726ddcfd
package
com.biganto.visual.roompark.domain.use_case
package
com.biganto.visual.roompark.domain.use_case
import
com.biganto.visual.roompark.d
ata.data_provider.AlbumsContractModule
import
com.biganto.visual.roompark.d
omain.contract.DevProgressContract
import
javax.inject.Inject
import
javax.inject.Inject
/**
/**
...
@@ -8,7 +8,7 @@ import javax.inject.Inject
...
@@ -8,7 +8,7 @@ import javax.inject.Inject
*/
*/
class
AlbumsUseCase
@Inject
constructor
(
class
AlbumsUseCase
@Inject
constructor
(
private
val
contract
:
AlbumsContractModule
private
val
contract
:
DevProgressContract
){
){
fun
getProgressAlbums
()
=
contract
.
getProgressCards
()
fun
getProgressAlbums
()
=
contract
.
getProgressCards
()
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenController.kt
View file @
726ddcfd
...
@@ -7,7 +7,6 @@ import com.biganto.visual.roompark.base.IBottomNavigation
...
@@ -7,7 +7,6 @@ import com.biganto.visual.roompark.base.IBottomNavigation
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.di.dagger.CoreInjectHelper
import
com.biganto.visual.roompark.presentation.screen.home.home_routing.HomeBottomNavigationController
import
com.biganto.visual.roompark.presentation.screen.home.home_routing.HomeBottomNavigationController
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.RouterTransaction
import
com.google.android.material.button.MaterialButton
import
com.google.android.material.button.MaterialButton
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenController.kt
View file @
726ddcfd
...
@@ -78,6 +78,7 @@ class FeedsScreenController :
...
@@ -78,6 +78,7 @@ class FeedsScreenController :
.
map
{
feedsRecyclerView
.
layoutManager
as
LinearLayoutManager
}
.
map
{
feedsRecyclerView
.
layoutManager
as
LinearLayoutManager
}
.
map
{
it
.
findLastCompletelyVisibleItemPosition
()
}
.
map
{
it
.
findLastCompletelyVisibleItemPosition
()
}
.
doOnNext
{
Timber
.
d
(
"Visible items $it of ${(feedsRecyclerView.adapter?.itemCount?:0) - 3}"
)
}
.
doOnNext
{
Timber
.
d
(
"Visible items $it of ${(feedsRecyclerView.adapter?.itemCount?:0) - 3}"
)
}
.
filter
{
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
>
0
}
.
filter
{
it
>(
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
)-
2
}
.
filter
{
it
>(
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
)-
2
}
.
map
{
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
}
.
map
{
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
}
.
map
{
Pair
(
storedFeedsList
[
feedsTabs
.
selectedTabPosition
],
it
)}
.
map
{
Pair
(
storedFeedsList
[
feedsTabs
.
selectedTabPosition
],
it
)}
...
@@ -213,8 +214,10 @@ class FeedsScreenController :
...
@@ -213,8 +214,10 @@ class FeedsScreenController :
feedsTabs
.
addTab
(
tab
)
feedsTabs
.
addTab
(
tab
)
}
}
storedFeedsList
=
viewState
.
restore
.
feeds
storedFeedsList
=
viewState
.
restore
.
feeds
}
}
private
fun
getComponent
()
=
DaggerFeedsScreenComponent
.
factory
()
private
fun
getComponent
()
=
DaggerFeedsScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
.
inject
(
this
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
View file @
726ddcfd
...
@@ -2,32 +2,24 @@ package com.biganto.visual.roompark.presentation.screen.feeds
...
@@ -2,32 +2,24 @@ package com.biganto.visual.roompark.presentation.screen.feeds
import
android.content.Context
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModule
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.data.service.user_session.IUserSession
import
com.biganto.visual.roompark.data.service.user_session.IUserSession
import
com.biganto.visual.roompark.data.service.user_session.UserSessionService
import
com.biganto.visual.roompark.data.service.user_session.UserSessionService
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppModule
import
com.biganto.visual.roompark.di.dagger.DataModule
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
dagger.Binds
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
dagger.Module
import
dagger.Subcomponent
@PerScreen
@PerScreen
@Subcomponent
(
@Component
(
modules
=
[
FeedsScreenModule
::
class
modules
=
[
FeedsScreenModule
::
class
]
,
DataModule
::
class
,
dependencies
=
[
AppComponent
::
class
]
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
]
// ,dependencies = [AppComponent::class]
)
)
interface
FeedsScreenComponent
{
interface
FeedsScreenComponent
{
@
Subc
omponent
.
Factory
@
C
omponent
.
Factory
interface
Factory
{
interface
Factory
{
fun
create
(
fun
create
(
appComponent
:
AppComponent
appComponent
:
AppComponent
...
@@ -35,8 +27,6 @@ interface FeedsScreenComponent {
...
@@ -35,8 +27,6 @@ interface FeedsScreenComponent {
):
FeedsScreenComponent
):
FeedsScreenComponent
}
}
val
presenter
:
FeedsScreenPresenter
fun
inject
(
controller
:
FeedsScreenController
)
fun
inject
(
controller
:
FeedsScreenController
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenPresenter.kt
View file @
726ddcfd
...
@@ -82,7 +82,7 @@ class FeedsScreenPresenter @Inject constructor(
...
@@ -82,7 +82,7 @@ class FeedsScreenPresenter @Inject constructor(
.
onErrorReturn
(
::
parseError
)
.
onErrorReturn
(
::
parseError
)
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
//
.mergeWith(fetchFeeds)
.
mergeWith
(
fetchFeeds
)
.
mergeWith
(
getFeedArticlesPreview
)
.
mergeWith
(
getFeedArticlesPreview
)
.
mergeWith
(
fetchAlbums
)
.
mergeWith
(
fetchAlbums
)
.
mergeWith
(
fetchCams
)
.
mergeWith
(
fetchCams
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenDI.kt
View file @
726ddcfd
...
@@ -2,27 +2,22 @@ package com.biganto.visual.roompark.presentation.screen.settings
...
@@ -2,27 +2,22 @@ package com.biganto.visual.roompark.presentation.screen.settings
import
android.content.Context
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModule
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppModule
import
com.biganto.visual.roompark.di.dagger.DataModule
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
dagger.Binds
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
dagger.Module
import
dagger.Subcomponent
@PerScreen
@PerScreen
@Subcomponent
(
@Component
(
modules
=
[
SettingsScreenModule
::
class
,
DataModule
::
class
modules
=
[
SettingsScreenModule
::
class
]
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
]
,
dependencies
=
[
AppComponent
::
class
]
// ,dependencies = [AppComponent::class]
)
)
interface
SettingsScreenComponent
{
interface
SettingsScreenComponent
{
@
Subc
omponent
.
Factory
@
C
omponent
.
Factory
interface
Factory
{
interface
Factory
{
fun
create
(
fun
create
(
appComponent
:
AppComponent
appComponent
:
AppComponent
...
@@ -30,8 +25,6 @@ interface SettingsScreenComponent {
...
@@ -30,8 +25,6 @@ interface SettingsScreenComponent {
):
SettingsScreenComponent
):
SettingsScreenComponent
}
}
val
presenter
:
SettingsScreenPresenter
fun
inject
(
controller
:
SettingsScreenController
)
fun
inject
(
controller
:
SettingsScreenController
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/splash/ScreenDI.kt
View file @
726ddcfd
...
@@ -3,30 +3,25 @@ package com.biganto.visual.roompark.presentation.screen.splash
...
@@ -3,30 +3,25 @@ package com.biganto.visual.roompark.presentation.screen.splash
import
android.content.Context
import
android.content.Context
import
com.biganto.visual.roompark.base.IBottomNavigation
import
com.biganto.visual.roompark.base.IBottomNavigation
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModule
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppModule
import
com.biganto.visual.roompark.di.dagger.DataModule
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.presentation.screen.auth.AuthScreenModule
import
dagger.Binds
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
dagger.Module
import
dagger.Subcomponent
///**
///**
// * Created by Vladislav Bogdashkin on 30.09.2019.
// * Created by Vladislav Bogdashkin on 30.09.2019.
// */
// */
@PerScreen
@PerScreen
@
Subc
omponent
(
@
C
omponent
(
modules
=
[
AuthScreenModule
::
class
,
DataModule
::
class
,
RetrofitModule
::
class
,
AppModule
::
class
,
Db
Module
::
class
]
modules
=
[
SplashScreen
Module
::
class
]
//
,dependencies = [AppComponent::class]
,
dependencies
=
[
AppComponent
::
class
]
)
)
interface
SplashScreenComponent
{
interface
SplashScreenComponent
{
@
Subc
omponent
.
Factory
@
C
omponent
.
Factory
interface
Factory
{
interface
Factory
{
fun
create
(
fun
create
(
appComponent
:
AppComponent
appComponent
:
AppComponent
...
@@ -34,8 +29,6 @@ interface SplashScreenComponent {
...
@@ -34,8 +29,6 @@ interface SplashScreenComponent {
):
SplashScreenComponent
):
SplashScreenComponent
}
}
val
presenter
:
SplashScreenPresenter
fun
inject
(
controller
:
SplashScreenController
)
fun
inject
(
controller
:
SplashScreenController
)
}
}
...
...
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