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
e8fbbfcc
Commit
e8fbbfcc
authored
Jan 14, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor deal status generation
parent
2c600827
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
248 additions
and
14 deletions
+248
-14
Adapter.kt
...visual/roompark/presentation/screen/deals/util/Adapter.kt
+12
-14
deal_screen.xml
app/src/main/res/layout/deal_screen.xml
+236
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/util/Adapter.kt
View file @
e8fbbfcc
...
@@ -89,12 +89,17 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...
@@ -89,12 +89,17 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
dealSumToPay
.
text
=
deal
.
dealToPay
.
toRubly
()
dealSumToPay
.
text
=
deal
.
dealToPay
.
toRubly
()
createStatusView
(
createStatusView
(
statusLayout
,
statusContainer
,
statusContainer
,
deal
.
statusList
,
deal
.
statusList
,
deal
.
statusNo
,
deal
.
statusNo
,
false
false
)
)
val
currentStatusText
=
LayoutInflater
.
from
(
itemView
.
context
)
.
inflate
(
R
.
layout
.
status_title_textview
,
statusContainer
,
false
)
as
MaterialTextView
currentStatusText
.
text
=
deal
.
statusList
[
deal
.
statusNo
-
1
].
title
statusLayout
.
addView
(
currentStatusText
,
0
)
statusLayout
.
invalidate
()
}
}
private
fun
renderCommonInfo
(
info
:
DealPreviewModel
){
private
fun
renderCommonInfo
(
info
:
DealPreviewModel
){
...
@@ -117,7 +122,12 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...
@@ -117,7 +122,12 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
}
}
fun
createStatusView
(
mainContainer
:
LinearLayout
,
container
:
ViewGroup
,
list
:
List
<
StatusModel
>,
currentStatus
:
Int
,
isVertical
:
Boolean
){
fun
createStatusView
(
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
()
...
@@ -143,17 +153,5 @@ fun createStatusView(mainContainer: LinearLayout,container:ViewGroup,list:List<S
...
@@ -143,17 +153,5 @@ fun createStatusView(mainContainer: LinearLayout,container:ViewGroup,list:List<S
container
.
addView
(
ceil
)
container
.
addView
(
ceil
)
}
}
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
()
}
}
\ No newline at end of file
app/src/main/res/layout/deal_screen.xml
0 → 100644
View file @
e8fbbfcc
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:layout_marginBottom=
"8dp"
android:orientation=
"vertical"
app:cardElevation=
"6dp"
app:cardMaxElevation=
"8dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_card_header"
style=
"@style/Currency_TextView.Currency"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:text=
"КВАРТИРА\n№452"
/>
<include
layout=
"@layout/horizontal_divider"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
/>
<LinearLayout
android:id=
"@+id/common_info_block"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"16dp"
android:orientation=
"horizontal"
>
<include
android:id=
"@+id/info_ceil_1"
layout=
"@layout/info_ceil_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
<include
android:id=
"@+id/info_ceil_2"
layout=
"@layout/info_ceil_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
<include
android:id=
"@+id/info_ceil_3"
layout=
"@layout/info_ceil_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
<include
android:id=
"@+id/info_ceil_4"
layout=
"@layout/info_ceil_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/statusContainer"
android:layout_width=
"match_parent"
android:layout_height=
"200dp"
android:background=
"@drawable/gradient_background_accent"
android:orientation=
"vertical"
android:padding=
"16dp"
>
<LinearLayout
android:id=
"@+id/progress_holder"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
></LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:weightSum=
"2"
>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_sum_header_text_view"
style=
"@style/Accent_Minor_TextView.Inverted"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:gravity=
"bottom"
android:includeFontPadding=
"true"
android:text=
"Сумма договора"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_sum_value_text_view"
style=
"@style/Default_TextView.Header_Text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:gravity=
"bottom|end"
android:includeFontPadding=
"false"
android:text=
"5 165 301 ₽"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:weightSum=
"2"
>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_payed_header_text_view"
style=
"@style/Accent_Minor_TextView.Inverted"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:gravity=
"bottom"
android:includeFontPadding=
"true"
android:text=
"Сумма платежей"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_payed_value_text_view"
style=
"@style/Default_TextView.Header_Text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:gravity=
"bottom|end"
android:includeFontPadding=
"false"
android:text=
"1 332 543 ₽"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:weightSum=
"2"
>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_to_pay_header_text_view"
style=
"@style/Accent_Minor_TextView.Inverted"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:gravity=
"bottom"
android:includeFontPadding=
"true"
android:text=
"Сумма к оплате"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/deal_to_pay_value_text_view"
style=
"@style/Default_TextView.Accent_Text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"1"
android:gravity=
"bottom|end"
android:includeFontPadding=
"false"
android:text=
"32 543 ₽"
/>
</LinearLayout>
<include
android:id=
"@+id/start_tour_button"
layout=
"@layout/start_tour_viewholder"
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
/>
<com.google.android.material.card.MaterialCardView
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:layout_margin=
"16dp"
app:cardElevation=
"4dp"
app:cardMaxElevation=
"8dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/colorCommonBackground"
android:weightSum=
"3"
>
<ImageView
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_gravity=
"end|center_vertical"
android:layout_weight=
"1"
android:baselineAlignBottom=
"false"
android:src=
"@drawable/ic_flat"
/>
<com.google.android.material.textview.MaterialTextView
style=
"@style/Default_TextView.Header_Text"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_gravity=
"center|center_vertical"
android:layout_weight=
"2"
android:gravity=
"center"
android:text=
"КАРТОЧКА КВАРТИРЫ"
android:textAlignment=
"gravity"
/>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
\ 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