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
d9511b06
Commit
d9511b06
authored
Oct 14, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default patterns for the screens
parent
c3519432
Changes
36
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
820 additions
and
37 deletions
+820
-37
BigantoBaseController.kt
...iganto/visual/roompark/conductor/BigantoBaseController.kt
+3
-0
deals.kt
...va/com/biganto/visual/roompark/domain/interactor/deals.kt
+11
-0
favorites.kt
...om/biganto/visual/roompark/domain/interactor/favorites.kt
+11
-0
feeds.kt
...va/com/biganto/visual/roompark/domain/interactor/feeds.kt
+12
-0
find_flat.kt
...om/biganto/visual/roompark/domain/interactor/find_flat.kt
+11
-0
settings.kt
...com/biganto/visual/roompark/domain/interactor/settings.kt
+11
-0
ScreenController.kt
...ual/roompark/presentation/screen/auth/ScreenController.kt
+4
-8
ScreenPresenter.kt
...sual/roompark/presentation/screen/auth/ScreenPresenter.kt
+1
-2
ScreenContract.kt
...sual/roompark/presentation/screen/deals/ScreenContract.kt
+11
-0
ScreenController.kt
...al/roompark/presentation/screen/deals/ScreenController.kt
+52
-0
ScreenDI.kt
...nto/visual/roompark/presentation/screen/deals/ScreenDI.kt
+39
-0
ScreenPresenter.kt
...ual/roompark/presentation/screen/deals/ScreenPresenter.kt
+31
-0
ScreenViewState.kt
...ual/roompark/presentation/screen/deals/ScreenViewState.kt
+12
-0
ScreenContract.kt
.../roompark/presentation/screen/favorites/ScreenContract.kt
+11
-0
ScreenController.kt
...oompark/presentation/screen/favorites/ScreenController.kt
+52
-0
ScreenDI.kt
...visual/roompark/presentation/screen/favorites/ScreenDI.kt
+39
-0
ScreenPresenter.kt
...roompark/presentation/screen/favorites/ScreenPresenter.kt
+31
-0
ScreenViewState.kt
...roompark/presentation/screen/favorites/ScreenViewState.kt
+12
-0
ScreenContract.kt
...sual/roompark/presentation/screen/feeds/ScreenContract.kt
+11
-0
ScreenController.kt
...al/roompark/presentation/screen/feeds/ScreenController.kt
+52
-0
ScreenDI.kt
...nto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
+39
-0
ScreenPresenter.kt
...ual/roompark/presentation/screen/feeds/ScreenPresenter.kt
+31
-0
ScreenViewState.kt
...ual/roompark/presentation/screen/feeds/ScreenViewState.kt
+12
-0
HomeController.kt
...isual/roompark/presentation/screen/home/HomeController.kt
+18
-17
ScreenContract.kt
...l/roompark/presentation/screen/settings/ScreenContract.kt
+11
-0
ScreenController.kt
...roompark/presentation/screen/settings/ScreenController.kt
+52
-0
ScreenDI.kt
.../visual/roompark/presentation/screen/settings/ScreenDI.kt
+39
-0
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+31
-0
ScreenViewState.kt
.../roompark/presentation/screen/settings/ScreenViewState.kt
+12
-0
ScreenController.kt
...l/roompark/presentation/screen/splash/ScreenController.kt
+5
-9
ScreenContract.kt
...al/roompark/presentation/screen/to_flat/ScreenContract.kt
+11
-0
ScreenController.kt
.../roompark/presentation/screen/to_flat/ScreenController.kt
+52
-0
ScreenDI.kt
...o/visual/roompark/presentation/screen/to_flat/ScreenDI.kt
+39
-0
ScreenPresenter.kt
...l/roompark/presentation/screen/to_flat/ScreenPresenter.kt
+31
-0
ScreenViewState.kt
...l/roompark/presentation/screen/to_flat/ScreenViewState.kt
+12
-0
feeds_screen.xml
app/src/main/res/layout/feeds_screen.xml
+8
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/BigantoBaseController.kt
View file @
d9511b06
...
@@ -58,6 +58,8 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
...
@@ -58,6 +58,8 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
inject
inject
}
}
abstract
fun
onViewBound
(
v
:
View
)
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
// instantiate the view
// instantiate the view
...
@@ -68,6 +70,7 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
...
@@ -68,6 +70,7 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
toolBar
=
it
toolBar
=
it
snackbar
.
bindRootView
(
toolBar
.
coordinatorLayout
)
snackbar
.
bindRootView
(
toolBar
.
coordinatorLayout
)
}
}
onViewBound
(
view
)
return
view
return
view
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/domain/interactor/deals.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.domain.interactor
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 09.10.2019.
*/
class
DealsInteractor
@Inject
constructor
(
){
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/interactor/favorites.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.domain.interactor
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 09.10.2019.
*/
class
FavoritesInteractor
@Inject
constructor
(
){
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/interactor/feeds.kt
0 → 100644
View file @
d9511b06
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
FeedsInteractor
@Inject
constructor
(
){
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/interactor/find_flat.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.domain.interactor
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 09.10.2019.
*/
class
FindFlatInteractor
@Inject
constructor
(
){
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/interactor/settings.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.domain.interactor
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 09.10.2019.
*/
class
SettingsInteractor
@Inject
constructor
(
){
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenController.kt
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.auth
package
com.biganto.visual.roompark.presentation.screen.auth
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
butterknife.BindView
import
butterknife.BindView
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkApplication
...
@@ -27,6 +25,8 @@ class AuthScreenController :
...
@@ -27,6 +25,8 @@ class AuthScreenController :
,
AuthScreen
,
AuthScreen
,
AuthScreenPresenter
>()
,
AuthScreenPresenter
>()
,
AuthScreen
{
,
AuthScreen
{
override
fun
onViewBound
(
v
:
View
)
{
}
@BindView
(
R
.
id
.
login_text_input
)
lateinit
var
loginInput
:
TextInputLayout
@BindView
(
R
.
id
.
login_text_input
)
lateinit
var
loginInput
:
TextInputLayout
@BindView
(
R
.
id
.
password_text_input
)
lateinit
var
pwdInput
:
TextInputLayout
@BindView
(
R
.
id
.
password_text_input
)
lateinit
var
pwdInput
:
TextInputLayout
...
@@ -39,7 +39,8 @@ class AuthScreenController :
...
@@ -39,7 +39,8 @@ class AuthScreenController :
override
fun
tryAuth
():
Observable
<
AuthInputModel
>
=
override
fun
tryAuth
():
Observable
<
AuthInputModel
>
=
signInButton
.
clicks
()
signInButton
.
clicks
()
.
map
<
AuthInputModel
>{
AuthInputModel
(
loginInput
.
editText
?.
text
?.
toString
()
?:
""
.
map
<
AuthInputModel
>{
AuthInputModel
(
loginInput
.
editText
?.
text
?.
toString
()
?:
""
,
pwdInput
.
editText
?.
text
?.
toString
()
?:
""
)}
,
pwdInput
.
editText
?.
text
?.
toString
()
?:
""
)
}
override
fun
injectDependencies
()
{
override
fun
injectDependencies
()
{
getComponent
()
getComponent
()
...
@@ -63,11 +64,6 @@ class AuthScreenController :
...
@@ -63,11 +64,6 @@ class AuthScreenController :
// @Inject
// @Inject
// lateinit var ac: RoomParkMainActivity
// lateinit var ac: RoomParkMainActivity
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
v
=
super
.
onCreateView
(
inflater
,
container
)
return
v
}
override
fun
render
(
viewState
:
AuthScreenViewState
)
{
override
fun
render
(
viewState
:
AuthScreenViewState
)
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenPresenter.kt
View file @
d9511b06
...
@@ -17,7 +17,6 @@ class AuthScreenPresenter @Inject constructor(
...
@@ -17,7 +17,6 @@ class AuthScreenPresenter @Inject constructor(
)
)
:
BigantoBasePresenter
<
AuthScreen
,
AuthScreenViewState
>()
{
:
BigantoBasePresenter
<
AuthScreen
,
AuthScreenViewState
>()
{
override
fun
bindIntents
()
{
override
fun
bindIntents
()
{
val
onAuth
=
intent
(
AuthScreen
::
tryAuth
)
val
onAuth
=
intent
(
AuthScreen
::
tryAuth
)
...
@@ -35,7 +34,7 @@ class AuthScreenPresenter @Inject constructor(
...
@@ -35,7 +34,7 @@ class AuthScreenPresenter @Inject constructor(
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
onAuth
)
.
mergeWith
(
onAuth
)
.
doOnError
{
Timber
.
e
(
it
)}
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
single
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
AuthScreenViewState
::
class
.
java
),
AuthScreen
::
render
)
subscribeViewState
(
state
.
cast
(
AuthScreenViewState
::
class
.
java
),
AuthScreen
::
render
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenContract.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.deals
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface
DealsScreen
:
BigantoBaseContract
<
DealsScreenViewState
>
{
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenController.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.deals
import
android.view.View
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
DealsScreenController
:
BigantoBaseController
<
DealsScreenViewState
,
DealsScreen
,
DealsScreenPresenter
>()
,
DealsScreen
{
override
fun
injectDependencies
()
{
getComponent
()
}
@Inject
override
lateinit
var
injectedPresenter
:
DealsScreenPresenter
override
fun
onViewBound
(
v
:
View
)
{
}
override
fun
render
(
viewState
:
DealsScreenViewState
)
{
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
when
(
viewState
){
is
DealsScreenViewState
.
Idle
->
render
(
viewState
)
}
}
private
fun
render
(
viewState
:
DealsScreenViewState
.
Idle
){
}
private
fun
getComponent
()
=
DaggerDealsScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
override
fun
getLayoutId
():
Int
=
R
.
layout
.
favorites_screen
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenDI.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.deals
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
@PerScreen
@Component
(
modules
=
[
DealsScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
DealsScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
):
DealsScreenComponent
}
val
presenter
:
DealsScreenPresenter
fun
inject
(
controller
:
DealsScreenController
)
}
@Module
abstract
class
DealsScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenPresenter.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.deals
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.DealsInteractor
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
DealsScreenPresenter
@Inject
constructor
(
private
val
interactor
:
DealsInteractor
)
:
BigantoBasePresenter
<
DealsScreen
,
DealsScreenViewState
>()
{
override
fun
bindIntents
()
{
val
state
=
restoreStateObservable
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
DealsScreenViewState
::
class
.
java
),
DealsScreen
::
render
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenViewState.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.deals
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
sealed
class
DealsScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
DealsScreenViewState
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenContract.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.favorites
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface
FavoritesScreen
:
BigantoBaseContract
<
FavoritesScreenViewState
>
{
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenController.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.favorites
import
android.view.View
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
FavoritesScreenController
:
BigantoBaseController
<
FavoritesScreenViewState
,
FavoritesScreen
,
FavoritesScreenPresenter
>()
,
FavoritesScreen
{
override
fun
injectDependencies
()
{
getComponent
()
}
@Inject
override
lateinit
var
injectedPresenter
:
FavoritesScreenPresenter
override
fun
onViewBound
(
v
:
View
)
{
}
override
fun
render
(
viewState
:
FavoritesScreenViewState
)
{
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
when
(
viewState
){
is
FavoritesScreenViewState
.
Idle
->
render
(
viewState
)
}
}
private
fun
render
(
viewState
:
FavoritesScreenViewState
.
Idle
){
}
private
fun
getComponent
()
=
DaggerFavoritesScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
override
fun
getLayoutId
():
Int
=
R
.
layout
.
favorites_screen
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenDI.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.favorites
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
@PerScreen
@Component
(
modules
=
[
FavoritesScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
FavoritesScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
):
FavoritesScreenComponent
}
val
presenter
:
FavoritesScreenPresenter
fun
inject
(
controller
:
FavoritesScreenController
)
}
@Module
abstract
class
FavoritesScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenPresenter.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.favorites
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.FavoritesInteractor
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
FavoritesScreenPresenter
@Inject
constructor
(
private
val
interactor
:
FavoritesInteractor
)
:
BigantoBasePresenter
<
FavoritesScreen
,
FavoritesScreenViewState
>()
{
override
fun
bindIntents
()
{
val
state
=
restoreStateObservable
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
FavoritesScreenViewState
::
class
.
java
),
FavoritesScreen
::
render
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenViewState.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.favorites
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
sealed
class
FavoritesScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
FavoritesScreenViewState
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenContract.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.feeds
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface
FeedsScreen
:
BigantoBaseContract
<
FeedsScreenViewState
>
{
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenController.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.feeds
import
android.view.View
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
FeedsScreenController
:
BigantoBaseController
<
FeedsScreenViewState
,
FeedsScreen
,
FeedsScreenPresenter
>()
,
FeedsScreen
{
override
fun
injectDependencies
()
{
getComponent
()
}
@Inject
override
lateinit
var
injectedPresenter
:
FeedsScreenPresenter
override
fun
onViewBound
(
v
:
View
)
{
}
override
fun
render
(
viewState
:
FeedsScreenViewState
)
{
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
when
(
viewState
){
is
FeedsScreenViewState
.
Idle
->
render
(
viewState
)
}
}
private
fun
render
(
viewState
:
FeedsScreenViewState
.
Idle
){
}
private
fun
getComponent
()
=
DaggerFeedsScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
override
fun
getLayoutId
():
Int
=
R
.
layout
.
feeds_screen
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.feeds
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
@PerScreen
@Component
(
modules
=
[
FeedsScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
FeedsScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
):
FeedsScreenComponent
}
val
presenter
:
FeedsScreenPresenter
fun
inject
(
controller
:
FeedsScreenController
)
}
@Module
abstract
class
FeedsScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenPresenter.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.feeds
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.FeedsInteractor
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
FeedsScreenPresenter
@Inject
constructor
(
private
val
interactor
:
FeedsInteractor
)
:
BigantoBasePresenter
<
FeedsScreen
,
FeedsScreenViewState
>()
{
override
fun
bindIntents
()
{
val
state
=
restoreStateObservable
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
FeedsScreenViewState
::
class
.
java
),
FeedsScreen
::
render
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenViewState.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.feeds
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
sealed
class
FeedsScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
FeedsScreenViewState
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/home/HomeController.kt
View file @
d9511b06
...
@@ -11,8 +11,11 @@ import com.biganto.visual.roompark.base.ICollapsingToolBar
...
@@ -11,8 +11,11 @@ import com.biganto.visual.roompark.base.ICollapsingToolBar
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.presentation.screen.auth.AuthScreenController
import
com.biganto.visual.roompark.presentation.screen.deals.DealsScreenController
import
com.biganto.visual.roompark.presentation.screen.splash.SplashScreenController
import
com.biganto.visual.roompark.presentation.screen.favorites.FavoritesScreenController
import
com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
import
com.biganto.visual.roompark.presentation.screen.settings.SettingsScreenController
import
com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
import
javax.inject.Inject
import
javax.inject.Inject
/**
/**
...
@@ -25,6 +28,19 @@ class HomeController :
...
@@ -25,6 +28,19 @@ class HomeController :
,
HomeScreenPresenter
>()
,
HomeScreenPresenter
>()
,
HomeScreen
{
,
HomeScreen
{
override
fun
onViewBound
(
v
:
View
)
{
tb
.
showAll
()
pageAdapter
=
BNVRouterPagerAdapter
(
this
,
bottomNavigation
.
bottomNavigation
,
viewpager
,
mapOf
(
Pair
(
R
.
id
.
tab_feeds
,{
FeedsScreenController
()})
,
Pair
(
R
.
id
.
tab_favorites
,{
FavoritesScreenController
()
})
,
Pair
(
R
.
id
.
tab_deals
,{
DealsScreenController
()
})
,
Pair
(
R
.
id
.
tab_look_flat
,{
FindFlatScreenController
()
})
,
Pair
(
R
.
id
.
tab_settings
,{
SettingsScreenController
()})
)
)
}
override
fun
injectDependencies
()
{
override
fun
injectDependencies
()
{
getComponent
()
getComponent
()
}
}
...
@@ -57,21 +73,6 @@ class HomeController :
...
@@ -57,21 +73,6 @@ class HomeController :
// @Inject
// @Inject
// lateinit var ac: RoomParkMainActivity
// lateinit var ac: RoomParkMainActivity
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
v
=
super
.
onCreateView
(
inflater
,
container
)
tb
.
showAll
()
pageAdapter
=
BNVRouterPagerAdapter
(
this
,
bottomNavigation
.
bottomNavigation
,
viewpager
,
mapOf
(
Pair
(
R
.
id
.
tab_feeds
,{
SplashScreenController
()})
,
Pair
(
R
.
id
.
tab_favorites
,{
AuthScreenController
()})
,
Pair
(
R
.
id
.
tab_deals
,{
AuthScreenController
()})
,
Pair
(
R
.
id
.
tab_look_flat
,{
AuthScreenController
()})
,
Pair
(
R
.
id
.
tab_settings
,{
SplashScreenController
()})
)
)
return
v
}
override
fun
render
(
viewState
:
HomeScreenViewState
)
{
override
fun
render
(
viewState
:
HomeScreenViewState
)
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenContract.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.settings
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface
SettingsScreen
:
BigantoBaseContract
<
SettingsScreenViewState
>
{
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenController.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.settings
import
android.view.View
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
SettingsScreenController
:
BigantoBaseController
<
SettingsScreenViewState
,
SettingsScreen
,
SettingsScreenPresenter
>()
,
SettingsScreen
{
override
fun
injectDependencies
()
{
getComponent
()
}
@Inject
override
lateinit
var
injectedPresenter
:
SettingsScreenPresenter
override
fun
onViewBound
(
v
:
View
)
{
}
override
fun
render
(
viewState
:
SettingsScreenViewState
)
{
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
when
(
viewState
){
is
SettingsScreenViewState
.
Idle
->
render
(
viewState
)
}
}
private
fun
render
(
viewState
:
SettingsScreenViewState
.
Idle
){
}
private
fun
getComponent
()
=
DaggerSettingsScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
override
fun
getLayoutId
():
Int
=
R
.
layout
.
favorites_screen
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenDI.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.settings
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
@PerScreen
@Component
(
modules
=
[
SettingsScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
SettingsScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
):
SettingsScreenComponent
}
val
presenter
:
SettingsScreenPresenter
fun
inject
(
controller
:
SettingsScreenController
)
}
@Module
abstract
class
SettingsScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.settings
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.SettingsInteractor
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
SettingsScreenPresenter
@Inject
constructor
(
private
val
interactor
:
SettingsInteractor
)
:
BigantoBasePresenter
<
SettingsScreen
,
SettingsScreenViewState
>()
{
override
fun
bindIntents
()
{
val
state
=
restoreStateObservable
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
SettingsScreenViewState
::
class
.
java
),
SettingsScreen
::
render
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenViewState.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.settings
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
sealed
class
SettingsScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
SettingsScreenViewState
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/splash/ScreenController.kt
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.splash
package
com.biganto.visual.roompark.presentation.screen.splash
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.ICollapsingToolBar
import
com.biganto.visual.roompark.base.ICollapsingToolBar
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkApplication
...
@@ -24,6 +22,10 @@ class SplashScreenController :
...
@@ -24,6 +22,10 @@ class SplashScreenController :
,
SplashScreenPresenter
>()
,
SplashScreenPresenter
>()
,
SplashScreen
{
,
SplashScreen
{
override
fun
onViewBound
(
v
:
View
)
{
}
override
fun
injectDependencies
()
{
override
fun
injectDependencies
()
{
getComponent
()
getComponent
()
}
}
...
@@ -48,12 +50,6 @@ class SplashScreenController :
...
@@ -48,12 +50,6 @@ class SplashScreenController :
// @Inject
// @Inject
// lateinit var ac: RoomParkMainActivity
// lateinit var ac: RoomParkMainActivity
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
v
=
super
.
onCreateView
(
inflater
,
container
)
return
v
}
override
fun
render
(
viewState
:
SplashScreenViewState
)
{
override
fun
render
(
viewState
:
SplashScreenViewState
)
{
when
(
viewState
){
when
(
viewState
){
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenContract.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.to_flat
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface
FindFlatScreen
:
BigantoBaseContract
<
FindFlatScreenViewState
>
{
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenController.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.to_flat
import
android.view.View
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
FindFlatScreenController
:
BigantoBaseController
<
FindFlatScreenViewState
,
FindFlatScreen
,
FindFlatScreenPresenter
>()
,
FindFlatScreen
{
override
fun
injectDependencies
()
{
getComponent
()
}
@Inject
override
lateinit
var
injectedPresenter
:
FindFlatScreenPresenter
override
fun
onViewBound
(
v
:
View
)
{
}
override
fun
render
(
viewState
:
FindFlatScreenViewState
)
{
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
when
(
viewState
){
is
FindFlatScreenViewState
.
Idle
->
render
(
viewState
)
}
}
private
fun
render
(
viewState
:
FindFlatScreenViewState
.
Idle
){
}
private
fun
getComponent
()
=
DaggerFindFlatScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
override
fun
getLayoutId
():
Int
=
R
.
layout
.
find_flat_screen
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenDI.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.to_flat
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
@PerScreen
@Component
(
modules
=
[
FindFlatScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
FindFlatScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
):
FindFlatScreenComponent
}
val
presenter
:
FindFlatScreenPresenter
fun
inject
(
controller
:
FindFlatScreenController
)
}
@Module
abstract
class
FindFlatScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenPresenter.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.to_flat
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.FindFlatInteractor
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
FindFlatScreenPresenter
@Inject
constructor
(
private
val
interactor
:
FindFlatInteractor
)
:
BigantoBasePresenter
<
FindFlatScreen
,
FindFlatScreenViewState
>()
{
override
fun
bindIntents
()
{
val
state
=
restoreStateObservable
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
FindFlatScreenViewState
::
class
.
java
),
FindFlatScreen
::
render
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenViewState.kt
0 → 100644
View file @
d9511b06
package
com.biganto.visual.roompark.presentation.screen.to_flat
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
sealed
class
FindFlatScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
FindFlatScreenViewState
()
}
\ No newline at end of file
app/src/main/res/layout/feeds_screen.xml
View file @
d9511b06
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
...
@@ -50,3 +56,4 @@
...
@@ -50,3 +56,4 @@
app:layout_constraintTop_toBottomOf=
"@+id/dev_progress_recycler_view"
/>
app:layout_constraintTop_toBottomOf=
"@+id/dev_progress_recycler_view"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
\ 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