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
230d45a8
Commit
230d45a8
authored
Oct 09, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added explanation pipeline sample
parent
7129b223
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
30 deletions
+53
-30
ContextModule.kt
...va/com/biganto/visual/roompark/di/dagger/ContextModule.kt
+20
-0
splash.kt
...a/com/biganto/visual/roompark/domain/interactor/splash.kt
+14
-0
authUseCase.kt
...om/biganto/visual/roompark/domain/use_case/authUseCase.kt
+6
-4
ScreenDI.kt
...to/visual/roompark/presentation/screen/splash/ScreenDI.kt
+9
-21
ScreenPresenter.kt
...al/roompark/presentation/screen/splash/ScreenPresenter.kt
+4
-5
No files found.
app/src/main/java/com/biganto/visual/roompark/di/dagger/ContextModule.kt
View file @
230d45a8
package
com.biganto.visual.roompark.di.dagger
package
com.biganto.visual.roompark.di.dagger
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.domain.model.AuthInfoModel
import
dagger.Module
import
dagger.Module
import
dagger.Provides
import
dagger.Provides
import
io.reactivex.rxjava3.core.Completable
import
io.reactivex.rxjava3.core.Observable
import
javax.inject.Inject
import
javax.inject.Singleton
/**
/**
* Created by Vladislav Bogdashkin on 13.06.2018.
* Created by Vladislav Bogdashkin on 13.06.2018.
...
@@ -26,11 +32,25 @@ class AppModule() {
...
@@ -26,11 +32,25 @@ class AppModule() {
}
}
class
AuthContractModule
@Inject
constructor
():
AuthContract
{
override
fun
signOut
():
Completable
=
Completable
.
complete
()
override
fun
signIn
(
email
:
String
,
password
:
String
):
Observable
<
AuthInfoModel
>
{
return
Observable
.
just
(
AuthInfoModel
(
"some tokan zzaza"
,
1488
,
"hi4"
,
"biganto@demo.ru"
))
}
fun
validateAuthState
():
Observable
<
Boolean
>
=
Observable
.
just
(
false
)
}
@Module
()
@Module
()
class
DataModule
()
{
class
DataModule
()
{
@Provides
@Singleton
fun
provideAuthContract
()
:
AuthContract
=
AuthContractModule
()
/*
/*
@Provides
@Provides
@Singleton
@Singleton
...
...
app/src/main/java/com/biganto/visual/roompark/domain/interactor/splash.kt
0 → 100644
View file @
230d45a8
package
com.biganto.visual.roompark.domain.interactor
import
com.biganto.visual.roompark.domain.use_case.AuthUseCase
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 09.10.2019.
*/
class
SplashInteractor
@Inject
constructor
(
private
val
uc
:
AuthUseCase
){
fun
getAuth
()
=
uc
.
validateAuth
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/use_case/authUseCase.kt
View file @
230d45a8
package
com.biganto.visual.roompark.domain.use_case
package
com.biganto.visual.roompark.domain.use_case
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
io.reactivex.Observable
import
javax.inject.Inject
/**
/**
* Created by Vladislav Bogdashkin on 24.09.2019.
* Created by Vladislav Bogdashkin on 24.09.2019.
*/
*/
@PerScreen
class
AuthUseCase
@Inject
constructor
(
class
AuthUseCase
(
private
val
authContract
:
AuthContract
val
authContract
:
AuthContract
){
){
fun
validateAuth
()
=
Observable
.
just
(
true
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/splash/ScreenDI.kt
View file @
230d45a8
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
import
android.content.Context
import
android.content.Context
import
com.biganto.visual.roompark.base.ICollapsingToolBar
import
com.biganto.visual.roompark.base.ICollapsingToolBar
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.ActivityModule
import
com.biganto.visual.roompark.di.dagger.AppActivityModule
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AuthContractModule
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.presentation.screen.splash.SplashScreenController
import
com.biganto.visual.roompark.presentation.screen.splash.SplashScreenController
import
com.biganto.visual.roompark.presentation.screen.splash.SplashScreenPresenter
import
com.biganto.visual.roompark.presentation.screen.splash.SplashScreenPresenter
import
dagger.Binds
import
dagger.Binds
...
@@ -36,13 +36,10 @@ import dagger.Module
...
@@ -36,13 +36,10 @@ import dagger.Module
//
//
@PerScreen
@PerScreen
@Component
(
@Component
(
modules
=
[
RoomParkActivityModule
::
class
,
ActivityModule
::
class
,
AppActivityModule
::
class
],
modules
=
[
SplashScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
dependencies
=
[
AppComponent
::
class
])
interface
SplashScreenComponent
{
interface
SplashScreenComponent
{
// fun baseComponent(@BindsInstance appComponent:AppComponent):AppComponent
@Component
.
Factory
@Component
.
Factory
interface
Factory
{
interface
Factory
{
fun
create
(
fun
create
(
...
@@ -54,19 +51,21 @@ interface SplashScreenComponent {
...
@@ -54,19 +51,21 @@ interface SplashScreenComponent {
val
presenter
:
SplashScreenPresenter
val
presenter
:
SplashScreenPresenter
fun
inject
(
controller
:
SplashScreenController
)
fun
inject
(
controller
:
SplashScreenController
)
// val roomParkActivity: RoomParkMainActivity
// val snackBar : ISnackBarProvider
}
}
@Module
@Module
abstract
class
RoomParkActivity
Module
{
abstract
class
SplashScreen
Module
{
@PerScreen
@PerScreen
@Binds
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
@PerScreen
@Binds
abstract
fun
provideAuth
(
contract
:
AuthContractModule
):
AuthContract
// @Binds
// @Binds
// abstract fun provideContext(activity: Activity): Context
// abstract fun provideContext(activity: Activity): Context
...
@@ -74,18 +73,7 @@ abstract class RoomParkActivityModule{
...
@@ -74,18 +73,7 @@ abstract class RoomParkActivityModule{
// @Binds
// @Binds
// abstract fun provideSnack(snack:ISnackBarProvider) : ISnackBarProvider
// abstract fun provideSnack(snack:ISnackBarProvider) : ISnackBarProvider
@PerScreen
@PerScreen
@Binds
@Binds
abstract
fun
provideToolbar
(
activitiy
:
RoomParkMainActivity
):
ICollapsingToolBar
abstract
fun
provideToolbar
(
activitiy
:
RoomParkMainActivity
):
ICollapsingToolBar
// @ContributesAndroidInjector(
// modules = [ActivityModule::class, AppActivityModule.MainActivityModule::class])
// abstract fun contributeMainActivityInjector(): RoomParkMainActivity
// @Binds
// abstract fun provideSnack(activitiy: RoomParkMainActivity):ISnackBarProvider
}
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/splash/ScreenPresenter.kt
View file @
230d45a8
...
@@ -2,7 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.splash
...
@@ -2,7 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.splash
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
io.reactivex.Observable
import
com.biganto.visual.roompark.domain.interactor.SplashInteractor
import
javax.inject.Inject
import
javax.inject.Inject
/**
/**
...
@@ -12,16 +12,15 @@ import javax.inject.Inject
...
@@ -12,16 +12,15 @@ import javax.inject.Inject
class
SplashScreenPresenter
@Inject
constructor
(
class
SplashScreenPresenter
@Inject
constructor
(
var
acitivityContext
:
RoomParkMainActivity
var
acitivityContext
:
RoomParkMainActivity
,
val
interactor
:
SplashInteractor
// ,var context:Context
// ,var context:Context
)
)
:
BigantoBasePresenter
<
SplashScreen
,
SplashScreenViewState
>()
{
:
BigantoBasePresenter
<
SplashScreen
,
SplashScreenViewState
>()
{
override
fun
bindIntents
()
{
override
fun
bindIntents
()
{
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
Observable
.
just
(
SplashScreenViewState
.
ToScreen
(
acitivityContext
.
javaClass
.
toString
())))
.
mergeWith
(
interactor
.
getAuth
()
.
map
{
SplashScreenViewState
.
ToScreen
(
it
.
toString
())
})
subscribeViewState
(
state
.
cast
(
SplashScreenViewState
::
class
.
java
),
SplashScreen
::
render
)
subscribeViewState
(
state
.
cast
(
SplashScreenViewState
::
class
.
java
),
SplashScreen
::
render
)
}
}
...
...
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