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
e5e2c20d
Commit
e5e2c20d
authored
Dec 27, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
screen pattern
parent
6c81fb51
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
247 additions
and
2 deletions
+247
-2
estate.kt
...a/com/biganto/visual/roompark/domain/interactor/estate.kt
+14
-0
ScreenContract.kt
...ual/roompark/presentation/screen/estate/ScreenContract.kt
+11
-0
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+85
-0
ScreenDI.kt
...to/visual/roompark/presentation/screen/estate/ScreenDI.kt
+39
-0
ScreenPresenter.kt
...al/roompark/presentation/screen/estate/ScreenPresenter.kt
+38
-0
ScreenViewState.kt
...al/roompark/presentation/screen/estate/ScreenViewState.kt
+16
-0
Estate.kt
...visual/roompark/presentation/screen/estate/util/Estate.kt
+31
-0
ScreenContract.kt
.../roompark/presentation/screen/favorites/ScreenContract.kt
+1
-0
ScreenController.kt
...oompark/presentation/screen/favorites/ScreenController.kt
+3
-0
ScreenDI.kt
...visual/roompark/presentation/screen/favorites/ScreenDI.kt
+4
-0
ScreenPresenter.kt
...roompark/presentation/screen/favorites/ScreenPresenter.kt
+2
-0
ScreenViewState.kt
...roompark/presentation/screen/favorites/ScreenViewState.kt
+1
-0
HomeController.kt
...isual/roompark/presentation/screen/home/HomeController.kt
+1
-1
HomeBottomNavigationController.kt
...creen/home/home_routing/HomeBottomNavigationController.kt
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/domain/interactor/estate.kt
0 → 100644
View file @
e5e2c20d
package
com.biganto.visual.roompark.domain.interactor
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 09.10.2019.
*/
class
EstateInteractor
@Inject
constructor
(
){
fun
getEstate
(
estateId
:
Int
)
=
null
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenContract.kt
0 → 100644
View file @
e5e2c20d
package
com.biganto.visual.roompark.presentation.screen.estate
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface
EstateScreen
:
BigantoBaseContract
<
EstateScreenViewState
>
{
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
0 → 100644
View file @
e5e2c20d
package
com.biganto.visual.roompark.presentation.screen.estate
import
android.view.View
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
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
com.biganto.visual.roompark.presentation.screen.favorites.DaggerEstateScreenComponent
import
com.biganto.visual.roompark.presentation.screen.favorites.util.EstateListAdapter
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
EstateScreenController
:
BigantoBaseController
<
EstateScreenViewState
,
EstateScreen
,
EstateScreenPresenter
>()
,
EstateScreen
{
override
fun
injectDependencies
()
{
getComponent
()
}
@Inject
override
lateinit
var
injectedPresenter
:
EstateScreenPresenter
@BindView
(
R
.
id
.
favorites_cards_recycler_view
)
lateinit
var
favoritesRecyclerView
:
RecyclerView
private
fun
setToolbar
(){
toolBar
.
showAll
()
toolBar
.
appBar
.
setExpanded
(
false
,
false
)
toolBar
.
collapsingToolbarLayout
.
title
=
"ИЗБРАННОЕ"
toolBar
.
appBar
.
liftOnScrollTargetViewId
=
R
.
id
.
favorites_cards_recycler_view
toolBar
.
appBar
.
setLiftable
(
true
)
toolBar
.
appBarScrollable
(
false
)
favoritesRecyclerView
.
isNestedScrollingEnabled
=
false
}
private
fun
bindRecycler
()
{
}
override
fun
onViewBound
(
v
:
View
)
{
setToolbar
()
bindRecycler
()
}
override
fun
render
(
viewState
:
EstateScreenViewState
)
{
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
when
(
viewState
){
is
EstateScreenViewState
.
Idle
->
render
(
viewState
)
is
EstateScreenViewState
.
FavoriteEstatesLoaded
->
render
(
viewState
)
is
EstateScreenViewState
.
SomeError
->
render
(
viewState
)
}
}
private
fun
render
(
viewState
:
EstateScreenViewState
.
Idle
){
}
private
fun
render
(
viewState
:
EstateScreenViewState
.
SomeError
)
=
showError
(
viewState
.
exception
)
private
fun
render
(
viewState
:
EstateScreenViewState
.
FavoriteEstatesLoaded
)
{
}
private
fun
getComponent
()
=
DaggerEstateScreenComponent
.
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/estate/ScreenDI.kt
0 → 100644
View file @
e5e2c20d
package
com.biganto.visual.roompark.presentation.screen.estate
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
=
[
EstateScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
EstateScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
):
EstateScreenComponent
}
val
presenter
:
EstateScreenPresenter
fun
inject
(
controller
:
EstateScreenController
)
}
@Module
abstract
class
EstateScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenPresenter.kt
0 → 100644
View file @
e5e2c20d
package
com.biganto.visual.roompark.presentation.screen.estate
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.EstateInteractor
import
com.biganto.visual.roompark.util.monades.ExceptionString
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
EstateScreenPresenter
@Inject
constructor
(
private
val
interactor
:
EstateInteractor
)
:
BigantoBasePresenter
<
EstateScreen
,
EstateScreenViewState
>()
{
override
fun
defaultErrorViewStateHandler
()
=
{
e
:
ExceptionString
->
EstateScreenViewState
.
SomeError
(
e
)
}
override
fun
bindIntents
()
{
val
prefetchCards
=
interactor
.
getEstate
(
1
)
//.map { EstateScreenViewState.FavoriteEstatesLoaded(it) }
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
EstateScreenViewState
::
class
.
java
),
EstateScreen
::
render
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenViewState.kt
0 → 100644
View file @
e5e2c20d
package
com.biganto.visual.roompark.presentation.screen.estate
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.util.monades.ExceptionString
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
sealed
class
EstateScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
EstateScreenViewState
()
class
FavoriteEstatesLoaded
(
val
items
:
List
<
EstateModel
>)
:
EstateScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
EstateScreenViewState
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/util/Estate.kt
0 → 100644
View file @
e5e2c20d
package
com.biganto.visual.roompark.presentation.screen.estate.util
import
android.view.View
import
com.biganto.visual.roompark.domain.model.PlanModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
/**
* Created by Vladislav Bogdashkin on 16.10.2019.
*/
class
PlanPresetAdapterAdapter
:
CommonRecyclerAdapter
<
PlenPresetViewHolder
,
PlanModel
>()
{
override
val
vhKlazz
=
PlenPresetViewHolder
::
class
override
fun
getVhLayout
():
Int
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
}
class
PlenPresetViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
PlanModel
>(
itemView
)
{
override
fun
onViewBound
(
model
:
PlanModel
)
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenContract.kt
View file @
e5e2c20d
package
com.biganto.visual.roompark.presentation.screen.favorites
package
com.biganto.visual.roompark.presentation.screen.favorites
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenViewState
/**
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
* Created by Vladislav Bogdashkin on 30.09.2019.
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenController.kt
View file @
e5e2c20d
...
@@ -8,6 +8,9 @@ import com.biganto.visual.roompark.R
...
@@ -8,6 +8,9 @@ import com.biganto.visual.roompark.R
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.estate.FavoritesScreen
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenPresenter
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenViewState
import
com.biganto.visual.roompark.presentation.screen.favorites.util.FavoritesListAdapter
import
com.biganto.visual.roompark.presentation.screen.favorites.util.FavoritesListAdapter
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
timber.log.Timber
import
timber.log.Timber
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenDI.kt
View file @
e5e2c20d
...
@@ -4,6 +4,10 @@ import android.content.Context
...
@@ -4,6 +4,10 @@ import android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenComponent
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenController
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenModule
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenPresenter
import
dagger.Binds
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Component
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenPresenter.kt
View file @
e5e2c20d
...
@@ -2,6 +2,8 @@ package com.biganto.visual.roompark.presentation.screen.favorites
...
@@ -2,6 +2,8 @@ package com.biganto.visual.roompark.presentation.screen.favorites
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.FavoritesInteractor
import
com.biganto.visual.roompark.domain.interactor.FavoritesInteractor
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreen
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenViewState
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenViewState.kt
View file @
e5e2c20d
...
@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.favorites
...
@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.favorites
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.presentation.screen.estate.FavoritesScreenViewState
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
com.biganto.visual.roompark.util.monades.ExceptionString
/**
/**
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/home/HomeController.kt
View file @
e5e2c20d
...
@@ -12,7 +12,7 @@ import com.biganto.visual.roompark.base.RoomParkApplication
...
@@ -12,7 +12,7 @@ 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.deals.DealsScreenController
import
com.biganto.visual.roompark.presentation.screen.deals.DealsScreenController
import
com.biganto.visual.roompark.presentation.screen.
favorites
.FavoritesScreenController
import
com.biganto.visual.roompark.presentation.screen.
estate
.FavoritesScreenController
import
com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
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.settings.SettingsScreenController
import
com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
import
com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/home/home_routing/HomeBottomNavigationController.kt
View file @
e5e2c20d
...
@@ -10,7 +10,7 @@ import com.biganto.visual.roompark.base.ICollapsingToolBar
...
@@ -10,7 +10,7 @@ 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.presentation.screen.deals.DealsScreenController
import
com.biganto.visual.roompark.presentation.screen.deals.DealsScreenController
import
com.biganto.visual.roompark.presentation.screen.
favorites
.FavoritesScreenController
import
com.biganto.visual.roompark.presentation.screen.
estate
.FavoritesScreenController
import
com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
import
com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
import
com.biganto.visual.roompark.presentation.screen.home.DaggerHomeScreenComponent
import
com.biganto.visual.roompark.presentation.screen.home.DaggerHomeScreenComponent
import
com.biganto.visual.roompark.presentation.screen.home.HomeScreenPresenter
import
com.biganto.visual.roompark.presentation.screen.home.HomeScreenPresenter
...
...
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