Skip to content

Commit ab2fbd6

Browse files
committed
fix: 우선순위 QA 항목 수정
- 운동 시작 전 페이지 close 버튼 추가 - 운동 기록 페이지 기본 프로필 추가 - 이벤트 항목 기간 표시
1 parent c38501e commit ab2fbd6

10 files changed

Lines changed: 91 additions & 35 deletions

File tree

core/designsystem/src/main/java/com/combo/runcombi/core/designsystem/component/AppTopBar.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.material3.Text
1212
import androidx.compose.runtime.Composable
1313
import androidx.compose.ui.Alignment
1414
import androidx.compose.ui.Modifier
15+
import androidx.compose.ui.graphics.Color
1516
import androidx.compose.ui.text.style.TextAlign
1617
import androidx.compose.ui.text.style.TextOverflow
1718
import androidx.compose.ui.tooling.preview.Preview
@@ -25,6 +26,7 @@ fun RunCombiAppTopBar(
2526
title: String = "",
2627
onBack: () -> Unit = {},
2728
onClose: () -> Unit = {},
29+
buttonTint: Color? = null,
2830
isVisibleBackBtn: Boolean = true,
2931
isVisibleCloseBtn: Boolean = false,
3032
padding: PaddingValues = PaddingValues(horizontal = 20.dp, vertical = 8.dp),
@@ -39,7 +41,8 @@ fun RunCombiAppTopBar(
3941
IconButton(onClick = onBack) {
4042
StableImage(
4143
drawableResId = R.drawable.ic_back,
42-
modifier = Modifier.size(24.dp)
44+
modifier = Modifier.size(24.dp),
45+
tint = buttonTint
4346
)
4447
}
4548
} else {
@@ -60,7 +63,8 @@ fun RunCombiAppTopBar(
6063
IconButton(onClick = onClose) {
6164
StableImage(
6265
drawableResId = R.drawable.ic_close,
63-
modifier = Modifier.size(24.dp)
66+
modifier = Modifier.size(24.dp),
67+
tint = buttonTint
6468
)
6569
}
6670
} else {

feature/history/src/main/java/com/combo/runcombi/history/screen/RecordScreen.kt

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ fun RecordContent(
251251
profileUrl = uiState.memberImageUrl,
252252
name = uiState.nickname,
253253
cal = uiState.memberCal,
254-
description = getCalorieDescription(uiState.memberCal)
254+
description = getMemberCalorieDescription(uiState.memberCal),
255+
isPet = false
255256
)
256257
}
257258
item { Spacer(modifier = Modifier.height(12.dp)) }
@@ -260,7 +261,8 @@ fun RecordContent(
260261
profileUrl = petCalUi.petImageUrl,
261262
name = petCalUi.petName,
262263
cal = petCalUi.petCal,
263-
description = getCalorieDescription(petCalUi.petCal)
264+
description = getPetCalorieDescription(petCalUi.petCal),
265+
isPet = true
264266
)
265267
Spacer(modifier = Modifier.height(12.dp))
266268
}
@@ -509,6 +511,7 @@ fun CalorieProfileCard(
509511
name: String,
510512
cal: Int,
511513
description: String,
514+
isPet: Boolean = false,
512515
) {
513516
Card(
514517
modifier = Modifier
@@ -530,10 +533,10 @@ fun CalorieProfileCard(
530533
) {
531534
NetworkImage(
532535
imageUrl = profileUrl,
536+
drawableResId = if (isPet) R.drawable.ic_pet_defalut else R.drawable.person_profile,
533537
modifier = Modifier
534538
.size(47.dp)
535539
.clip(RoundedCornerShape(2.dp)),
536-
537540
contentScale = ContentScale.Crop
538541
)
539542
}
@@ -671,7 +674,7 @@ fun RecordMemoSection(memo: String, onMemoChanged: () -> Unit, onAddMemo: () ->
671674

672675
}
673676

674-
fun getCalorieDescription(cal: Int): String {
677+
fun getMemberCalorieDescription(cal: Int): String {
675678
return when (cal) {
676679
in 0..49 -> "조금 움직였어요!"
677680
in 50..99 -> "막대사탕 하나 태웠어요!"
@@ -696,6 +699,32 @@ fun getCalorieDescription(cal: Int): String {
696699
}
697700
}
698701

702+
fun getPetCalorieDescription(cal: Int): String {
703+
return when (cal) {
704+
in 0..9 -> "조금 움직였어요!"
705+
in 10..19 -> "사료 10알 태웠어요!"
706+
in 20..29 -> "사료 15알 태웠어요!"
707+
in 30..39 -> "사료 20알 태웠어요!"
708+
in 40..49 -> "사료 25알 태웠어요!"
709+
in 50..59 -> "사료 30알 태웠어요!"
710+
in 60..69 -> "사료 35알 태웠어요!"
711+
in 70..79 -> "사료 40알 태웠어요!"
712+
in 80..89 -> "사료 50알 태웠어요!"
713+
in 90..99 -> "사료 55알 태웠어요!"
714+
in 100..119 -> "사료 60알 태웠어요!"
715+
in 120..139 -> "사료 70알 태웠어요!"
716+
in 140..159 -> "사료 80알 태웠어요!"
717+
in 160..179 -> "사료 100알 태웠어요!"
718+
in 180..199 -> "사료 110알 태웠어요!"
719+
in 200..249 -> "사료 130알 태웠어요!"
720+
in 250..299 -> "사료 160알 태웠어요!"
721+
in 300..349 -> "사료 180알 태웠어요!"
722+
in 350..399 -> "사료 200알 태웠어요!"
723+
in 400..Int.MAX_VALUE -> "사료 한 줌 태웠어요!"
724+
else -> "사료 한 줌 태웠어요!"
725+
}
726+
}
727+
699728
@Preview(showBackground = true)
700729
@Composable
701730
fun PreviewRecordContent() {

feature/main/src/main/java/com/combo/runcombi/main/component/MainTabContent.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import com.combo.runcombi.main.navigation.MainNavigator
1414
import com.combo.runcombi.main.navigation.MainTabNavHost
1515
import com.combo.runcombi.main.navigation.MainTabNavigator
1616
import com.combo.runcombi.main.navigation.rememberMainTabNavigator
17+
import com.combo.runcombi.walk.navigation.navigateToWalkMain
1718

1819
@Composable
1920
fun MainTabContent(
@@ -34,7 +35,13 @@ fun MainTabContent(
3435
currentDestination = backStackEntryState.value?.destination,
3536
onTabClick = { mainTab ->
3637
when (mainTab) {
37-
MainTab.WALK -> mainTabNavigator.navigationToWalkMain()
38+
MainTab.WALK -> mainTabNavigator.navigationToWalkMain(navOptions {
39+
popUpTo(mainTabNavigator.navController.graph.id) {
40+
saveState = true
41+
}
42+
launchSingleTop = true
43+
restoreState = true
44+
})
3845
MainTab.HISTORY -> mainTabNavigator.navigationToHistory()
3946
MainTab.My -> mainTabNavigator.navigationToSettingMain()
4047
}

feature/main/src/main/java/com/combo/runcombi/main/navigation/MainTabNavHost.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.combo.runcombi.core.navigation.model.RouteModel
1010
import com.combo.runcombi.history.navigation.historyNavGraph
1111
import com.combo.runcombi.setting.navigation.navigateToSuggestion
1212
import com.combo.runcombi.setting.navigation.settingNavGraph
13+
import com.combo.runcombi.walk.navigation.navigateToWalkMain
1314
import com.combo.runcombi.walk.navigation.walkNavGraph
1415

1516
@Composable
@@ -61,6 +62,14 @@ fun MainTabNavHost(
6162
inclusive = false
6263
}
6364
})
65+
},
66+
onClose = {
67+
mainTabNavigator.navigationToWalkMain(navOptions = navOptions {
68+
popUpTo(RouteModel.MainTabRoute.WalkRouteModel.WalkMain) {
69+
inclusive = false
70+
}
71+
launchSingleTop = true
72+
})
6473
})
6574

6675
settingNavGraph(

feature/main/src/main/java/com/combo/runcombi/main/navigation/MainTabNavigator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ class MainTabNavigator(
111111
)
112112
}
113113

114-
fun navigationToWalkMain() {
115-
navController.navigateToWalkMain()
114+
fun navigationToWalkMain(navOptions: NavOptions? = null) {
115+
navController.navigateToWalkMain(navOptions)
116116
}
117117

118118
fun navigationToWalkTypeSelect() {

feature/setting/src/main/java/com/combo/runcombi/setting/screen/AnnouncementScreen.kt

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ fun TabItem(
158158
onClick: () -> Unit,
159159
modifier: Modifier = Modifier,
160160
) {
161-
Box(modifier = modifier
162-
.height(48.dp)
163-
.clickable { onClick() }
164-
.background(Grey01),
161+
Box(
162+
modifier = modifier
163+
.height(48.dp)
164+
.clickable { onClick() }
165+
.background(Grey01),
165166
contentAlignment = Alignment.Center) {
166167
Column(
167168
horizontalAlignment = Alignment.CenterHorizontally
@@ -227,14 +228,15 @@ fun EventList(
227228

228229
@Composable
229230
fun AnnouncementItem(
230-
announcement: com.combo.runcombi.setting.model.Announcement,
231+
announcement: Announcement,
231232
onClick: () -> Unit,
232233
) {
233-
Row(modifier = Modifier
234-
.fillMaxWidth()
235-
.height(88.dp)
236-
.clickable { onClick() }
237-
.padding(horizontal = 20.dp), verticalAlignment = Alignment.CenterVertically) {
234+
Row(
235+
modifier = Modifier
236+
.fillMaxWidth()
237+
.height(88.dp)
238+
.clickable { onClick() }
239+
.padding(horizontal = 20.dp), verticalAlignment = Alignment.CenterVertically) {
238240
Column(
239241
modifier = Modifier.weight(1f)
240242
) {
@@ -258,7 +260,13 @@ fun AnnouncementItem(
258260
Spacer(modifier = Modifier.height(4.dp))
259261

260262
Text(
261-
text = FormatUtils.formatDate(announcement.regDate), style = body3, color = Grey06
263+
text = if (announcement.announcementType == "NOTICE") FormatUtils.formatDate(
264+
announcement.regDate
265+
) else "${FormatUtils.formatDate(announcement.startDate)} ~ ${
266+
FormatUtils.formatDate(
267+
announcement.endDate
268+
)
269+
}", style = body3, color = Grey06
262270
)
263271
}
264272
}

feature/walk/src/main/java/com/combo/runcombi/walk/navigation/WalkNavigation.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ import com.combo.runcombi.walk.screen.WalkTypeSelectScreen
1818
import com.combo.runcombi.walk.viewmodel.WalkMainViewModel
1919

2020
fun NavController.navigateToWalkMain(
21-
navOptions: NavOptions? = androidx.navigation.navOptions {
22-
popUpTo(this@navigateToWalkMain.graph.id) {
23-
saveState = true
24-
}
25-
launchSingleTop = true
26-
restoreState = true
27-
},
21+
navOptions: NavOptions?,
2822
) {
2923
this.navigate(MainTabDataModel.Walk, navOptions)
3024
}
@@ -63,6 +57,7 @@ fun NavGraphBuilder.walkNavGraph(
6357
onCountdownFinished: () -> Unit,
6458
onFinish: () -> Unit,
6559
onBack: () -> Unit,
60+
onClose: () -> Unit,
6661
onNavigateToRecord: (Int) -> Unit,
6762
) {
6863
navigation<MainTabDataModel.Walk>(
@@ -95,6 +90,7 @@ fun NavGraphBuilder.walkNavGraph(
9590
composable<RouteModel.MainTabRoute.WalkRouteModel.WalkReady> {
9691
WalkReadyScreen(
9792
onBack = onBack,
93+
onClose = onClose,
9894
onCompleteReady = onCompleteReady,
9995
)
10096
}

feature/walk/src/main/java/com/combo/runcombi/walk/screen/WalkReadyScreen.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@ import com.combo.runcombi.ui.ext.clickableSingle
3232
@Composable
3333
fun WalkReadyScreen(
3434
onBack: () -> Unit,
35+
onClose: () -> Unit,
3536
onCompleteReady: () -> Unit,
3637
) {
3738
Column(modifier = Modifier.background(color = Grey01)) {
3839
RunCombiAppTopBar(
39-
isVisibleBackBtn = true, onBack = onBack
40+
isVisibleBackBtn = true,
41+
isVisibleCloseBtn = true,
42+
buttonTint = Color.White,
43+
onBack = onBack,
44+
onClose = onClose
4045
)
4146
Spacer(modifier = Modifier.height(50.dp))
4247
WalkReadyContent(onCompleteReady = onCompleteReady)
@@ -81,7 +86,7 @@ private fun WalkReadyContent(
8186
}
8287
}
8388

84-
@Preview(showBackground = true)
89+
@Preview(showBackground = true, backgroundColor = 0xFF1c1c1c)
8590
@Composable
8691
private fun WalkReadyContentPreview() {
8792
WalkReadyContent(

feature/walk/src/main/java/com/combo/runcombi/walk/screen/WalkResultScreen.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ fun WalkResultScreen(
182182
pathPoints = walkData.pathPoints,
183183
isFirstRun = startRunData?.isFirstRun == "Y",
184184
nthRun = startRunData?.nthRun ?: 0,
185-
onBack = onBack,
185+
onBack = {
186+
onNavigateToRecord(walkData.runData?.runId ?: 0)
187+
},
186188
showCaptureRequest = showCaptureRequest.value,
187189
onCaptured = { bitmap ->
188190
val file = BitmapUtil.bitmapToFile(

feature/walk/src/main/java/com/combo/runcombi/walk/screen/WalkTrackingScreen.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
@file:OptIn(
2-
ExperimentalFoundationApi::class, ExperimentalFoundationApi::class,
3-
ExperimentalFoundationApi::class, ExperimentalFoundationApi::class
4-
)
5-
61
package com.combo.runcombi.walk.screen
72

83
import android.annotation.SuppressLint
@@ -305,6 +300,7 @@ fun ResumeButton(onClick: () -> Unit) {
305300
}
306301
}
307302

303+
@OptIn(ExperimentalFoundationApi::class)
308304
@Composable
309305
fun FinishButtonLongPress(onLongClick: () -> Unit) {
310306
Box(

0 commit comments

Comments
 (0)