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
ec95f404
Commit
ec95f404
authored
Nov 25, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actual workaround
parent
109c5265
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
85 additions
and
74 deletions
+85
-74
UserHolder.kt
...java/com/biganto/visual/roompark/data/local/UserHolder.kt
+12
-4
RetrofitModule.kt
...oompark/data/repository/api/retrofit/di/RetrofitModule.kt
+2
-0
AppComponent.kt
...ava/com/biganto/visual/roompark/di/dagger/AppComponent.kt
+7
-7
DataModule.kt
.../java/com/biganto/visual/roompark/di/dagger/DataModule.kt
+15
-4
authUseCase.kt
...om/biganto/visual/roompark/domain/use_case/authUseCase.kt
+2
-2
ScreenController.kt
...ual/roompark/presentation/screen/auth/ScreenController.kt
+0
-4
ScreenDI.kt
...anto/visual/roompark/presentation/screen/auth/ScreenDI.kt
+18
-21
ScreenController.kt
...al/roompark/presentation/screen/feeds/ScreenController.kt
+1
-1
ScreenDI.kt
...nto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
+9
-10
ScreenDI.kt
.../visual/roompark/presentation/screen/settings/ScreenDI.kt
+9
-10
ScreenDI.kt
...to/visual/roompark/presentation/screen/splash/ScreenDI.kt
+9
-10
dependencies.gradle
dependencies.gradle
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/local/UserHolder.kt
View file @
ec95f404
package
com.biganto.visual.roompark.data.local
import
android.app.Application
import
android.content.Context
import
com.afollestad.rxkprefs.Pref
import
com.afollestad.rxkprefs.rxkPrefs
import
com.biganto.visual.androidplayer.data.repository.local.ILocalStore
import
dagger.Binds
import
dagger.Module
import
dagger.Provides
import
io.reactivex.Completable
import
io.reactivex.Observable
import
timber.log.Timber
import
javax.inject.Inject
import
javax.inject.Singleton
/**
* Created by Vladislav Bogdashkin on 14.06.2018.
*/
@Module
abstract
class
LocalStorage
(){
class
LocalStorage
(){
@Binds
abstract
fun
provideStore
(
store
:
UserHolder
):
ILocalStore
// @Binds
// @Singleton
// abstract fun provideStore(store:UserHolder):ILocalStore
@Provides
@Singleton
fun
provideStore
(
app
:
Application
):
ILocalStore
=
UserHolder
(
app
)
}
class
UserHolder
@Inject
constructor
(
val
context
:
Context
)
:
ILocalStore
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/di/RetrofitModule.kt
View file @
ec95f404
...
...
@@ -21,6 +21,7 @@ import retrofit2.converter.gson.GsonConverterFactory
import
timber.log.Timber
import
java.util.*
import
java.util.concurrent.TimeUnit
import
javax.inject.Singleton
/**
* Created by Vladislav Bogdashkin on 29.10.2019.
...
...
@@ -93,6 +94,7 @@ class RetrofitModule{
//lateinit var context: RoomParkApplication
@Provides
@Singleton
// @Named("roomParkApi")
fun
provideRetrofitRoomParkApi
(
context
:
Context
):
Retrofit
=
Retrofit
.
Builder
()
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/AppComponent.kt
View file @
ec95f404
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.data.repository.api.IRoomParkApi
import
com.biganto.visual.roompark.data.repository.api.retrofit.RetrofitRepository
import
com.biganto.visual.roompark.data.local.LocalStorage
import
com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModule
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
dagger.BindsInstance
...
...
@@ -26,19 +26,23 @@ import javax.inject.Singleton
DataModule
::
class
,
RetrofitModule
::
class
,
DbModule
::
class
,
LocalStorage
::
class
,
// LocalStorage::class,
// AppVersionModule::class,
AndroidInjectionModule
::
class
,
AndroidSupportInjectionModule
::
class
,
// MappingProvider::class,
ActivityModule
::
class
,
// ContractRepositoryModule::class,
AppActivityModule
::
class
])
interface
AppComponent
:
AndroidInjector
<
RoomParkApplication
>{
@Component
.
Factory
interface
Factory
:
AndroidInjector
.
Factory
<
RoomParkApplication
>{
// @BindsInstance
// fun context(application: Application): Factory
...
...
@@ -55,10 +59,6 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
//
// fun build(): AppComponent
@BindsInstance
fun
retroApi
(
api
:
RetrofitRepository
)
:
IRoomParkApi
}
// retorfitModule: RetrofitModule
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/DataModule.kt
View file @
ec95f404
package
com.biganto.visual.roompark.di.dagger
import
com.biganto.visual.androidplayer.data.repository.local.ILocalStore
import
com.biganto.visual.roompark.data.local.UserHolder
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.db.IDb
...
...
@@ -16,6 +14,14 @@ interface DataComponent{
}
//@Module(includes = [DataModule::class,RetrofitModule::class,DbModule::class])
//abstract class ContractRepositoryModule @Inject constructor(
// val authC:AuthContract
//){
//
//}
...
...
@@ -23,6 +29,7 @@ interface DataComponent{
abstract
class
DataModule
{
// @Singleton
// @Binds
// abstract fun provideAuthContract(contract: AuthContractModule) : AuthContract
...
...
@@ -41,13 +48,17 @@ abstract class DataModule {
// @Binds
// abstract fun provideStore(store: KotlinReactiveEntityStore<Persistable>) : KotlinReactiveEntityStore<Persistable>
@Singleton
@Binds
abstract
fun
provideDb
(
db
:
RequeryRepository
)
:
IDb
@Binds
abstract
fun
provideLocalStorage
(
local
:
UserHolder
)
:
ILocalStore
// @Singleton
// @Binds
// abstract fun provideLocalStorage(local: UserHolder) : ILocalStore
/*
@Provides
...
...
app/src/main/java/com/biganto/visual/roompark/domain/use_case/authUseCase.kt
View file @
ec95f404
package
com.biganto.visual.roompark.domain.use_case
import
com.biganto.visual.roompark.d
omain.contract.AuthContract
import
com.biganto.visual.roompark.d
ata.data_provider.AuthContractModule
import
javax.inject.Inject
/**
...
...
@@ -8,7 +8,7 @@ import javax.inject.Inject
*/
class
AuthUseCase
@Inject
constructor
(
private
val
authContract
:
AuthContract
private
val
authContract
:
AuthContract
Module
){
fun
validateAuth
()
=
authContract
.
validateAuthState
()
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenController.kt
View file @
ec95f404
...
...
@@ -34,12 +34,8 @@ class AuthScreenController :
override
fun
onViewBound
(
v
:
View
)
{
toolBar
.
hideAll
()
bottomNavigation
.
hide
()
}
@BindView
(
R
.
id
.
login_text_input
)
lateinit
var
loginInput
:
TextInputLayout
@BindView
(
R
.
id
.
password_text_input
)
lateinit
var
pwdInput
:
TextInputLayout
@BindView
(
R
.
id
.
sign_in_button
)
lateinit
var
signInButton
:
MaterialButton
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenDI.kt
View file @
ec95f404
package
com.biganto.visual.roompark.presentation.screen.auth
import
android.content.Context
import
com.biganto.visual.androidplayer.data.repository.local.ILocalStore
import
com.biganto.visual.roompark.base.IBottomNavigation
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.data_provider.AuthContractModule
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.AppModule
import
com.biganto.visual.roompark.di.dagger.DataModule
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
dagger.*
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
@PerScreen
@
Subc
omponent
(
@
C
omponent
(
modules
=
[
AuthScreenModule
::
class
,
DataModule
::
class
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
])
]
,
dependencies
=
[
AppComponent
::
class
]
)
interface
AuthScreenComponent
{
val
_local
:
ILocalStore
@Component
.
Factory
interface
Factory
{
fun
create
(
...
...
@@ -33,23 +29,24 @@ interface AuthScreenComponent {
):
AuthScreenComponent
}
val
presenter
:
AuthScreenPresenter
//
val presenter: AuthScreenPresenter
fun
inject
(
controller
:
AuthScreenController
)
}
@Module
@Module
(
// includes = [DataModule::class,DbModule::class,RetrofitModule::class]
)
abstract
class
AuthScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
@PerScreen
@Binds
abstract
fun
provideAuth
(
contract
:
AuthContractModule
):
AuthContract
// @PerScreen
// @Binds
// abstract fun provideAuth(contract: AuthContractModule): AuthContract
@PerScreen
@Binds
abstract
fun
provideBottomNavigation
(
activitiy
:
RoomParkMainActivity
):
IBottomNavigation
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenController.kt
View file @
ec95f404
...
...
@@ -68,7 +68,7 @@ class FeedsScreenController :
lateinit
var
feedsBlockView
:
ViewGroup
@BindView
(
R
.
id
.
to_feed_articles
)
lateinit
var
allFeedArticles
:
MaterialButton
lateinit
var
allFeedArticles
:
MaterialButton
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
View file @
ec95f404
...
...
@@ -2,7 +2,6 @@ package com.biganto.visual.roompark.presentation.screen.feeds
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.data_provider.FeedsContractModule
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
...
...
@@ -11,24 +10,24 @@ 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.domain.contract.FeedsContract
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
dagger.Subcomponent
@PerScreen
@
C
omponent
(
@
Subc
omponent
(
modules
=
[
FeedsScreenModule
::
class
,
DataModule
::
class
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
,
DbModule
::
class
]
// ,dependencies = [AppComponent::class]
)
interface
FeedsScreenComponent
{
@
C
omponent
.
Factory
@
Subc
omponent
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
...
...
@@ -48,9 +47,9 @@ abstract class FeedsScreenModule{
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
@PerScreen
@Binds
abstract
fun
provideContract
(
impl
:
FeedsContractModule
):
FeedsContract
//
@PerScreen
//
@Binds
//
abstract fun provideContract(impl: FeedsContractModule): FeedsContract
@PerScreen
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenDI.kt
View file @
ec95f404
...
...
@@ -2,28 +2,27 @@ package com.biganto.visual.roompark.presentation.screen.settings
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.data_provider.AuthContractModule
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.AppModule
import
com.biganto.visual.roompark.di.dagger.DataModule
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
dagger.Subcomponent
@PerScreen
@
C
omponent
(
@
Subc
omponent
(
modules
=
[
SettingsScreenModule
::
class
,
DataModule
::
class
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
]
// ,dependencies = [AppComponent::class]
)
interface
SettingsScreenComponent
{
@
C
omponent
.
Factory
@
Subc
omponent
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
...
...
@@ -43,8 +42,8 @@ abstract class SettingsScreenModule{
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
@PerScreen
@Binds
abstract
fun
provideAuth
(
contract
:
AuthContractModule
):
AuthContract
//
@PerScreen
//
@Binds
//
abstract fun provideAuth(contract: AuthContractModule): AuthContract
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/splash/ScreenDI.kt
View file @
ec95f404
...
...
@@ -3,31 +3,30 @@ package com.biganto.visual.roompark.presentation.screen.splash
import
android.content.Context
import
com.biganto.visual.roompark.base.IBottomNavigation
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.data_provider.AuthContractModule
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.AppModule
import
com.biganto.visual.roompark.di.dagger.DataModule
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.presentation.screen.auth.AuthScreenModule
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
dagger.Subcomponent
///**
// * Created by Vladislav Bogdashkin on 30.09.2019.
// */
@PerScreen
@Component
(
modules
=
[
AuthScreenModule
::
class
,
DataModule
::
class
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
@Subcomponent
(
modules
=
[
AuthScreenModule
::
class
,
DataModule
::
class
,
RetrofitModule
::
class
,
AppModule
::
class
,
DbModule
::
class
]
// ,dependencies = [AppComponent::class]
)
interface
SplashScreenComponent
{
@
C
omponent
.
Factory
@
Subc
omponent
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
...
...
@@ -47,9 +46,9 @@ abstract class SplashScreenModule{
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
@PerScreen
@Binds
abstract
fun
provideAuth
(
contract
:
AuthContractModule
):
AuthContract
//
@PerScreen
//
@Binds
//
abstract fun provideAuth(contract: AuthContractModule): AuthContract
// @PerScreen
// @Binds
...
...
dependencies.gradle
View file @
ec95f404
...
...
@@ -21,6 +21,6 @@ ext {
rxJavaVersion
=
'3.0.0-RC3'
mosbyMviConductorVersion
=
'3.1.0'
butterKnifeVersion
=
'10.2.0'
daggerVersion
=
'2.2
4
'
daggerVersion
=
'2.2
5.2
'
rxRelayVersion
=
'2.1.1'
}
\ No newline at end of file
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