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
30d496d2
Commit
30d496d2
authored
Jan 14, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
statuses for tests
parent
b8965e49
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
388 additions
and
21 deletions
+388
-21
deal.kt
...ava/com/biganto/visual/roompark/domain/interactor/deal.kt
+307
-0
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+45
-2
ScreenPresenter.kt
...sual/roompark/presentation/screen/deal/ScreenPresenter.kt
+8
-15
ScreenViewState.kt
...sual/roompark/presentation/screen/deal/ScreenViewState.kt
+2
-4
progress_status_title_vertical.xml
app/src/main/res/layout/progress_status_title_vertical.xml
+26
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/domain/interactor/deal.kt
0 → 100644
View file @
30d496d2
This diff is collapsed.
Click to expand it.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
View file @
30d496d2
package
com.biganto.visual.roompark.presentation.screen.deal
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.widget.LinearLayout
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.biganto.visual.roompark.presentation.screen.deals.util.createStatusView
import
com.biganto.visual.roompark.presentation.screen.deals.util.deployProgressView
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import
com.google.android.material.textview.MaterialTextView
import
timber.log.Timber
import
javax.inject.Inject
...
...
@@ -37,8 +43,16 @@ class DealScreenController :
@Inject
override
lateinit
var
injectedPresenter
:
DealScreenPresenter
@BindView
(
R
.
id
.
explication_tab
)
lateinit
var
explicationTab
:
MaterialTextView
@BindView
(
R
.
id
.
deal_card_header
)
lateinit
var
dealTitle
:
MaterialTextView
@BindView
(
R
.
id
.
statusContainer
)
lateinit
var
statusContainer
:
LinearLayout
@BindView
(
R
.
id
.
progress_holder
)
lateinit
var
progressLayout
:
LinearLayout
private
fun
setToolbar
(){
toolBar
.
showAll
()
...
...
@@ -78,6 +92,35 @@ class DealScreenController :
private
fun
render
(
viewState
:
DealScreenViewState
.
LoadDeal
)
{
viewState
.
statusList
.
forEach
{
val
statusLayout
=
LayoutInflater
.
from
(
activity
)
.
inflate
(
R
.
layout
.
progress_deal_state_pattern_view_horizontal
,
progressLayout
,
false
)
as
LinearLayout
val
statusCeil
=
statusLayout
.
findViewById
<
StatusProgressCeil
>(
R
.
id
.
status
)
val
position
=
it
.
orderId
val
statusCount
=
viewState
.
statusList
.
size
val
lastStatusPassed
=
viewState
.
estate
.
statusId
statusCeil
.
setHasEnd
(
position
!=
statusCount
)
statusCeil
.
setHasStart
(
position
>
1
)
statusCeil
.
setIsEnabled
(
position
<=
lastStatusPassed
)
statusCeil
.
setNext
(
position
<
lastStatusPassed
)
if
(
position
>
lastStatusPassed
)
statusCeil
.
setAnimState
(
StatusProgressAnimationState
.
DISABLE
)
statusCeil
.
invalidate
()
val
statusTitle
=
statusLayout
.
findViewById
<
MaterialTextView
>(
R
.
id
.
title
)
statusTitle
.
text
=
it
.
title
progressLayout
.
addView
(
statusLayout
)
}
progressLayout
.
invalidate
()
}
private
fun
getComponent
()
=
DaggerDealScreenComponent
.
factory
()
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenPresenter.kt
View file @
30d496d2
...
...
@@ -2,18 +2,12 @@ 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.domain.model.DealModel
import
com.biganto.visual.roompark.domain.model.PlanPresetModel
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
...
...
@@ -41,18 +35,17 @@ class DealScreenPresenter @Inject constructor(
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
fetchDeal
=
interactor
.
getDeal
(
estateId
)
.
flatMap
{
deal
->
interactor
.
getStatusList
().
map
{
DealScreenViewState
.
LoadDeal
(
deal
,
it
)
}
}
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
mergeWith
(
fetchDeal
)
.
doOnError
{
Timber
.
e
(
it
)
}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenViewState.kt
View file @
30d496d2
...
...
@@ -2,9 +2,7 @@ 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.domain.model.StatusModel
import
com.biganto.visual.roompark.util.monades.ExceptionString
/**
...
...
@@ -14,6 +12,6 @@ import com.biganto.visual.roompark.util.monades.ExceptionString
sealed
class
DealScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
DealScreenViewState
()
class
LoadDeal
(
val
estate
:
DealModel
)
:
DealScreenViewState
()
class
LoadDeal
(
val
estate
:
DealModel
,
val
statusList
:
List
<
StatusModel
>
)
:
DealScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
DealScreenViewState
()
}
\ No newline at end of file
app/src/main/res/layout/progress_status_title_vertical.xml
0 → 100644
View file @
30d496d2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
android:id=
"@+id/status"
android:layout_width=
"24dp"
android:layout_height=
"match_parent"
app:direction=
"vertical"
app:hasEnd=
"false"
app:hasStart=
"false"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/title"
style=
"@style/Common_Text.Inverted"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:text=
"Договор готовится для подачи на гос. регистрацию b,kf,kf,fk"
>
</com.google.android.material.textview.MaterialTextView>
</LinearLayout>
\ 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