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
d3b59966
Commit
d3b59966
authored
Apr 29, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix deals restore
parent
80becc0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
37 deletions
+42
-37
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+42
-37
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
View file @
d3b59966
...
...
@@ -107,14 +107,13 @@ class DealScreenController :
.
observeOn
(
AndroidSchedulers
.
mainThread
())
private
var
servedDeal
:
DealModel
?
=
null
override
fun
onAttach
(
view
:
View
)
{
super
.
onAttach
(
view
)
detachDisposable
.
addAll
(
toFlatView
.
clicks
()
.
map
{
servedDea
l
?.
estate
?.
id
?:
-
1000
}
.
map
{
dealMode
l
?.
estate
?.
id
?:
-
1000
}
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
Timber
.
d
(
"got card clicked $it"
)
...
...
@@ -217,6 +216,7 @@ class DealScreenController :
silentCheck
=
true
sw
.
isChecked
=
viewState
.
subState
}
toolBar
.
headerToolbar
.
invalidate
()
}
private
fun
render
(
viewState
:
DealScreenViewState
.
SubscriptionError
)
{
...
...
@@ -241,6 +241,8 @@ class DealScreenController :
silentCheck
=
true
sw
.
isChecked
!=
sw
.
isChecked
}
viewState
.
restore
.
deal
?.
let
{
setUpDeal
(
it
)
}
}
private
fun
render
(
viewState
:
DealScreenViewState
.
ToursLoaded
)
{
...
...
@@ -263,51 +265,56 @@ class DealScreenController :
private
var
dealModel
:
DealModel
?
=
null
private
fun
render
(
viewState
:
DealScreenViewState
.
LoadDeal
)
{
servedDeal
=
viewState
.
estate
private
fun
setUpDeal
(
deal
:
DealModel
){
dealModel
=
deal
dealModel
?.
let
{
startTourView
.
setGone
(
servedDeal
?.
estate
?
.
multitourId
==
null
)
startTourView
.
setGone
(
it
.
estate
.
multitourId
==
null
)
dealTitle
.
text
=
resources
?.
getString
(
viewState
.
estate
.
estate
.
type
.
typeDoubleString
(),
viewState
.
estate
.
estate
.
number
it
.
estate
.
type
.
typeDoubleString
(),
it
.
estate
.
number
)
info1
.
title
.
text
=
resources
?.
getString
(
R
.
string
.
building
)
info1
.
text
.
text
=
viewState
.
estate
.
estate
.
commonInfo
?.
building
.
toString
()
info1
.
text
.
text
=
it
.
estate
.
commonInfo
?.
building
.
toString
()
info2
.
title
.
text
=
resources
?.
getString
(
R
.
string
.
section_begin
)
info2
.
text
.
text
=
viewState
.
estate
.
estate
.
commonInfo
?.
section_begin
.
toString
()
info2
.
text
.
text
=
it
.
estate
.
commonInfo
?.
section_begin
.
toString
()
info3
.
title
.
text
=
resources
?.
getString
(
R
.
string
.
floor
)
info3
.
text
.
text
=
viewState
.
estate
.
estate
.
commonInfo
?.
floor
.
toString
()
info3
.
text
.
text
=
it
.
estate
.
commonInfo
?.
floor
.
toString
()
info4
.
title
.
text
=
resources
?.
getString
(
R
.
string
.
area
)
info4
.
text
.
text
=
resources
?.
getString
(
R
.
string
.
area_value
,
viewState
.
estate
.
estate
.
commonInfo
?.
area
)
resources
?.
getString
(
R
.
string
.
area_value
,
it
.
estate
.
commonInfo
?.
area
)
dealSum
.
text
=
viewState
.
estate
.
opportunitySum
.
toRubly
()
dealPayed
.
text
=
viewState
.
estate
.
paymentSum
.
toRubly
()
dealSumToPay
.
text
=
viewState
.
estate
.
amount_pay_sum
.
toRubly
()
dealSum
.
text
=
it
.
opportunitySum
.
toRubly
()
dealPayed
.
text
=
it
.
paymentSum
.
toRubly
()
dealSumToPay
.
text
=
it
.
amount_pay_sum
.
toRubly
()
viewState
.
estate
.
estate
.
multitourPreview
?.
let
{
it
.
estate
.
multitourPreview
?.
let
{
url
->
Glide
.
with
(
tourScreen
)
.
load
(
it
)
.
load
(
url
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
tourScreen
)
}
dealModel
=
viewState
.
estate
toolBar
.
setToolbar
(
HeaderToolbarModel
(
true
,
resources
?.
getString
(
R
.
string
.
deal_back_chevron_title
)
,
null
,
true
)
)
}
}
progressLayout
.
removeAllViews
()
private
fun
render
(
viewState
:
DealScreenViewState
.
LoadDeal
)
{
setUpDeal
(
viewState
.
estate
)
progressLayout
.
removeAllViews
()
viewState
.
statusList
.
forEach
{
val
statusLayout
=
LayoutInflater
.
from
(
activity
)
...
...
@@ -316,9 +323,7 @@ class DealScreenController :
,
false
)
as
LinearLayout
Timber
.
d
(
"layouted: $statusLayout"
)
val
statusCeil
=
statusLayout
.
findViewById
<
StatusProgressCeil
>(
R
.
id
.
status
)
Timber
.
d
(
"layouted ceail : $statusCeil"
)
val
position
=
it
.
orderId
val
statusCount
=
viewState
.
statusList
.
size
...
...
@@ -333,11 +338,11 @@ class DealScreenController :
statusCeil
.
invalidate
()
val
statusTitle
=
statusLayout
.
findViewById
<
MaterialTextView
>(
R
.
id
.
title
)
Timber
.
d
(
"layouted statusTitle : $statusTitle"
)
statusTitle
.
text
=
it
.
shortTitle
progressLayout
.
addView
(
statusLayout
)
}
progressLayout
.
invalidate
()
}
private
fun
getComponent
()
=
DaggerDealScreenComponent
.
factory
()
...
...
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