#1 κ°μ
Nutri Capture νλ‘ νΈμλ - 'νΌμ' μμ΄μ½ μμ μ μ©
#1 컀μ€ν μμ΄μ½ μμ μ μ©#1-1 컀μ€ν μμ΄μ½ Nutri Capture νλ‘ νΈμλ - 'νΌμ' μμ΄μ½ ꡬν#1 κ°μ#1-1 μ§κΈκΉμ§μ μ¬μ Nutri Capture νλ‘ νΈμλ - 컀μ€ν BottomSheetScaffold κ°λ° μ μ#1 κ°μ#1-1 κ°λ° μ΄
kenel.tistory.com
μ κ²μκΈμμ λͺ»λ€ν λΆλΆμ ꡬννλ€.
#2 μ½λ μ€λν«
#2-1 NutritionBottomSheet.kt
...
@Composable
fun NutrientBottomSheet(
viewModel: NutrientViewModel = hiltViewModel()
) {
val inputtedDayMeal = viewModel.nutrientScreenState.collectAsState().value.inputtedDayMeal
val nutritionInfo = inputtedDayMeal.nutritionInfo
val maxLevel = 5
LazyVerticalGrid(
columns = GridCells.Adaptive(minSize = 100.dp),
modifier = Modifier.fillMaxSize(),
contentPadding = PaddingValues(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
horizontalArrangement = Arrangement.SpaceBetween
) {
items(
nutritionInfo.toMutableMap().toList()
) { nutritionDetailMap ->
val nutritionKey = nutritionDetailMap.first
val nutritionDetail = nutritionDetailMap.second
Column(
modifier = Modifier
.fillMaxSize()
.border(width = 1.dp, color = Color.Black),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
ResponsiveArcSurroundedIconButton(
imageVector = ImageVector.vectorResource(id = nutritionDetail.iconId),
contentDescription = nutritionDetail.name,
currentLevel = nutritionDetail.value,
maxLevel = maxLevel,
arcColor = Color.Yellow,
arcWidth = 15
) {
viewModel.onEvent(
NutrientViewModelEvent.UpdateInputtedDayMeal(
inputtedDayMeal.copy(
nutritionInfo = nutritionInfo.updateNutritionDetail(nutritionKey) {
if (nutritionDetail.value < maxLevel) {
nutritionDetail.value + 1
} else {
0
}
}
)
)
)
}
Spacer(modifier = Modifier.height(4.dp))
Text(
text = nutritionDetail.name,
style = MaterialTheme.typography.labelLarge
)
}
}
}
}
μ¬κΈ°μμ 리ν©ν λ§ν NutritionInfoμ getter λ° setterλ₯Ό νμ©νλ€.
#2-2 μλ νμΈ - μ€ν¬λ¦°μ·

#2-3 μλ νμΈ - App Inspection

DBμ μ μ μ₯λ λͺ¨μ΅μ΄λ€.
#3 λ€μ λ°©ν₯
λ μμκ² λ§λ€κ³ μΆμ§λ§, 그건 μ΅μ’ μ μΌλ‘ λ€λ¬μ λ νλ©΄ λλ€. λ€μ μμ μ, BottomSheetλ₯Ό λμ μΌλ‘ λ΄λ¦¬κ±°λ μ¬λ¦¬κ² λ§λ€ κ²μ΄λ€. κ°λ¨ν μ μ€μΌμ΄μ€λ μλμ κ°λ€.
- μ¬μ©μλ μλ μ°λ μννΈ ν€λ³΄λλ‘ μλ¨μ μ΄λ¦μ μ μ
- 'λ€μ' λ²νΌ ν΄λ¦ μ μννΈ ν€λ³΄λλ λ΄λ €κ°κ³ #2-2μ μλ 'NutritionBottomSheet'κ° μ¬λΌμ΄
- 'NutritionBottomSheet'λ₯Ό ν΅ν΄ μμ μ 보λ₯Ό μ λ ₯
- 'μ μΆ' λ²νΌ ν΄λ¦ μ DBμ μλ¨μ΄ μ μ₯λ¨
'λ€μ' λ²νΌμ΄λ 'μ μΆ' λ²νΌμ λ°λ‘ ꡬλΆλ 2κ°μ λ²νΌμ΄ μλ νλμ λ²νΌμ΄λ€. λ²νΌμ κ·Έλλ‘ λκ³ μ μ€μΌμ΄μ€ λ¨κ³ λ³λ‘ μμ΄μ½λ§ λ°λκ² λ§λ€ κ²μ΄λ€.
#4 μμ±λ μ±
#4-1 μ΄ κ²μκΈ μμ μ Commit
GitHub - Kanmanemone/nutri-capture-new
Contribute to Kanmanemone/nutri-capture-new development by creating an account on GitHub.
github.com
#4-2 λ³Έ νλ‘μ νΈμ κ°μ₯ μ΅μ Commit
GitHub - Kanmanemone/nutri-capture-new
Contribute to Kanmanemone/nutri-capture-new development by creating an account on GitHub.
github.com
'κ°λ° μΌμ§ π» > Nutri Capture' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
Nutri Capture λ°±μλ - NutritionInfo 리ν©ν λ§ (0) | 2025.03.26 |
---|---|
Nutri Capture νλ‘ νΈμλ - 'νΌμ' μμ΄μ½ μμ μ μ© (0) | 2025.03.25 |
Nutri Capture νλ‘ νΈμλ - 'νΌμ' μμ΄μ½ ꡬν (0) | 2025.03.20 |
Nutri Capture νλ‘ νΈμλ - 컀μ€ν BottomSheetScaffold κ°λ° μ μ (0) | 2025.03.19 |
Nutri Capture λ°±μλ - Hilt λμ (0) | 2025.02.01 |