Skip to content

Commit 363e882

Browse files
yonghanJubngsh
authored andcommitted
🐛 RunningHistoryUiModel.kt 맴버 타입 변경
1 parent 1c04568 commit 363e882

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

presentation/src/main/java/com/whyranoid/presentation/model/RunningHistoryUiModel.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ import com.whyranoid.domain.model.RunningHistory
44

55
data class RunningHistoryUiModel(
66
val historyId: String,
7-
val date: String,
8-
val totalRunningTime: String,
9-
val startedAt: String,
10-
val finishedAt: String,
11-
val totalDistance: String,
12-
val pace: String
7+
val date: Long,
8+
val totalRunningTime: Int,
9+
val startedAt: Long,
10+
val finishedAt: Long,
11+
val totalDistance: Double,
12+
val pace: Double
1313
) : java.io.Serializable
1414

1515
// TODO 원하는 형태로 변환하도록 코드 수정해야함
1616
fun RunningHistory.toRunningHistoryUiModel(): RunningHistoryUiModel {
1717
return RunningHistoryUiModel(
1818
historyId = historyId,
19-
date = startedAt.toString(),
20-
totalRunningTime = totalRunningTime.toString(),
21-
startedAt = startedAt.toString(),
22-
finishedAt = finishedAt.toString(),
23-
totalDistance = totalDistance.toString(),
24-
pace = pace.toString()
19+
date = startedAt,
20+
totalRunningTime = totalRunningTime,
21+
startedAt = startedAt,
22+
finishedAt = finishedAt,
23+
totalDistance = totalDistance,
24+
pace = pace
2525
)
2626
}

presentation/src/main/java/com/whyranoid/presentation/running/RunningDataManager.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ fun RunningData.toRunningFinishData() =
138138
RunningFinishData(
139139
RunningHistoryUiModel(
140140
historyId = UUID.randomUUID().toString(),
141-
date = "date",
142-
startedAt = startTime.toString(),
143-
finishedAt = System.currentTimeMillis().toString(),
144-
totalRunningTime = runningTime.toString(),
145-
pace = pace.toString(),
146-
totalDistance = totalDistance.toString()
141+
date = startTime,
142+
startedAt = startTime,
143+
finishedAt = System.currentTimeMillis(),
144+
totalRunningTime = runningTime,
145+
pace = pace,
146+
totalDistance = totalDistance
147147
),
148148
runningPositionList
149149
)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
android:layout_height="wrap_content"
2121
app:layout_constraintStart_toStartOf="parent"
2222
app:layout_constraintTop_toTopOf="parent"
23-
android:text="@{runningHistory.date}"
23+
android:text="@{Long.toString(runningHistory.date)}"
2424
tools:text="2022/09/11" />
2525

2626
<TextView
@@ -37,7 +37,7 @@
3737
android:id="@+id/tv_total_running_time"
3838
android:layout_width="wrap_content"
3939
android:layout_height="wrap_content"
40-
android:text="@{runningHistory.totalRunningTime}"
40+
android:text="@{Integer.toString(runningHistory.totalRunningTime)}"
4141
app:layout_constraintBottom_toBottomOf="@id/tv_label_total_running_time"
4242
app:layout_constraintEnd_toEndOf="parent"
4343
app:layout_constraintTop_toTopOf="@id/tv_label_total_running_time"
@@ -79,7 +79,7 @@
7979
android:layout_width="wrap_content"
8080
android:layout_height="wrap_content"
8181
tools:text="17:00"
82-
android:text="@{runningHistory.startedAt}"
82+
android:text="@{Long.toString(runningHistory.startedAt)}"
8383
app:layout_constraintEnd_toStartOf="@id/view_vertical_partition_line"
8484
app:layout_constraintBottom_toBottomOf="@id/view_horizontal_partition_line"
8585
android:layout_marginEnd="50dp"
@@ -98,7 +98,7 @@
9898
android:layout_width="wrap_content"
9999
android:layout_height="wrap_content"
100100
tools:text="19:22"
101-
android:text="@{runningHistory.finishedAt}"
101+
android:text="@{Long.toString(runningHistory.finishedAt)}"
102102
app:layout_constraintEnd_toEndOf="parent"
103103
app:layout_constraintBottom_toBottomOf="@id/view_horizontal_partition_line"
104104
android:layout_marginEnd="50dp"
@@ -116,7 +116,7 @@
116116
android:layout_width="wrap_content"
117117
android:layout_height="wrap_content"
118118
tools:text="11.7km"
119-
android:text="@{runningHistory.totalDistance}"
119+
android:text="@{Double.toString(runningHistory.totalDistance)}"
120120
app:layout_constraintEnd_toStartOf="@id/view_vertical_partition_line"
121121
app:layout_constraintTop_toBottomOf="@id/view_horizontal_partition_line"
122122
android:layout_marginTop="24dp"
@@ -135,7 +135,7 @@
135135
android:layout_width="wrap_content"
136136
android:layout_height="wrap_content"
137137
tools:text="6.3km/h"
138-
android:text="@{runningHistory.pace}"
138+
android:text="@{Double.toString(runningHistory.pace)}"
139139
app:layout_constraintTop_toBottomOf="@id/view_horizontal_partition_line"
140140
app:layout_constraintEnd_toEndOf="parent"
141141
android:layout_marginTop="24dp"

0 commit comments

Comments
 (0)