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
2c600827
Commit
2c600827
authored
Jan 13, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add deal screen blank, fix imports
parent
76a81cd5
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
241 additions
and
8 deletions
+241
-8
ScreenContract.kt
...isual/roompark/presentation/screen/deal/ScreenContract.kt
+11
-0
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+89
-0
ScreenDI.kt
...anto/visual/roompark/presentation/screen/deal/ScreenDI.kt
+45
-0
ScreenPresenter.kt
...sual/roompark/presentation/screen/deal/ScreenPresenter.kt
+69
-0
ScreenViewState.kt
...sual/roompark/presentation/screen/deal/ScreenViewState.kt
+19
-0
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+3
-3
ScreenDI.kt
...to/visual/roompark/presentation/screen/estate/ScreenDI.kt
+1
-1
ScreenPresenter.kt
...al/roompark/presentation/screen/estate/ScreenPresenter.kt
+2
-2
ScreenViewState.kt
...al/roompark/presentation/screen/estate/ScreenViewState.kt
+1
-1
ScreenController.kt
...oompark/presentation/screen/favorites/ScreenController.kt
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenContract.kt
0 → 100644
View file @
2c600827
package
com.biganto.visual.roompark.presentation.screen.deal
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface
DealScreen
:
BigantoBaseContract
<
DealScreenViewState
>
{
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
0 → 100644
View file @
2c600827
package
com.biganto.visual.roompark.presentation.screen.deal
import
android.os.Bundle
import
android.view.View
import
androidx.core.os.bundleOf
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.google.android.material.textview.MaterialTextView
import
timber.log.Timber
import
javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
const
val
SELECTED_ESTATE_ID_KEY
=
"SELECTED_ESTATE_INDEX"
class
DealScreenController
:
BigantoBaseController
<
DealScreenViewState
,
DealScreen
,
DealScreenPresenter
>
,
DealScreen
{
constructor
(
args
:
Bundle
):
super
(
args
)
constructor
(
id
:
Int
)
:
super
(
bundleOf
(
SELECTED_ESTATE_ID_KEY
to
id
))
override
fun
injectDependencies
()
{
getComponent
()
}
@Inject
override
lateinit
var
injectedPresenter
:
DealScreenPresenter
@BindView
(
R
.
id
.
explication_tab
)
lateinit
var
explicationTab
:
MaterialTextView
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
)
// planTypesTabLayout.
}
private
fun
bindRecycler
()
{
}
override
fun
onViewBound
(
v
:
View
)
{
setToolbar
()
bindRecycler
()
}
override
fun
render
(
viewState
:
DealScreenViewState
)
{
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
when
(
viewState
){
is
DealScreenViewState
.
Idle
->
render
(
viewState
)
is
DealScreenViewState
.
LoadDeal
->
render
(
viewState
)
is
DealScreenViewState
.
SomeError
->
render
(
viewState
)
}
}
private
fun
render
(
viewState
:
DealScreenViewState
.
Idle
){
}
private
fun
render
(
viewState
:
DealScreenViewState
.
SomeError
)
=
showError
(
viewState
.
exception
)
private
fun
render
(
viewState
:
DealScreenViewState
.
LoadDeal
)
{
}
private
fun
getComponent
()
=
DaggerDealScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
,
args
.
getInt
(
SELECTED_ESTATE_ID_KEY
))
.
inject
(
this
)
override
fun
getLayoutId
():
Int
=
R
.
layout
.
deal_scren
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenDI.kt
0 → 100644
View file @
2c600827
package
com.biganto.visual.roompark.presentation.screen.deal
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
com.biganto.visual.roompark.presentation.screen.estate.DealScreenComponent
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenController
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenModule
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenPresenter
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
javax.inject.Named
@PerScreen
@Component
(
modules
=
[
DealScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
DealScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
,
@BindsInstance
@Named
(
SELECTED_ESTATE_ID_KEY
)
selectedDealId
:
Int
):
DealScreenComponent
}
val
presenter
:
DealScreenPresenter
fun
inject
(
controller
:
DealScreenController
)
}
@Module
abstract
class
DealScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenPresenter.kt
0 → 100644
View file @
2c600827
package
com.biganto.visual.roompark.presentation.screen.deal
import
android.content.Context
import
androidx.annotation.StringRes
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.DealInteractor
import
com.biganto.visual.roompark.domain.model.*
import
com.biganto.visual.roompark.presentation.screen.deal.DealScreen
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreen
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenViewState
import
com.biganto.visual.roompark.presentation.screen.estate.InfoShowType
import
com.biganto.visual.roompark.presentation.screen.estate.util.DisplayInfoModel
import
com.biganto.visual.roompark.util.extensions.toRubly
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
import
javax.inject.Inject
import
javax.inject.Named
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
class
DealScreenPresenter
@Inject
constructor
(
private
val
interactor
:
DealInteractor
,
private
val
context
:
Context
,
@Named
(
SELECTED_ESTATE_ID_KEY
)
private
val
estateId
:
Int
)
:
BigantoBasePresenter
<
DealScreen
,
DealScreenViewState
>()
{
private
var
planList
:
List
<
PlanPresetModel
>?
=
null
private
var
estate
:
DealModel
?
=
null
private
var
showType
:
InfoShowType
=
InfoShowType
.
COMMON_INFO
override
fun
defaultErrorViewStateHandler
()
=
{
e
:
ExceptionString
->
DealScreenViewState
.
SomeError
(
e
)
}
private
fun
getPlan
(
plan
:
PlanPresetModel
):
Observable
<
DealScreenViewState
>
=
interactor
.
getPlan
(
plan
)
.
map
<
DealScreenViewState
>
{
DealScreenViewState
.
LoadPlan
(
it
)
}
override
fun
bindIntents
()
{
val
prefetchCards
=
interactor
.
getDeal
(
estateId
)
.
doOnNext
{
estate
=
it
.
copy
()
}
.
map
{
DealScreenViewState
.
LoadDeal
(
it
)
}
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
doOnError
{
Timber
.
e
(
it
)
}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
subscribeViewState
(
state
.
cast
(
DealScreenViewState
::
class
.
java
),
DealScreen
::
render
)
}
private
fun
langString
(
@StringRes
id
:
Int
)
=
context
.
resources
.
getString
(
id
)
private
fun
langString
(
@StringRes
id
:
Int
,
vararg
args
:
Any
)
=
context
.
resources
.
getString
(
id
,*
args
)
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenViewState.kt
0 → 100644
View file @
2c600827
package
com.biganto.visual.roompark.presentation.screen.deal
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.domain.model.DealModel
import
com.biganto.visual.roompark.domain.model.PlanPresetModel
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenViewState
import
com.biganto.visual.roompark.presentation.screen.estate.util.DisplayInfoModel
import
com.biganto.visual.roompark.util.monades.ExceptionString
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
sealed
class
DealScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
DealScreenViewState
()
class
LoadDeal
(
val
estate
:
DealModel
)
:
DealScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
DealScreenViewState
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
2c600827
...
@@ -94,7 +94,7 @@ class EstateScreenController :
...
@@ -94,7 +94,7 @@ class EstateScreenController :
constructor
(
args
:
Bundle
):
super
(
args
)
constructor
(
args
:
Bundle
):
super
(
args
)
constructor
(
id
:
Int
)
:
super
(
bundleOf
(
SELECTED_ESTATE_ID_KEY
to
id
))
constructor
(
id
:
Int
)
:
super
(
bundleOf
(
com
.
biganto
.
visual
.
roompark
.
presentation
.
screen
.
deal
.
SELECTED_ESTATE_ID_KEY
to
id
))
override
fun
injectDependencies
()
{
override
fun
injectDependencies
()
{
getComponent
()
getComponent
()
...
@@ -278,7 +278,7 @@ class EstateScreenController :
...
@@ -278,7 +278,7 @@ class EstateScreenController :
private
fun
getComponent
()
=
DaggerEstateScreenComponent
.
factory
()
private
fun
getComponent
()
=
DaggerEstateScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
,
args
.
getInt
(
SELECTED_ESTATE_ID_KEY
))
,
args
.
getInt
(
com
.
biganto
.
visual
.
roompark
.
presentation
.
screen
.
deal
.
SELECTED_ESTATE_ID_KEY
))
.
inject
(
this
)
.
inject
(
this
)
override
fun
getLayoutId
():
Int
=
R
.
layout
.
flat_full_card_screen
override
fun
getLayoutId
():
Int
=
R
.
layout
.
flat_full_card_screen
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenDI.kt
View file @
2c600827
...
@@ -22,7 +22,7 @@ interface EstateScreenComponent {
...
@@ -22,7 +22,7 @@ interface EstateScreenComponent {
fun
create
(
fun
create
(
appComponent
:
AppComponent
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
,
@BindsInstance
activity
:
RoomParkMainActivity
,
@BindsInstance
@Named
(
SELECTED_ESTATE_ID_KEY
)
selectedEstateId
:
Int
,
@BindsInstance
@Named
(
com
.
biganto
.
visual
.
roompark
.
presentation
.
screen
.
deal
.
SELECTED_ESTATE_ID_KEY
)
selectedEstateId
:
Int
):
EstateScreenComponent
):
EstateScreenComponent
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenPresenter.kt
View file @
2c600827
...
@@ -24,7 +24,7 @@ import javax.inject.Named
...
@@ -24,7 +24,7 @@ import javax.inject.Named
class
EstateScreenPresenter
@Inject
constructor
(
class
EstateScreenPresenter
@Inject
constructor
(
private
val
interactor
:
EstateInteractor
,
private
val
interactor
:
EstateInteractor
,
private
val
context
:
Context
,
private
val
context
:
Context
,
@Named
(
SELECTED_ESTATE_ID_KEY
)
private
val
estateId
:
Int
@Named
(
com
.
biganto
.
visual
.
roompark
.
presentation
.
screen
.
deal
.
SELECTED_ESTATE_ID_KEY
)
private
val
estateId
:
Int
)
)
:
BigantoBasePresenter
<
EstateScreen
,
EstateScreenViewState
>()
{
:
BigantoBasePresenter
<
EstateScreen
,
EstateScreenViewState
>()
{
...
@@ -66,7 +66,7 @@ class EstateScreenPresenter @Inject constructor(
...
@@ -66,7 +66,7 @@ class EstateScreenPresenter @Inject constructor(
EstateScreenViewState
.
ShowEstateInfo
(
EstateScreenViewState
.
ShowEstateInfo
(
showType
showType
,
if
(
showType
==
InfoShowType
.
COMMON_INFO
)
,
if
(
showType
==
InfoShowType
.
COMMON_INFO
)
mapCommonInfo
(
estate
?.
commonInfo
)
mapCommonInfo
(
estate
?.
commonInfo
)
else
mapCommonInfo
(
planPreset
.
explication
)
else
mapCommonInfo
(
planPreset
.
explication
)
)
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenViewState.kt
View file @
2c600827
...
@@ -18,5 +18,5 @@ sealed class EstateScreenViewState : BigantoBaseViewState() {
...
@@ -18,5 +18,5 @@ sealed class EstateScreenViewState : BigantoBaseViewState() {
class
PlanTypeSelected
(
val
item
:
PlanPresetModel
)
:
EstateScreenViewState
()
class
PlanTypeSelected
(
val
item
:
PlanPresetModel
)
:
EstateScreenViewState
()
class
LoadPlan
(
val
planBody
:
String
)
:
EstateScreenViewState
()
class
LoadPlan
(
val
planBody
:
String
)
:
EstateScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
EstateScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
EstateScreenViewState
()
class
ShowEstateInfo
(
val
showType
:
InfoShowType
,
val
info
:
List
<
DisplayInfoModel
>)
:
EstateScreenViewState
()
class
ShowEstateInfo
(
val
showType
:
InfoShowType
,
val
info
:
List
<
DisplayInfoModel
>)
:
EstateScreenViewState
()
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenController.kt
View file @
2c600827
...
@@ -8,7 +8,7 @@ import com.biganto.visual.roompark.R
...
@@ -8,7 +8,7 @@ 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
.EstateScreenController
import
com.biganto.visual.roompark.presentation.screen.
deal
.EstateScreenController
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
com.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.RouterTransaction
...
...
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