Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
403 changes: 403 additions & 0 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId = "com.combo.runcombi"
minSdk = 26
targetSdk = 35
versionCode = 106
versionName = "1.0.6"
versionCode = 107
versionName = "1.0.7"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -25,6 +26,7 @@ fun RunCombiAppTopBar(
title: String = "",
onBack: () -> Unit = {},
onClose: () -> Unit = {},
buttonTint: Color? = null,
isVisibleBackBtn: Boolean = true,
isVisibleCloseBtn: Boolean = false,
padding: PaddingValues = PaddingValues(horizontal = 20.dp, vertical = 8.dp),
Expand All @@ -39,7 +41,8 @@ fun RunCombiAppTopBar(
IconButton(onClick = onBack) {
StableImage(
drawableResId = R.drawable.ic_back,
modifier = Modifier.size(24.dp)
modifier = Modifier.size(24.dp),
tint = buttonTint
)
}
} else {
Expand All @@ -60,7 +63,8 @@ fun RunCombiAppTopBar(
IconButton(onClick = onClose) {
StableImage(
drawableResId = R.drawable.ic_close,
modifier = Modifier.size(24.dp)
modifier = Modifier.size(24.dp),
tint = buttonTint
)
}
} else {
Expand Down
Binary file added docs/images/slack_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ fun RecordContent(
profileUrl = uiState.memberImageUrl,
name = uiState.nickname,
cal = uiState.memberCal,
description = getCalorieDescription(uiState.memberCal)
description = getMemberCalorieDescription(uiState.memberCal),
isPet = false
)
}
item { Spacer(modifier = Modifier.height(12.dp)) }
Expand All @@ -260,7 +261,8 @@ fun RecordContent(
profileUrl = petCalUi.petImageUrl,
name = petCalUi.petName,
cal = petCalUi.petCal,
description = getCalorieDescription(petCalUi.petCal)
description = getPetCalorieDescription(petCalUi.petCal),
isPet = true
)
Spacer(modifier = Modifier.height(12.dp))
}
Expand Down Expand Up @@ -509,6 +511,7 @@ fun CalorieProfileCard(
name: String,
cal: Int,
description: String,
isPet: Boolean = false,
) {
Card(
modifier = Modifier
Expand All @@ -530,10 +533,10 @@ fun CalorieProfileCard(
) {
NetworkImage(
imageUrl = profileUrl,
drawableResId = if (isPet) R.drawable.ic_pet_defalut else R.drawable.person_profile,
modifier = Modifier
.size(47.dp)
.clip(RoundedCornerShape(2.dp)),

contentScale = ContentScale.Crop
)
}
Expand Down Expand Up @@ -671,7 +674,7 @@ fun RecordMemoSection(memo: String, onMemoChanged: () -> Unit, onAddMemo: () ->

}

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

fun getPetCalorieDescription(cal: Int): String {
return when (cal) {
in 0..9 -> "조금 움직였어요!"
in 10..19 -> "사료 10알 태웠어요!"
in 20..29 -> "사료 15알 태웠어요!"
in 30..39 -> "사료 20알 태웠어요!"
in 40..49 -> "사료 25알 태웠어요!"
in 50..59 -> "사료 30알 태웠어요!"
in 60..69 -> "사료 35알 태웠어요!"
in 70..79 -> "사료 40알 태웠어요!"
in 80..89 -> "사료 50알 태웠어요!"
in 90..99 -> "사료 55알 태웠어요!"
in 100..119 -> "사료 60알 태웠어요!"
in 120..139 -> "사료 70알 태웠어요!"
in 140..159 -> "사료 80알 태웠어요!"
in 160..179 -> "사료 100알 태웠어요!"
in 180..199 -> "사료 110알 태웠어요!"
in 200..249 -> "사료 130알 태웠어요!"
in 250..299 -> "사료 160알 태웠어요!"
in 300..349 -> "사료 180알 태웠어요!"
in 350..399 -> "사료 200알 태웠어요!"
in 400..Int.MAX_VALUE -> "사료 한 줌 태웠어요!"
else -> "사료 한 줌 태웠어요!"
}
}

@Preview(showBackground = true)
@Composable
fun PreviewRecordContent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.combo.runcombi.main.navigation.MainNavigator
import com.combo.runcombi.main.navigation.MainTabNavHost
import com.combo.runcombi.main.navigation.MainTabNavigator
import com.combo.runcombi.main.navigation.rememberMainTabNavigator
import com.combo.runcombi.walk.navigation.navigateToWalkMain

@Composable
fun MainTabContent(
Expand All @@ -34,7 +35,13 @@ fun MainTabContent(
currentDestination = backStackEntryState.value?.destination,
onTabClick = { mainTab ->
when (mainTab) {
MainTab.WALK -> mainTabNavigator.navigationToWalkMain()
MainTab.WALK -> mainTabNavigator.navigationToWalkMain(navOptions {
popUpTo(mainTabNavigator.navController.graph.id) {
saveState = true
}
launchSingleTop = true
restoreState = true
})
MainTab.HISTORY -> mainTabNavigator.navigationToHistory()
MainTab.My -> mainTabNavigator.navigationToSettingMain()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.combo.runcombi.core.navigation.model.RouteModel
import com.combo.runcombi.history.navigation.historyNavGraph
import com.combo.runcombi.setting.navigation.navigateToSuggestion
import com.combo.runcombi.setting.navigation.settingNavGraph
import com.combo.runcombi.walk.navigation.navigateToWalkMain
import com.combo.runcombi.walk.navigation.walkNavGraph

@Composable
Expand Down Expand Up @@ -61,6 +62,14 @@ fun MainTabNavHost(
inclusive = false
}
})
},
onClose = {
mainTabNavigator.navigationToWalkMain(navOptions = navOptions {
popUpTo(RouteModel.MainTabRoute.WalkRouteModel.WalkMain) {
inclusive = false
}
launchSingleTop = true
})
})

settingNavGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class MainTabNavigator(
)
}

fun navigationToWalkMain() {
navController.navigateToWalkMain()
fun navigationToWalkMain(navOptions: NavOptions? = null) {
navController.navigateToWalkMain(navOptions)
}

fun navigationToWalkTypeSelect() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ fun TabItem(
onClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Box(modifier = modifier
.height(48.dp)
.clickable { onClick() }
.background(Grey01),
Box(
modifier = modifier
.height(48.dp)
.clickable { onClick() }
.background(Grey01),
contentAlignment = Alignment.Center) {
Column(
horizontalAlignment = Alignment.CenterHorizontally
Expand Down Expand Up @@ -227,14 +228,15 @@ fun EventList(

@Composable
fun AnnouncementItem(
announcement: com.combo.runcombi.setting.model.Announcement,
announcement: Announcement,
onClick: () -> Unit,
) {
Row(modifier = Modifier
.fillMaxWidth()
.height(88.dp)
.clickable { onClick() }
.padding(horizontal = 20.dp), verticalAlignment = Alignment.CenterVertically) {
Row(
modifier = Modifier
.fillMaxWidth()
.height(88.dp)
.clickable { onClick() }
.padding(horizontal = 20.dp), verticalAlignment = Alignment.CenterVertically) {
Column(
modifier = Modifier.weight(1f)
) {
Expand All @@ -258,7 +260,13 @@ fun AnnouncementItem(
Spacer(modifier = Modifier.height(4.dp))

Text(
text = FormatUtils.formatDate(announcement.regDate), style = body3, color = Grey06
text = if (announcement.announcementType == "NOTICE") FormatUtils.formatDate(
announcement.regDate
) else "${FormatUtils.formatDate(announcement.startDate)} ~ ${
FormatUtils.formatDate(
announcement.endDate
)
}", style = body3, color = Grey06
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ import com.combo.runcombi.walk.screen.WalkTypeSelectScreen
import com.combo.runcombi.walk.viewmodel.WalkMainViewModel

fun NavController.navigateToWalkMain(
navOptions: NavOptions? = androidx.navigation.navOptions {
popUpTo(this@navigateToWalkMain.graph.id) {
saveState = true
}
launchSingleTop = true
restoreState = true
},
navOptions: NavOptions?,
) {
this.navigate(MainTabDataModel.Walk, navOptions)
}
Expand Down Expand Up @@ -63,6 +57,7 @@ fun NavGraphBuilder.walkNavGraph(
onCountdownFinished: () -> Unit,
onFinish: () -> Unit,
onBack: () -> Unit,
onClose: () -> Unit,
onNavigateToRecord: (Int) -> Unit,
) {
navigation<MainTabDataModel.Walk>(
Expand Down Expand Up @@ -95,6 +90,7 @@ fun NavGraphBuilder.walkNavGraph(
composable<RouteModel.MainTabRoute.WalkRouteModel.WalkReady> {
WalkReadyScreen(
onBack = onBack,
onClose = onClose,
onCompleteReady = onCompleteReady,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ import com.combo.runcombi.ui.ext.clickableSingle
@Composable
fun WalkReadyScreen(
onBack: () -> Unit,
onClose: () -> Unit,
onCompleteReady: () -> Unit,
) {
Column(modifier = Modifier.background(color = Grey01)) {
RunCombiAppTopBar(
isVisibleBackBtn = true, onBack = onBack
isVisibleBackBtn = true,
isVisibleCloseBtn = true,
buttonTint = Color.White,
onBack = onBack,
onClose = onClose
)
Spacer(modifier = Modifier.height(50.dp))
WalkReadyContent(onCompleteReady = onCompleteReady)
Expand Down Expand Up @@ -81,7 +86,7 @@ private fun WalkReadyContent(
}
}

@Preview(showBackground = true)
@Preview(showBackground = true, backgroundColor = 0xFF1c1c1c)
@Composable
private fun WalkReadyContentPreview() {
WalkReadyContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ fun WalkResultScreen(
pathPoints = walkData.pathPoints,
isFirstRun = startRunData?.isFirstRun == "Y",
nthRun = startRunData?.nthRun ?: 0,
onBack = onBack,
onBack = {
onNavigateToRecord(walkData.runData?.runId ?: 0)
},
showCaptureRequest = showCaptureRequest.value,
onCaptured = { bitmap ->
val file = BitmapUtil.bitmapToFile(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
@file:OptIn(
ExperimentalFoundationApi::class, ExperimentalFoundationApi::class,
ExperimentalFoundationApi::class, ExperimentalFoundationApi::class
)

package com.combo.runcombi.walk.screen

import android.annotation.SuppressLint
Expand Down Expand Up @@ -305,6 +300,7 @@ fun ResumeButton(onClick: () -> Unit) {
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun FinishButtonLongPress(onLongClick: () -> Unit) {
Box(
Expand Down
Loading