4
4
xmlns : tools =" http://schemas.android.com/tools" >
5
5
6
6
<data >
7
+
8
+ <import type =" com.whyranoid.presentation.util.ExtensionsKt" />
9
+
7
10
<variable
8
11
name =" runningHistory"
9
12
type =" com.whyranoid.presentation.model.RunningHistoryUiModel" />
12
15
<androidx .constraintlayout.widget.ConstraintLayout
13
16
android : layout_width =" match_parent"
14
17
android : layout_height =" wrap_content"
15
- android : padding =" 12dp" >
18
+ android : layout_margin =" 2dp"
19
+ android : background =" @drawable/background_rounded"
20
+ android : backgroundTint =" @color/mogakrun_secondary"
21
+ android : elevation =" @dimen/cardview_default_elevation" >
22
+
23
+ <View
24
+ android : id =" @+id/view_running_history_body"
25
+ android : layout_width =" 0dp"
26
+ android : layout_height =" 0dp"
27
+ android : background =" @drawable/background_rounded"
28
+ app : layout_constraintBottom_toBottomOf =" parent"
29
+ app : layout_constraintEnd_toEndOf =" parent"
30
+ app : layout_constraintStart_toStartOf =" parent"
31
+ app : layout_constraintTop_toBottomOf =" @id/tv_running_history_date" />
16
32
17
33
<TextView
18
34
android : id =" @+id/tv_running_history_date"
19
35
android : layout_width =" wrap_content"
20
36
android : layout_height =" wrap_content"
37
+ android : layout_marginTop =" 4dp"
38
+ android : maxLines =" 1"
39
+ android : text =" @{ExtensionsKt.toRunningDateString(runningHistory.date)}"
40
+ android : textAppearance =" @style/MoGakRunText.Regular.Small"
41
+ android : textColor =" ?attr/colorOnSecondary"
42
+ app : layout_constraintEnd_toEndOf =" @id/view_vertical_partition_line"
43
+ app : layout_constraintHorizontal_bias =" 0.1"
21
44
app : layout_constraintStart_toStartOf =" parent"
22
45
app : layout_constraintTop_toTopOf =" parent"
23
- android : text =" @{Long.toString(runningHistory.date)}"
24
46
tools : text =" 2022/09/11" />
25
47
26
48
<TextView
29
51
android : layout_height =" wrap_content"
30
52
android : layout_marginEnd =" 20dp"
31
53
android : text =" @string/running_history_label_total_running_time"
54
+ android : textAppearance =" @style/MoGakRunText.Light.Small"
32
55
app : layout_constraintBottom_toBottomOf =" @id/tv_running_history_date"
33
56
app : layout_constraintEnd_toStartOf =" @id/tv_total_running_time"
57
+ app : layout_constraintStart_toStartOf =" @id/view_vertical_partition_line"
34
58
app : layout_constraintTop_toTopOf =" @id/tv_running_history_date" />
35
59
36
60
<TextView
37
61
android : id =" @+id/tv_total_running_time"
38
62
android : layout_width =" wrap_content"
39
63
android : layout_height =" wrap_content"
40
- android : text =" @{Integer.toString(runningHistory.totalRunningTime)}"
64
+ android : text =" @{String.format(@string/running_history_value_total_running_time, runningHistory.totalRunningTime / 3600, runningHistory.totalRunningTime / 60)}"
65
+ android : textAppearance =" @style/MoGakRunText.Regular.Small"
41
66
app : layout_constraintBottom_toBottomOf =" @id/tv_label_total_running_time"
42
67
app : layout_constraintEnd_toEndOf =" parent"
68
+ app : layout_constraintStart_toEndOf =" @id/tv_label_total_running_time"
43
69
app : layout_constraintTop_toTopOf =" @id/tv_label_total_running_time"
44
70
tools : text =" 2μκ° 22λΆ" />
45
71
46
72
<View
47
73
android : id =" @+id/view_vertical_partition_line"
48
74
android : layout_width =" 1dp"
49
- android : layout_height =" 100dp"
50
- app : layout_constraintTop_toBottomOf =" @id/tv_label_total_running_time"
51
- app : layout_constraintStart_toStartOf =" parent"
52
- app : layout_constraintEnd_toEndOf =" parent"
75
+ android : layout_height =" 0dp"
76
+ android : alpha =" 0.2"
77
+ android : background =" ?attr/colorOnSecondary"
53
78
app : layout_constraintBottom_toBottomOf =" parent"
54
- android : layout_marginTop = " 20dp "
55
- android : layout_marginBottom = " 20dp "
56
- android : background =" @color/black " />
79
+ app : layout_constraintEnd_toEndOf = " parent "
80
+ app : layout_constraintStart_toStartOf = " parent "
81
+ app : layout_constraintTop_toTopOf =" @id/view_running_history_body " />
57
82
58
83
<View
59
84
android : id =" @+id/view_horizontal_partition_line"
60
85
android : layout_width =" 0dp"
61
86
android : layout_height =" 1dp"
62
- app : layout_constraintStart_toStartOf =" parent"
87
+ android : alpha =" 0.2"
88
+ android : background =" ?attr/colorOnSecondary"
63
89
app : layout_constraintEnd_toEndOf =" parent"
64
- app : layout_constraintTop_toBottomOf =" @id/tv_label_total_running_time"
65
- app : layout_constraintBottom_toBottomOf =" parent"
66
- android : layout_marginTop =" 20dp"
67
- android : layout_marginBottom =" 20dp"
68
- android : background =" @color/black" />
90
+ app : layout_constraintStart_toStartOf =" parent"
91
+ app : layout_constraintTop_toBottomOf =" @id/tv_start_time_value" />
69
92
70
93
<TextView
94
+ android : id =" @+id/tv_start_time_label"
71
95
android : layout_width =" wrap_content"
72
96
android : layout_height =" wrap_content"
97
+ android : layout_marginHorizontal =" 6dp"
98
+ android : layout_marginTop =" 12dp"
73
99
android : text =" @string/running_history_label_start_running_time"
100
+ android : textAppearance =" @style/MoGakRunText.Light.Small"
101
+ app : layout_constraintEnd_toStartOf =" @id/view_vertical_partition_line"
102
+ app : layout_constraintHorizontal_bias =" 0.0"
74
103
app : layout_constraintStart_toStartOf =" parent"
75
- app : layout_constraintTop_toBottomOf =" @id/tv_running_history_date"
76
- app : layout_constraintBottom_toTopOf =" @id/view_horizontal_partition_line" />
104
+ app : layout_constraintTop_toBottomOf =" @id/tv_running_history_date" />
77
105
78
106
<TextView
107
+ android : id =" @+id/tv_start_time_value"
108
+ longToTime =" @{runningHistory.startedAt}"
79
109
android : layout_width =" wrap_content"
80
110
android : layout_height =" wrap_content"
81
- tools : text =" 17:00"
82
- android : text =" @{Long.toString(runningHistory.startedAt)}"
111
+ android : paddingTop =" 10dp"
112
+ android : paddingBottom =" 20dp"
113
+ android : textAppearance =" @style/MoGakRunText.Regular.Medium"
83
114
app : layout_constraintEnd_toStartOf =" @id/view_vertical_partition_line"
84
- app : layout_constraintBottom_toBottomOf =" @id/view_horizontal_partition_line"
85
- android : layout_marginEnd =" 50dp"
86
- android : layout_marginBottom =" 20dp" />
115
+ app : layout_constraintHorizontal_bias =" 0.6"
116
+ app : layout_constraintStart_toStartOf =" parent"
117
+ app : layout_constraintTop_toBottomOf =" @id/tv_start_time_label"
118
+ tools : text =" 17:00" />
87
119
88
120
<TextView
121
+ android : id =" @+id/tv_end_time_label"
89
122
android : layout_width =" wrap_content"
90
123
android : layout_height =" wrap_content"
91
- android : text =" @string/running_history_label_finish_running_time"
92
124
android : layout_marginStart =" 12dp"
125
+ android : text =" @string/running_history_label_finish_running_time"
126
+ android : textAppearance =" @style/MoGakRunText.Light.Small"
93
127
app : layout_constraintStart_toStartOf =" @id/view_vertical_partition_line"
94
- app : layout_constraintTop_toBottomOf =" @id/tv_running_history_date"
95
- app : layout_constraintBottom_toTopOf =" @id/view_horizontal_partition_line" />
128
+ app : layout_constraintTop_toTopOf =" @id/tv_start_time_label" />
96
129
97
130
<TextView
131
+ longToTime =" @{runningHistory.finishedAt}"
98
132
android : layout_width =" wrap_content"
99
133
android : layout_height =" wrap_content"
100
- tools : text =" 19:22"
101
- android : text =" @{Long.toString(runningHistory.finishedAt)}"
102
- app : layout_constraintEnd_toEndOf =" parent"
103
- app : layout_constraintBottom_toBottomOf =" @id/view_horizontal_partition_line"
104
- android : layout_marginEnd =" 50dp"
105
- android : layout_marginBottom =" 20dp" />
134
+ android : layout_marginBottom =" 20dp"
135
+ android : paddingTop =" 10dp"
136
+ android : paddingBottom =" 20dp"
137
+ android : textAppearance =" @style/MoGakRunText.Regular.Medium"
138
+ app : layout_constraintEnd_toEndOf =" @id/view_horizontal_partition_line"
139
+ app : layout_constraintHorizontal_bias =" 0.6"
140
+ app : layout_constraintStart_toEndOf =" @id/view_vertical_partition_line"
141
+ app : layout_constraintTop_toBottomOf =" @id/tv_end_time_label"
142
+ tools : text =" 19:22" />
106
143
107
144
<TextView
145
+ android : id =" @+id/tv_total_distance_label"
108
146
android : layout_width =" wrap_content"
109
147
android : layout_height =" wrap_content"
148
+ android : layout_marginHorizontal =" 6dp"
149
+ android : layout_marginTop =" 12dp"
110
150
android : text =" @string/running_history_label_running_distance"
151
+ android : textAppearance =" @style/MoGakRunText.Light.Small"
111
152
app : layout_constraintStart_toStartOf =" parent"
112
- android : layout_marginTop =" 12dp"
113
153
app : layout_constraintTop_toBottomOf =" @id/view_horizontal_partition_line" />
114
154
115
155
<TextView
116
156
android : layout_width =" wrap_content"
117
157
android : layout_height =" wrap_content"
118
- tools : text =" 11.7km"
119
- android : text =" @{Double.toString(runningHistory.totalDistance)}"
158
+ android : layout_marginTop =" 24dp"
159
+ android : paddingTop =" 10dp"
160
+ android : paddingBottom =" 20dp"
161
+ android : text =" @{runningHistory.totalDistance >= 1000 ? String.format(@string/running_history_value_running_distance_km, runningHistory.totalDistance / 1000) : String.format(@string/running_history_value_running_distance_m, runningHistory.totalDistance)}"
162
+ android : textAppearance =" @style/MoGakRunText.Regular.Medium"
120
163
app : layout_constraintEnd_toStartOf =" @id/view_vertical_partition_line"
164
+ app : layout_constraintHorizontal_bias =" 0.6"
165
+ app : layout_constraintStart_toStartOf =" parent"
121
166
app : layout_constraintTop_toBottomOf =" @id/view_horizontal_partition_line"
122
- android : layout_marginTop =" 24dp"
123
- android : layout_marginEnd =" 50dp" />
167
+ tools : text =" 11.7km" />
124
168
125
169
<TextView
170
+ android : id =" @+id/tv_total_pace_label"
126
171
android : layout_width =" wrap_content"
127
172
android : layout_height =" wrap_content"
173
+ android : layout_marginStart =" 12dp"
174
+ android : layout_marginTop =" 12dp"
128
175
android : text =" @string/running_history_label_running_pace"
129
- app : layout_constraintTop_toBottomOf =" @id/view_horizontal_partition_line "
176
+ android : textAppearance =" @style/MoGakRunText.Light.Small "
130
177
app : layout_constraintStart_toStartOf =" @id/view_vertical_partition_line"
131
- android : layout_marginTop =" 12dp"
132
- android : layout_marginStart =" 12dp" />
178
+ app : layout_constraintTop_toBottomOf =" @id/view_horizontal_partition_line" />
133
179
134
180
<TextView
135
181
android : layout_width =" wrap_content"
136
182
android : layout_height =" wrap_content"
137
- tools : text =" 6.3km/h"
138
- android : text =" @{Double.toString(runningHistory.pace)}"
139
- app : layout_constraintTop_toBottomOf =" @id/view_horizontal_partition_line"
140
- app : layout_constraintEnd_toEndOf =" parent"
141
183
android : layout_marginTop =" 24dp"
142
- android : layout_marginEnd =" 50dp" />
184
+ android : paddingTop =" 10dp"
185
+ android : paddingBottom =" 20dp"
186
+ android : text =" @{String.format(@string/running_history_value_running_pace, runningHistory.pace)}"
187
+ android : textAppearance =" @style/MoGakRunText.Regular.Medium"
188
+ app : layout_constraintEnd_toEndOf =" @id/view_horizontal_partition_line"
189
+ app : layout_constraintHorizontal_bias =" 0.6"
190
+ app : layout_constraintStart_toEndOf =" @id/view_vertical_partition_line"
191
+ app : layout_constraintTop_toBottomOf =" @id/view_horizontal_partition_line"
192
+ tools : text =" 6.3km/h" />
143
193
144
194
</androidx .constraintlayout.widget.ConstraintLayout>
195
+
196
+
145
197
</layout >
0 commit comments