Skip to content

Commit 258d458

Browse files
committed
💄 인증 글 레이아웃 수정
1 parent 314b1ff commit 258d458

File tree

1 file changed

+94
-36
lines changed

1 file changed

+94
-36
lines changed

presentation/src/main/res/layout/item_running_post.xml

Lines changed: 94 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
<data>
77

8+
<import type="com.whyranoid.presentation.util.ExtensionsKt" />
9+
810
<variable
911
name="runningPost"
1012
type="com.whyranoid.domain.model.RunningPost" />
@@ -21,7 +23,8 @@
2123
android:layout_height="50dp"
2224
android:layout_margin="16dp"
2325
app:layout_constraintStart_toStartOf="parent"
24-
app:layout_constraintTop_toTopOf="parent" />
26+
app:layout_constraintTop_toTopOf="parent"
27+
android:contentDescription="@string/my_run_profile_image_description"/>
2528

2629
<TextView
2730
android:id="@+id/tv_leader_name"
@@ -31,18 +34,44 @@
3134
android:text="@{runningPost.author.name}"
3235
app:layout_constraintBottom_toBottomOf="@id/iv_leader_profile"
3336
app:layout_constraintStart_toEndOf="@id/iv_leader_profile"
34-
app:layout_constraintTop_toTopOf="parent"
37+
app:layout_constraintTop_toTopOf="@id/iv_leader_profile"
3538
tools:text="수피치" />
3639

40+
<androidx.constraintlayout.widget.ConstraintLayout
41+
android:id="@+id/item_view_running_history"
42+
android:layout_width="match_parent"
43+
android:layout_height="wrap_content"
44+
android:layout_margin="16dp"
45+
android:background="@drawable/background_rounded"
46+
android:backgroundTint="@color/mogakrun_secondary"
47+
app:layout_constraintStart_toStartOf="parent"
48+
app:layout_constraintEnd_toEndOf="parent"
49+
app:layout_constraintTop_toBottomOf="@id/iv_leader_profile"
50+
android:elevation="@dimen/cardview_default_elevation">
51+
52+
<View
53+
android:id="@+id/view_running_history_body"
54+
android:layout_width="0dp"
55+
android:layout_height="0dp"
56+
android:background="@drawable/background_rounded"
57+
app:layout_constraintBottom_toBottomOf="parent"
58+
app:layout_constraintEnd_toEndOf="parent"
59+
app:layout_constraintStart_toStartOf="parent"
60+
app:layout_constraintTop_toBottomOf="@id/tv_running_history_date" />
61+
3762
<TextView
3863
android:id="@+id/tv_running_history_date"
3964
android:layout_width="wrap_content"
4065
android:layout_height="wrap_content"
41-
android:layout_marginStart="16dp"
42-
android:layout_marginTop="16dp"
43-
android:text="@{runningPost.runningHistory.historyId}"
66+
android:layout_marginTop="4dp"
67+
android:maxLines="1"
68+
android:text="@{ExtensionsKt.toRunningDateString(runningPost.runningHistory.startedAt)}"
69+
android:textAppearance="@style/MoGakRunText.Regular.Small"
70+
android:textColor="?attr/colorOnSecondary"
71+
app:layout_constraintEnd_toEndOf="@id/view_vertical_partition_line"
72+
app:layout_constraintHorizontal_bias="0.1"
4473
app:layout_constraintStart_toStartOf="parent"
45-
app:layout_constraintTop_toBottomOf="@id/iv_leader_profile"
74+
app:layout_constraintTop_toTopOf="parent"
4675
tools:text="2022/09/11" />
4776

4877
<TextView
@@ -51,119 +80,148 @@
5180
android:layout_height="wrap_content"
5281
android:layout_marginEnd="20dp"
5382
android:text="@string/running_history_label_total_running_time"
83+
android:textAppearance="@style/MoGakRunText.Light.Small"
5484
app:layout_constraintBottom_toBottomOf="@id/tv_running_history_date"
5585
app:layout_constraintEnd_toStartOf="@id/tv_total_running_time"
86+
app:layout_constraintStart_toStartOf="@id/view_vertical_partition_line"
5687
app:layout_constraintTop_toTopOf="@id/tv_running_history_date" />
5788

5889
<TextView
5990
android:id="@+id/tv_total_running_time"
6091
android:layout_width="wrap_content"
6192
android:layout_height="wrap_content"
62-
android:text="@{Integer.toString(runningPost.runningHistory.totalRunningTime)}"
93+
android:text="@{String.format(@string/running_history_value_total_running_time, runningPost.runningHistory.totalRunningTime / 3600, runningPost.runningHistory.totalRunningTime / 60)}"
94+
android:textAppearance="@style/MoGakRunText.Regular.Small"
6395
app:layout_constraintBottom_toBottomOf="@id/tv_label_total_running_time"
6496
app:layout_constraintEnd_toEndOf="parent"
97+
app:layout_constraintStart_toEndOf="@id/tv_label_total_running_time"
6598
app:layout_constraintTop_toTopOf="@id/tv_label_total_running_time"
6699
tools:text="2시간 22분" />
67100

68101
<View
69102
android:id="@+id/view_vertical_partition_line"
70103
android:layout_width="1dp"
71-
android:layout_height="100dp"
72-
android:layout_marginTop="20dp"
73-
android:layout_marginBottom="20dp"
74-
android:background="@color/black"
104+
android:layout_height="0dp"
105+
android:alpha="0.2"
106+
android:background="?attr/colorOnSecondary"
107+
app:layout_constraintBottom_toBottomOf="parent"
75108
app:layout_constraintEnd_toEndOf="parent"
76109
app:layout_constraintStart_toStartOf="parent"
77-
app:layout_constraintTop_toBottomOf="@id/tv_label_total_running_time" />
110+
app:layout_constraintTop_toTopOf="@id/view_running_history_body" />
78111

79112
<View
80113
android:id="@+id/view_horizontal_partition_line"
81114
android:layout_width="0dp"
82115
android:layout_height="1dp"
83-
android:layout_marginTop="20dp"
84-
android:layout_marginBottom="20dp"
85-
android:background="@color/black"
86-
app:layout_constraintBottom_toBottomOf="@id/view_vertical_partition_line"
116+
android:alpha="0.2"
117+
android:background="?attr/colorOnSecondary"
87118
app:layout_constraintEnd_toEndOf="parent"
88119
app:layout_constraintStart_toStartOf="parent"
89-
app:layout_constraintTop_toTopOf="@id/view_vertical_partition_line" />
120+
app:layout_constraintTop_toBottomOf="@id/tv_start_time_value" />
90121

91122
<TextView
123+
android:id="@+id/tv_start_time_label"
92124
android:layout_width="wrap_content"
93125
android:layout_height="wrap_content"
94-
android:layout_marginStart="16dp"
95-
android:layout_marginTop="16dp"
126+
android:layout_marginHorizontal="6dp"
127+
android:layout_marginTop="12dp"
96128
android:text="@string/running_history_label_start_running_time"
129+
android:textAppearance="@style/MoGakRunText.Light.Small"
130+
app:layout_constraintEnd_toStartOf="@id/view_vertical_partition_line"
131+
app:layout_constraintHorizontal_bias="0.0"
97132
app:layout_constraintStart_toStartOf="parent"
98133
app:layout_constraintTop_toBottomOf="@id/tv_running_history_date" />
99134

100135
<TextView
136+
android:id="@+id/tv_start_time_value"
137+
longToTime="@{runningPost.runningHistory.startedAt}"
101138
android:layout_width="wrap_content"
102139
android:layout_height="wrap_content"
103-
android:layout_marginEnd="50dp"
104-
android:layout_marginBottom="20dp"
105-
app:longToTime="@{runningPost.runningHistory.startedAt}"
106-
app:layout_constraintBottom_toBottomOf="@id/view_horizontal_partition_line"
140+
android:paddingTop="10dp"
141+
android:paddingBottom="20dp"
142+
android:textAppearance="@style/MoGakRunText.Regular.Medium"
107143
app:layout_constraintEnd_toStartOf="@id/view_vertical_partition_line"
144+
app:layout_constraintHorizontal_bias="0.6"
145+
app:layout_constraintStart_toStartOf="parent"
146+
app:layout_constraintTop_toBottomOf="@id/tv_start_time_label"
108147
tools:text="17:00" />
109148

110149
<TextView
150+
android:id="@+id/tv_end_time_label"
111151
android:layout_width="wrap_content"
112152
android:layout_height="wrap_content"
113153
android:layout_marginStart="12dp"
114-
android:layout_marginTop="16dp"
115154
android:text="@string/running_history_label_finish_running_time"
155+
android:textAppearance="@style/MoGakRunText.Light.Small"
116156
app:layout_constraintStart_toStartOf="@id/view_vertical_partition_line"
117-
app:layout_constraintTop_toBottomOf="@id/tv_running_history_date" />
157+
app:layout_constraintTop_toTopOf="@id/tv_start_time_label" />
118158

119159
<TextView
160+
longToTime="@{runningPost.runningHistory.finishedAt}"
120161
android:layout_width="wrap_content"
121162
android:layout_height="wrap_content"
122-
android:layout_marginEnd="50dp"
123163
android:layout_marginBottom="20dp"
124-
app:longToTime="@{runningPost.runningHistory.finishedAt}"
125-
app:layout_constraintBottom_toBottomOf="@id/view_horizontal_partition_line"
126-
app:layout_constraintEnd_toEndOf="parent"
164+
android:paddingTop="10dp"
165+
android:paddingBottom="20dp"
166+
android:textAppearance="@style/MoGakRunText.Regular.Medium"
167+
app:layout_constraintEnd_toEndOf="@id/view_horizontal_partition_line"
168+
app:layout_constraintHorizontal_bias="0.6"
169+
app:layout_constraintStart_toEndOf="@id/view_vertical_partition_line"
170+
app:layout_constraintTop_toBottomOf="@id/tv_end_time_label"
127171
tools:text="19:22" />
128172

129173
<TextView
174+
android:id="@+id/tv_total_distance_label"
130175
android:layout_width="wrap_content"
131176
android:layout_height="wrap_content"
132-
android:layout_marginStart="16dp"
177+
android:layout_marginHorizontal="6dp"
133178
android:layout_marginTop="12dp"
134179
android:text="@string/running_history_label_running_distance"
180+
android:textAppearance="@style/MoGakRunText.Light.Small"
135181
app:layout_constraintStart_toStartOf="parent"
136182
app:layout_constraintTop_toBottomOf="@id/view_horizontal_partition_line" />
137183

138184
<TextView
139185
android:layout_width="wrap_content"
140186
android:layout_height="wrap_content"
141187
android:layout_marginTop="24dp"
142-
android:layout_marginEnd="50dp"
143-
android:text="@{Double.toString(runningPost.runningHistory.totalDistance)}"
188+
android:paddingTop="10dp"
189+
android:paddingBottom="20dp"
190+
android:text="@{runningPost.runningHistory.totalDistance >= 1000 ? String.format(@string/running_history_value_running_distance_km, runningPost.runningHistory.totalDistance / 1000) : String.format(@string/running_history_value_running_distance_m, runningPost.runningHistory.totalDistance)}"
191+
android:textAppearance="@style/MoGakRunText.Regular.Medium"
144192
app:layout_constraintEnd_toStartOf="@id/view_vertical_partition_line"
193+
app:layout_constraintHorizontal_bias="0.6"
194+
app:layout_constraintStart_toStartOf="parent"
145195
app:layout_constraintTop_toBottomOf="@id/view_horizontal_partition_line"
146196
tools:text="11.7km" />
147197

148198
<TextView
199+
android:id="@+id/tv_total_pace_label"
149200
android:layout_width="wrap_content"
150201
android:layout_height="wrap_content"
151202
android:layout_marginStart="12dp"
152203
android:layout_marginTop="12dp"
153204
android:text="@string/running_history_label_running_pace"
205+
android:textAppearance="@style/MoGakRunText.Light.Small"
154206
app:layout_constraintStart_toStartOf="@id/view_vertical_partition_line"
155207
app:layout_constraintTop_toBottomOf="@id/view_horizontal_partition_line" />
156208

157209
<TextView
158210
android:layout_width="wrap_content"
159211
android:layout_height="wrap_content"
160212
android:layout_marginTop="24dp"
161-
android:layout_marginEnd="50dp"
162-
android:text="@{Double.toString(runningPost.runningHistory.pace)}"
163-
app:layout_constraintEnd_toEndOf="parent"
213+
android:paddingTop="10dp"
214+
android:paddingBottom="20dp"
215+
android:text="@{String.format(@string/running_history_value_running_pace, runningPost.runningHistory.pace)}"
216+
android:textAppearance="@style/MoGakRunText.Regular.Medium"
217+
app:layout_constraintEnd_toEndOf="@id/view_horizontal_partition_line"
218+
app:layout_constraintHorizontal_bias="0.6"
219+
app:layout_constraintStart_toEndOf="@id/view_vertical_partition_line"
164220
app:layout_constraintTop_toBottomOf="@id/view_horizontal_partition_line"
165221
tools:text="6.3km/h" />
166222

223+
</androidx.constraintlayout.widget.ConstraintLayout>
224+
167225
<TextView
168226
android:id="@+id/tv_like_cnt"
169227
android:layout_width="0dp"
@@ -173,7 +231,7 @@
173231
android:text="@{@string/text_like_count(runningPost.likeCount)}"
174232
app:layout_constraintEnd_toEndOf="parent"
175233
app:layout_constraintStart_toStartOf="parent"
176-
app:layout_constraintTop_toBottomOf="@id/view_vertical_partition_line"
234+
app:layout_constraintTop_toBottomOf="@id/item_view_running_history"
177235
tools:text="좋아요 0개" />
178236

179237
<TextView

0 commit comments

Comments
 (0)