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
d1d9a545
Commit
d1d9a545
authored
Oct 21, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deal card, added status title
parent
102fada9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
63 deletions
+85
-63
Adapter.kt
...visual/roompark/presentation/screen/deals/util/Adapter.kt
+16
-15
deal_card_viewholder.xml
app/src/main/res/layout/deal_card_viewholder.xml
+54
-45
start_tour_viewholder.xml
app/src/main/res/layout/start_tour_viewholder.xml
+3
-3
status_title_textview.xml
app/src/main/res/layout/status_title_textview.xml
+12
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/util/Adapter.kt
View file @
d1d9a545
...
@@ -14,7 +14,7 @@ import com.biganto.visual.roompark.domain.model.StatusModel
...
@@ -14,7 +14,7 @@ import com.biganto.visual.roompark.domain.model.StatusModel
import
com.biganto.visual.roompark.presentation.screen.deals.DealPreviewModel
import
com.biganto.visual.roompark.presentation.screen.deals.DealPreviewModel
import
com.biganto.visual.roompark.view_utils.status_progress_view.StatusProgressAnimationState
import
com.biganto.visual.roompark.view_utils.status_progress_view.StatusProgressAnimationState
import
com.biganto.visual.roompark.view_utils.status_progress_view.StatusProgressCeil
import
com.biganto.visual.roompark.view_utils.status_progress_view.StatusProgressCeil
import
timber.log.Timber
import
com.google.android.material.textview.MaterialTextView
/**
/**
* Created by Vladislav Bogdashkin on 16.10.2019.
* Created by Vladislav Bogdashkin on 16.10.2019.
...
@@ -61,8 +61,10 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...
@@ -61,8 +61,10 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
@BindView
(
R
.
id
.
progress_holder
)
lateinit
var
statusContainer
:
LinearLayout
@BindView
(
R
.
id
.
progress_holder
)
lateinit
var
statusContainer
:
LinearLayout
@BindView
(
R
.
id
.
statusContainer
)
lateinit
var
statusLayout
:
LinearLayout
fun
typeName
(
type
:
String
)
=
when
(
type
){
private
fun
typeName
(
type
:
String
)
=
when
(
type
){
"flat"
->
"КВАРТИРА"
"flat"
->
"КВАРТИРА"
"parking"
->
"МАШИНОМЕСТО"
"parking"
->
"МАШИНОМЕСТО"
"storage"
->
"КЛАДОВКА"
"storage"
->
"КЛАДОВКА"
...
@@ -74,19 +76,18 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...
@@ -74,19 +76,18 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
}
}
fun
bindModel
(
deal
:
DealPreviewModel
)
{
fun
bindModel
(
deal
:
DealPreviewModel
)
{
val
fullObjName
=
"${typeName(deal.type)}\n${deal.name}"
val
fullObjName
=
"${typeName(deal.type)}\n
№
${deal.name}"
estateTitle
.
text
=
fullObjName
estateTitle
.
text
=
fullObjName
renderCommonInfo
(
deal
)
renderCommonInfo
(
deal
)
if
(
deal
.
dealTourIds
.
isNullOrEmpty
())
startTour
.
visibility
=
View
.
VISIBLE
if
(
deal
.
dealTourIds
.
isNullOrEmpty
())
startTour
.
visibility
=
View
.
GONE
else
startTour
.
visibility
=
View
.
GONE
else
startTour
.
visibility
=
View
.
VISIBLE
dealSum
.
text
=
deal
.
dealSum
.
toRubly
()
dealSum
.
text
=
deal
.
dealSum
.
toRubly
()
dealPayed
.
text
=
deal
.
dealPayout
.
toRubly
()
dealPayed
.
text
=
deal
.
dealPayout
.
toRubly
()
dealSumToPay
.
text
=
deal
.
dealToPay
.
toRubly
()
dealSumToPay
.
text
=
deal
.
dealToPay
.
toRubly
()
createStatusView
(
statusContainer
,
deal
.
statusList
,
deal
.
statusNo
,
false
)
createStatusView
(
status
Layout
,
status
Container
,
deal
.
statusList
,
deal
.
statusNo
,
false
)
}
}
private
fun
renderCommonInfo
(
info
:
DealPreviewModel
){
private
fun
renderCommonInfo
(
info
:
DealPreviewModel
){
...
@@ -112,14 +113,14 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...
@@ -112,14 +113,14 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
}
}
}
}
fun
createStatusView
(
container
:
ViewGroup
,
list
:
List
<
StatusModel
>,
currentStatus
:
Int
,
isVertical
:
Boolean
){
fun
createStatusView
(
mainContainer
:
LinearLayout
,
container
:
ViewGroup
,
list
:
List
<
StatusModel
>,
currentStatus
:
Int
,
isVertical
:
Boolean
){
container
.
removeAllViews
()
container
.
removeAllViews
()
val
scale
=
container
.
resources
.
displayMetrics
.
density
.
toDouble
()
val
scale
=
container
.
resources
.
displayMetrics
.
density
.
toDouble
()
val
param24dp
=
kotlin
.
math
.
ceil
(
24
*
scale
).
toInt
()
val
param24dp
=
kotlin
.
math
.
ceil
(
24
*
scale
).
toInt
()
val
wrapContent
=
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
val
wrapContent
=
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
(
container
as
LinearLayout
).
weightSum
=
10f
(
container
as
LinearLayout
).
weightSum
=
list
.
size
.
toFloat
()
list
.
sortedBy
{
it
.
orderId
}.
forEach
{
list
.
sortedBy
{
it
.
orderId
}.
forEach
{
val
ceil
=
LayoutInflater
.
from
(
container
.
context
)
val
ceil
=
LayoutInflater
.
from
(
container
.
context
)
...
@@ -128,24 +129,24 @@ fun createStatusView(container:ViewGroup,list:List<StatusModel>,currentStatus:In
...
@@ -128,24 +129,24 @@ fun createStatusView(container:ViewGroup,list:List<StatusModel>,currentStatus:In
ceil
.
layoutParams
.
width
=
if
(
isVertical
)
param24dp
else
wrapContent
ceil
.
layoutParams
.
width
=
if
(
isVertical
)
param24dp
else
wrapContent
(
ceil
.
layoutParams
as
LinearLayout
.
LayoutParams
).
weight
=
1f
(
ceil
.
layoutParams
as
LinearLayout
.
LayoutParams
).
weight
=
1f
(
ceil
.
layoutParams
as
LinearLayout
.
LayoutParams
).
gravity
=
Gravity
.
BOTTOM
(
ceil
.
layoutParams
as
LinearLayout
.
LayoutParams
).
gravity
=
Gravity
.
BOTTOM
Timber
.
d
(
"${it.orderId-1} != ${list.size}"
)
ceil
.
setHasEnd
(
it
.
orderId
!=
list
.
size
)
ceil
.
setHasEnd
(
it
.
orderId
!=
list
.
size
)
ceil
.
setHasStart
(
it
.
orderId
>
1
)
ceil
.
setHasStart
(
it
.
orderId
>
1
)
Timber
.
d
(
"${it.orderId} == ${currentStatus}"
)
ceil
.
setIsEnabled
(
it
.
orderId
<=
currentStatus
)
ceil
.
setIsEnabled
(
it
.
orderId
<=
currentStatus
)
Timber
.
d
(
"${it.orderId} <= ${currentStatus}"
)
ceil
.
setNext
(
it
.
orderId
<
currentStatus
)
ceil
.
setNext
(
it
.
orderId
<
currentStatus
)
if
(
it
.
orderId
>
currentStatus
)
if
(
it
.
orderId
>
currentStatus
)
ceil
.
setAnimState
(
StatusProgressAnimationState
.
DISABLE
)
ceil
.
setAnimState
(
StatusProgressAnimationState
.
DISABLE
)
ceil
.
invalidate
()
ceil
.
invalidate
()
container
.
addView
(
ceil
)
container
.
addView
(
ceil
)
Timber
.
d
(
"created view : $param24dp"
)
}
}
container
.
invalidate
()
container
.
invalidate
()
val
currentStatusText
=
LayoutInflater
.
from
(
container
.
context
)
.
inflate
(
R
.
layout
.
status_title_textview
,
container
,
false
)
as
MaterialTextView
currentStatusText
.
text
=
list
[
currentStatus
-
1
].
title
mainContainer
.
addView
(
currentStatusText
,
0
)
mainContainer
.
invalidate
()
...
...
app/src/main/res/layout/deal_card_viewholder.xml
View file @
d1d9a545
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical
"
xmlns:app=
"http://schemas.android.com/apk/res-auto
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:layout_marginBottom=
"8dp"
android:orientation=
"vertical"
app:cardElevation=
"6dp"
app:cardMaxElevation=
"8dp"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
600dp
"
android:layout_height=
"
wrap_content
"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
...
@@ -15,16 +20,17 @@
...
@@ -15,16 +20,17 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:text=
"КВАРТИРА\n№452"
/>
android:text=
"КВАРТИРА\n№452"
/>
<include
layout=
"@layout/horizontal_divider"
<include
layout=
"@layout/horizontal_divider"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
1dp
"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_margin
End
=
"16dp"
android:layout_margin
Top
=
"16dp"
android:layout_margin
Top=
"16dp"
/>
android:layout_margin
End=
"16dp"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/common_info_block"
android:id=
"@+id/common_info_block"
...
@@ -65,31 +71,29 @@
...
@@ -65,31 +71,29 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:id=
"@+id/progress_holder"
android:id=
"@+id/statusContainer"
android:orientation=
"horizontal"
android:layout_height=
"60dp"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/gradient_background_accent"
android:background=
"@drawable/gradient_background_accent"
>
android:orientation=
"vertical"
<com.biganto.visual.roompark.view_utils.status_progress_view.StatusProgressCeil
android:padding=
"16dp"
>
android:layout_width=
"24dp"
android:layout_height=
"wrap_content"
/>
<com.biganto.visual.roompark.view_utils.status_progress_view.StatusProgressCeil
android:layout_width=
"24dp"
android:layout_height=
"wrap_content"
/>
<com.biganto.visual.roompark.view_utils.status_progress_view.StatusProgressCeil
<LinearLayout
android:layout_width=
"24dp"
android:id=
"@+id/progress_holder"
android:layout_height=
"wrap_content"
/>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:weightSum=
"2"
android:weightSum=
"2"
>
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_sum_header_text_view"
android:id=
"@+id/deal_sum_header_text_view"
style=
"@style/Accent_Minor_TextView.Inverted"
style=
"@style/Accent_Minor_TextView.Inverted"
...
@@ -99,8 +103,9 @@
...
@@ -99,8 +103,9 @@
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"Сумма договора"
android:gravity=
"bottom"
android:textAlignment=
"viewStart"
/>
android:includeFontPadding=
"true"
android:text=
"Сумма договора"
/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
...
@@ -112,17 +117,17 @@
...
@@ -112,17 +117,17 @@
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"5 165 301 ₽"
android:gravity=
"bottom|end"
android:textAlignment=
"textEnd"
/>
android:includeFontPadding=
"false"
android:text=
"5 165 301 ₽"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:weightSum=
"2"
android:weightSum=
"2"
>
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_payed_header_text_view"
android:id=
"@+id/deal_payed_header_text_view"
style=
"@style/Accent_Minor_TextView.Inverted"
style=
"@style/Accent_Minor_TextView.Inverted"
...
@@ -132,8 +137,9 @@
...
@@ -132,8 +137,9 @@
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"Сумма платежей"
android:gravity=
"bottom"
android:textAlignment=
"viewStart"
/>
android:includeFontPadding=
"true"
android:text=
"Сумма платежей"
/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
...
@@ -145,16 +151,17 @@
...
@@ -145,16 +151,17 @@
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"1 332 543 ₽"
android:gravity=
"bottom|end"
android:textAlignment=
"viewEnd"
/>
android:includeFontPadding=
"false"
android:text=
"1 332 543 ₽"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:weightSum=
"2"
android:weightSum=
"2"
>
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_to_pay_header_text_view"
android:id=
"@+id/deal_to_pay_header_text_view"
style=
"@style/Accent_Minor_TextView.Inverted"
style=
"@style/Accent_Minor_TextView.Inverted"
...
@@ -164,8 +171,9 @@
...
@@ -164,8 +171,9 @@
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"Сумма к оплате"
android:gravity=
"bottom"
android:textAlignment=
"viewStart"
/>
android:includeFontPadding=
"true"
android:text=
"Сумма к оплате"
/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
...
@@ -177,8 +185,9 @@
...
@@ -177,8 +185,9 @@
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"32 543 ₽"
android:gravity=
"bottom|end"
android:textAlignment=
"viewEnd"
/>
android:includeFontPadding=
"false"
android:text=
"32 543 ₽"
/>
</LinearLayout>
</LinearLayout>
<include
<include
...
@@ -193,9 +202,9 @@
...
@@ -193,9 +202,9 @@
<com.google.android.material.card.MaterialCardView
<com.google.android.material.card.MaterialCardView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:layout_height=
"64dp"
android:layout_margin
Start
=
"16dp"
android:layout_margin=
"16dp"
a
ndroid:layout_marginTop=
"16
dp"
a
pp:cardElevation=
"4
dp"
a
ndroid:layout_marginEnd=
"16
dp"
>
a
pp:cardMaxElevation=
"8
dp"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/start_tour_viewholder.xml
View file @
d1d9a545
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:layout_margin=
"16dp"
android:elevation=
"4dp"
app:cardElevation=
"4dp"
app:cardMaxElevation=
"8dp"
android:padding=
"16dp"
android:padding=
"16dp"
app:cardCornerRadius=
"4dp"
app:cardCornerRadius=
"4dp"
>
app:cardElevation=
"4dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/status_title_textview.xml
0 → 100644
View file @
d1d9a545
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.textview.MaterialTextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
style=
"@style/Default_TextView.Inverted_Text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:layout_marginBottom=
"24dp"
android:gravity=
"center"
android:orientation=
"vertical"
android:text=
"Договор готовится для подачи на гос. регистрацию"
>
</com.google.android.material.textview.MaterialTextView>
\ 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