mirror of
https://github.com/bleackstorm/satiea.git
synced 2026-12-03 07:41:56 +01:00
Set up Android project configuration, Gradle build scripts, typography, and default resource assets.
634 lines
25 KiB
Kotlin
634 lines
25 KiB
Kotlin
package com.example.ui.journal
|
||
|
||
import android.graphics.Bitmap
|
||
import androidx.compose.foundation.Image
|
||
import androidx.compose.foundation.background
|
||
import androidx.compose.foundation.clickable
|
||
import androidx.compose.foundation.layout.Arrangement
|
||
import androidx.compose.foundation.layout.Box
|
||
import androidx.compose.foundation.layout.Column
|
||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||
import androidx.compose.foundation.layout.FlowRow
|
||
import androidx.compose.foundation.layout.PaddingValues
|
||
import androidx.compose.foundation.layout.Row
|
||
import androidx.compose.foundation.layout.Spacer
|
||
import androidx.compose.foundation.layout.fillMaxSize
|
||
import androidx.compose.foundation.layout.fillMaxWidth
|
||
import androidx.compose.foundation.layout.height
|
||
import androidx.compose.foundation.layout.padding
|
||
import androidx.compose.foundation.layout.size
|
||
import androidx.compose.foundation.layout.width
|
||
import androidx.compose.foundation.lazy.LazyColumn
|
||
import androidx.compose.foundation.lazy.LazyRow
|
||
import androidx.compose.foundation.lazy.items
|
||
import androidx.compose.foundation.shape.CircleShape
|
||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||
import androidx.compose.material.icons.Icons
|
||
import androidx.compose.material.icons.filled.Add
|
||
import androidx.compose.material.icons.filled.CalendarMonth
|
||
import androidx.compose.material.icons.filled.Delete
|
||
import androidx.compose.material.icons.filled.Edit
|
||
import androidx.compose.material.icons.filled.FileDownload
|
||
import androidx.compose.material.icons.filled.MoreVert
|
||
import androidx.compose.material.icons.filled.Restaurant
|
||
import androidx.compose.material3.AlertDialog
|
||
import androidx.compose.material3.Card
|
||
import androidx.compose.material3.CardDefaults
|
||
import androidx.compose.material3.CircularProgressIndicator
|
||
import androidx.compose.material3.DropdownMenu
|
||
import androidx.compose.material3.DropdownMenuItem
|
||
import androidx.compose.material3.FloatingActionButton
|
||
import androidx.compose.material3.Icon
|
||
import androidx.compose.material3.IconButton
|
||
import androidx.compose.material3.MaterialTheme
|
||
import androidx.compose.material3.Surface
|
||
import androidx.compose.material3.Text
|
||
import androidx.compose.material3.TextButton
|
||
import androidx.compose.runtime.Composable
|
||
import androidx.compose.runtime.getValue
|
||
import androidx.compose.runtime.mutableStateOf
|
||
import androidx.compose.runtime.remember
|
||
import androidx.compose.runtime.setValue
|
||
import androidx.compose.ui.Alignment
|
||
import androidx.compose.ui.Modifier
|
||
import androidx.compose.ui.draw.clip
|
||
import androidx.compose.ui.graphics.asImageBitmap
|
||
import androidx.compose.ui.layout.ContentScale
|
||
import androidx.compose.ui.platform.testTag
|
||
import androidx.compose.ui.text.font.FontWeight
|
||
import androidx.compose.ui.text.style.TextAlign
|
||
import androidx.compose.ui.unit.dp
|
||
import com.example.data.model.HungerSatietyScale
|
||
import com.example.data.model.MealEntry
|
||
import com.example.data.model.MealType
|
||
import com.example.util.ImageUtils
|
||
import java.text.SimpleDateFormat
|
||
import java.util.Calendar
|
||
import java.util.Date
|
||
import java.util.Locale
|
||
|
||
@Composable
|
||
fun JournalScreen(
|
||
mealsUiState: MealsUiState,
|
||
onAddMealClick: () -> Unit,
|
||
onEditMeal: (MealEntry) -> Unit,
|
||
onDeleteMeal: (String) -> Unit,
|
||
onExportCsvClick: (List<MealEntry>) -> Unit
|
||
) {
|
||
Box(
|
||
modifier = Modifier
|
||
.fillMaxSize()
|
||
.background(MaterialTheme.colorScheme.background)
|
||
) {
|
||
when (mealsUiState) {
|
||
is MealsUiState.Loading -> {
|
||
Box(
|
||
modifier = Modifier.fillMaxSize(),
|
||
contentAlignment = Alignment.Center
|
||
) {
|
||
CircularProgressIndicator(
|
||
color = MaterialTheme.colorScheme.primary,
|
||
modifier = Modifier.testTag("journal_loading_indicator")
|
||
)
|
||
}
|
||
}
|
||
|
||
is MealsUiState.Error -> {
|
||
Box(
|
||
modifier = Modifier
|
||
.fillMaxSize()
|
||
.padding(24.dp),
|
||
contentAlignment = Alignment.Center
|
||
) {
|
||
Text(
|
||
text = mealsUiState.message,
|
||
color = MaterialTheme.colorScheme.error,
|
||
style = MaterialTheme.typography.bodyMedium,
|
||
textAlign = TextAlign.Center
|
||
)
|
||
}
|
||
}
|
||
|
||
is MealsUiState.Success -> {
|
||
val meals = mealsUiState.meals
|
||
val todayCalendar = Calendar.getInstance().apply {
|
||
set(Calendar.HOUR_OF_DAY, 0)
|
||
set(Calendar.MINUTE, 0)
|
||
set(Calendar.SECOND, 0)
|
||
set(Calendar.MILLISECOND, 0)
|
||
}
|
||
val todayStartMillis = todayCalendar.timeInMillis
|
||
val todayEndMillis = todayStartMillis + (24L * 60 * 60 * 1000) - 1
|
||
val todayMeals = meals.filter { it.mealTimestamp in todayStartMillis..todayEndMillis }
|
||
|
||
LazyColumn(
|
||
modifier = Modifier
|
||
.fillMaxSize()
|
||
.testTag("journal_meals_list"),
|
||
contentPadding = PaddingValues(
|
||
start = 20.dp,
|
||
end = 20.dp,
|
||
top = 16.dp,
|
||
bottom = 96.dp
|
||
),
|
||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||
) {
|
||
item {
|
||
DailyOverviewCard(todayMeals = todayMeals)
|
||
}
|
||
|
||
if (meals.isEmpty()) {
|
||
item {
|
||
EmptyMealsView(onAddMealClick = onAddMealClick)
|
||
}
|
||
} else {
|
||
item {
|
||
Row(
|
||
modifier = Modifier
|
||
.fillMaxWidth()
|
||
.padding(top = 6.dp),
|
||
horizontalArrangement = Arrangement.SpaceBetween,
|
||
verticalAlignment = Alignment.CenterVertically
|
||
) {
|
||
Text(
|
||
text = "Historique des repas (${meals.size})",
|
||
style = MaterialTheme.typography.titleMedium,
|
||
color = MaterialTheme.colorScheme.onBackground,
|
||
fontWeight = FontWeight.Bold
|
||
)
|
||
|
||
TextButton(
|
||
onClick = { onExportCsvClick(meals) },
|
||
modifier = Modifier.testTag("journal_export_csv_button")
|
||
) {
|
||
Icon(
|
||
imageVector = Icons.Default.FileDownload,
|
||
contentDescription = "Exporter en CSV",
|
||
modifier = Modifier.size(18.dp),
|
||
tint = MaterialTheme.colorScheme.primary
|
||
)
|
||
Spacer(modifier = Modifier.width(6.dp))
|
||
Text(
|
||
text = "Export CSV",
|
||
style = MaterialTheme.typography.labelLarge,
|
||
color = MaterialTheme.colorScheme.primary
|
||
)
|
||
}
|
||
}
|
||
}
|
||
|
||
items(meals, key = { it.id.ifEmpty { it.mealTimestamp.toString() } }) { meal ->
|
||
MealCardItem(
|
||
meal = meal,
|
||
onEdit = { onEditMeal(meal) },
|
||
onDelete = { onDeleteMeal(meal.id) }
|
||
)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
FloatingActionButton(
|
||
onClick = onAddMealClick,
|
||
modifier = Modifier
|
||
.align(Alignment.BottomEnd)
|
||
.padding(24.dp)
|
||
.testTag("add_meal_fab"),
|
||
containerColor = MaterialTheme.colorScheme.primary,
|
||
contentColor = MaterialTheme.colorScheme.onPrimary,
|
||
shape = CircleShape
|
||
) {
|
||
Icon(
|
||
imageVector = Icons.Default.Add,
|
||
contentDescription = "Ajouter un repas",
|
||
modifier = Modifier.size(28.dp)
|
||
)
|
||
}
|
||
}
|
||
}
|
||
|
||
@Composable
|
||
private fun DailyOverviewCard(todayMeals: List<MealEntry>) {
|
||
val dateFormat = remember { SimpleDateFormat("EEEE d MMMM", Locale.FRENCH) }
|
||
val todayFormatted = remember {
|
||
dateFormat.format(Date()).replaceFirstChar {
|
||
if (it.isLowerCase()) it.titlecase(Locale.FRENCH) else it.toString()
|
||
}
|
||
}
|
||
|
||
val avgSatiety = if (todayMeals.isNotEmpty()) {
|
||
todayMeals.map { it.satietyAfter }.average().toFloat()
|
||
} else 0f
|
||
|
||
val comfortStatus = when {
|
||
todayMeals.isEmpty() -> "En attente du premier repas"
|
||
avgSatiety in 5.5f..8.2f -> "Zone de confort optimale (6–8/10) ✨"
|
||
avgSatiety > 8.2f -> "Tendance aux repas très copieux (>8/10)"
|
||
else -> "Sensations de faim encore présentes (<6/10)"
|
||
}
|
||
|
||
Card(
|
||
modifier = Modifier
|
||
.fillMaxWidth()
|
||
.testTag("daily_overview_card"),
|
||
shape = RoundedCornerShape(22.dp),
|
||
colors = CardDefaults.cardColors(
|
||
containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.7f)
|
||
)
|
||
) {
|
||
Column(
|
||
modifier = Modifier
|
||
.fillMaxWidth()
|
||
.padding(20.dp)
|
||
) {
|
||
Row(
|
||
modifier = Modifier.fillMaxWidth(),
|
||
horizontalArrangement = Arrangement.SpaceBetween,
|
||
verticalAlignment = Alignment.CenterVertically
|
||
) {
|
||
Text(
|
||
text = todayFormatted,
|
||
style = MaterialTheme.typography.titleMedium,
|
||
color = MaterialTheme.colorScheme.onSurface,
|
||
fontWeight = FontWeight.Bold
|
||
)
|
||
|
||
Surface(
|
||
shape = RoundedCornerShape(12.dp),
|
||
color = MaterialTheme.colorScheme.primary.copy(alpha = 0.2f)
|
||
) {
|
||
Text(
|
||
text = "${todayMeals.size} repas aujourd'hui",
|
||
style = MaterialTheme.typography.labelSmall,
|
||
color = MaterialTheme.colorScheme.primary,
|
||
modifier = Modifier.padding(horizontal = 10.dp, vertical = 5.dp),
|
||
fontWeight = FontWeight.SemiBold
|
||
)
|
||
}
|
||
}
|
||
|
||
Spacer(modifier = Modifier.height(14.dp))
|
||
|
||
Row(
|
||
modifier = Modifier.fillMaxWidth(),
|
||
horizontalArrangement = Arrangement.SpaceBetween,
|
||
verticalAlignment = Alignment.Bottom
|
||
) {
|
||
Column {
|
||
Text(
|
||
text = "Satiété moyenne aujourd'hui",
|
||
style = MaterialTheme.typography.bodySmall,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||
)
|
||
Spacer(modifier = Modifier.height(4.dp))
|
||
Text(
|
||
text = if (todayMeals.isNotEmpty()) String.format(Locale.FRENCH, "%.1f / 10", avgSatiety) else "— / 10",
|
||
style = MaterialTheme.typography.displayMedium,
|
||
color = MaterialTheme.colorScheme.primary,
|
||
fontWeight = FontWeight.Bold
|
||
)
|
||
}
|
||
|
||
Text(
|
||
text = comfortStatus,
|
||
style = MaterialTheme.typography.labelSmall,
|
||
color = MaterialTheme.colorScheme.secondary,
|
||
fontWeight = FontWeight.Medium,
|
||
textAlign = TextAlign.End,
|
||
modifier = Modifier.width(160.dp)
|
||
)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
@OptIn(ExperimentalLayoutApi::class)
|
||
@Composable
|
||
private fun MealCardItem(
|
||
meal: MealEntry,
|
||
onEdit: () -> Unit,
|
||
onDelete: () -> Unit
|
||
) {
|
||
var showMenu by remember { mutableStateOf(false) }
|
||
var showDeleteDialog by remember { mutableStateOf(false) }
|
||
val dateTimeFormat = remember { SimpleDateFormat("EEE d MMM yyyy • HH:mm", Locale.FRENCH) }
|
||
val mealType = MealType.fromString(meal.mealType)
|
||
val parsedFoods = remember(meal.foodItemsSerialized) { meal.parsedFoodItems() }
|
||
|
||
Card(
|
||
modifier = Modifier
|
||
.fillMaxWidth()
|
||
.clickable { onEdit() }
|
||
.testTag("meal_card_${meal.id}"),
|
||
shape = RoundedCornerShape(20.dp),
|
||
colors = CardDefaults.cardColors(
|
||
containerColor = MaterialTheme.colorScheme.surface
|
||
)
|
||
) {
|
||
Column(
|
||
modifier = Modifier
|
||
.fillMaxWidth()
|
||
.padding(18.dp)
|
||
) {
|
||
// Top row: Type, Date & Time, Options
|
||
Row(
|
||
modifier = Modifier.fillMaxWidth(),
|
||
horizontalArrangement = Arrangement.SpaceBetween,
|
||
verticalAlignment = Alignment.CenterVertically
|
||
) {
|
||
Row(
|
||
verticalAlignment = Alignment.CenterVertically,
|
||
modifier = Modifier.weight(1f)
|
||
) {
|
||
Surface(
|
||
shape = RoundedCornerShape(10.dp),
|
||
color = MaterialTheme.colorScheme.primaryContainer
|
||
) {
|
||
Text(
|
||
text = mealType.displayName,
|
||
style = MaterialTheme.typography.labelMedium,
|
||
color = MaterialTheme.colorScheme.onPrimaryContainer,
|
||
modifier = Modifier.padding(horizontal = 10.dp, vertical = 4.dp),
|
||
fontWeight = FontWeight.SemiBold
|
||
)
|
||
}
|
||
|
||
Spacer(modifier = Modifier.width(10.dp))
|
||
|
||
Row(
|
||
verticalAlignment = Alignment.CenterVertically,
|
||
modifier = Modifier
|
||
.clip(RoundedCornerShape(8.dp))
|
||
.clickable { onEdit() }
|
||
.padding(horizontal = 6.dp, vertical = 4.dp)
|
||
) {
|
||
Icon(
|
||
imageVector = Icons.Default.CalendarMonth,
|
||
contentDescription = "Modifier la date",
|
||
tint = MaterialTheme.colorScheme.primary,
|
||
modifier = Modifier.size(14.dp)
|
||
)
|
||
Spacer(modifier = Modifier.width(4.dp))
|
||
Text(
|
||
text = dateTimeFormat.format(Date(meal.mealTimestamp)).replaceFirstChar {
|
||
if (it.isLowerCase()) it.titlecase(Locale.FRENCH) else it.toString()
|
||
},
|
||
style = MaterialTheme.typography.bodySmall,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||
)
|
||
}
|
||
}
|
||
|
||
Box {
|
||
IconButton(
|
||
onClick = { showMenu = true },
|
||
modifier = Modifier.size(32.dp)
|
||
) {
|
||
Icon(
|
||
imageVector = Icons.Default.MoreVert,
|
||
contentDescription = "Options du repas",
|
||
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||
)
|
||
}
|
||
|
||
DropdownMenu(
|
||
expanded = showMenu,
|
||
onDismissRequest = { showMenu = false }
|
||
) {
|
||
DropdownMenuItem(
|
||
text = { Text("Corriger date / aliments / note") },
|
||
leadingIcon = { Icon(Icons.Default.Edit, contentDescription = null) },
|
||
onClick = {
|
||
showMenu = false
|
||
onEdit()
|
||
}
|
||
)
|
||
DropdownMenuItem(
|
||
text = { Text("Supprimer", color = MaterialTheme.colorScheme.error) },
|
||
leadingIcon = {
|
||
Icon(
|
||
Icons.Default.Delete,
|
||
contentDescription = null,
|
||
tint = MaterialTheme.colorScheme.error
|
||
)
|
||
},
|
||
onClick = {
|
||
showMenu = false
|
||
showDeleteDialog = true
|
||
}
|
||
)
|
||
}
|
||
}
|
||
}
|
||
|
||
Spacer(modifier = Modifier.height(14.dp))
|
||
|
||
// Dual Gauge: Hunger /10 -> Satiety /10
|
||
Row(
|
||
modifier = Modifier
|
||
.fillMaxWidth()
|
||
.background(
|
||
color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.4f),
|
||
shape = RoundedCornerShape(14.dp)
|
||
)
|
||
.padding(horizontal = 14.dp, vertical = 10.dp),
|
||
horizontalArrangement = Arrangement.SpaceBetween,
|
||
verticalAlignment = Alignment.CenterVertically
|
||
) {
|
||
Column(modifier = Modifier.weight(1f)) {
|
||
Text(
|
||
text = "Faim avant",
|
||
style = MaterialTheme.typography.labelSmall,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||
)
|
||
Text(
|
||
text = "${meal.hungerBefore} / 10",
|
||
style = MaterialTheme.typography.titleMedium,
|
||
color = MaterialTheme.colorScheme.secondary,
|
||
fontWeight = FontWeight.Bold
|
||
)
|
||
Text(
|
||
text = HungerSatietyScale.getHungerLabel(meal.hungerBefore),
|
||
style = MaterialTheme.typography.bodySmall,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||
)
|
||
}
|
||
|
||
Text(
|
||
text = "→",
|
||
style = MaterialTheme.typography.titleMedium,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||
modifier = Modifier.padding(horizontal = 8.dp)
|
||
)
|
||
|
||
Column(
|
||
modifier = Modifier.weight(1f),
|
||
horizontalAlignment = Alignment.End
|
||
) {
|
||
Text(
|
||
text = "Satiété après",
|
||
style = MaterialTheme.typography.labelSmall,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||
)
|
||
Text(
|
||
text = "${meal.satietyAfter} / 10",
|
||
style = MaterialTheme.typography.titleMedium,
|
||
color = MaterialTheme.colorScheme.primary,
|
||
fontWeight = FontWeight.Bold
|
||
)
|
||
Text(
|
||
text = HungerSatietyScale.getSatietyLabel(meal.satietyAfter),
|
||
style = MaterialTheme.typography.bodySmall,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||
textAlign = TextAlign.End
|
||
)
|
||
}
|
||
}
|
||
|
||
// Food Items Badges (with optional weights)
|
||
if (parsedFoods.isNotEmpty()) {
|
||
Spacer(modifier = Modifier.height(12.dp))
|
||
Text(
|
||
text = "Composition de l'assiette",
|
||
style = MaterialTheme.typography.labelSmall,
|
||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||
)
|
||
Spacer(modifier = Modifier.height(6.dp))
|
||
FlowRow(
|
||
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||
modifier = Modifier.fillMaxWidth()
|
||
) {
|
||
parsedFoods.forEach { food ->
|
||
Surface(
|
||
shape = RoundedCornerShape(10.dp),
|
||
color = MaterialTheme.colorScheme.primary.copy(alpha = 0.14f)
|
||
) {
|
||
Text(
|
||
text = food.displayBadge(),
|
||
style = MaterialTheme.typography.labelMedium,
|
||
color = MaterialTheme.colorScheme.primary,
|
||
fontWeight = FontWeight.Medium,
|
||
modifier = Modifier.padding(horizontal = 10.dp, vertical = 5.dp)
|
||
)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// Photos Carousel
|
||
if (meal.photosBase64.isNotEmpty()) {
|
||
Spacer(modifier = Modifier.height(14.dp))
|
||
LazyRow(
|
||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||
) {
|
||
items(meal.photosBase64) { b64 ->
|
||
val bitmap: Bitmap? = remember(b64) { ImageUtils.base64ToBitmap(b64) }
|
||
if (bitmap != null) {
|
||
Image(
|
||
bitmap = bitmap.asImageBitmap(),
|
||
contentDescription = "Photo assiette",
|
||
modifier = Modifier
|
||
.size(76.dp)
|
||
.clip(RoundedCornerShape(12.dp)),
|
||
contentScale = ContentScale.Crop
|
||
)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// Global Note
|
||
if (meal.note.isNotBlank()) {
|
||
Spacer(modifier = Modifier.height(12.dp))
|
||
Text(
|
||
text = "Note globale : « ${meal.note} »",
|
||
style = MaterialTheme.typography.bodyMedium,
|
||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.9f),
|
||
fontStyle = androidx.compose.ui.text.font.FontStyle.Italic
|
||
)
|
||
}
|
||
}
|
||
}
|
||
|
||
if (showDeleteDialog) {
|
||
AlertDialog(
|
||
onDismissRequest = { showDeleteDialog = false },
|
||
title = { Text("Supprimer ce repas ?") },
|
||
text = { Text("Cette action est irréversible et supprimera le repas de votre historique synchronisé.") },
|
||
confirmButton = {
|
||
TextButton(
|
||
onClick = {
|
||
showDeleteDialog = false
|
||
onDelete()
|
||
}
|
||
) {
|
||
Text("Supprimer", color = MaterialTheme.colorScheme.error)
|
||
}
|
||
},
|
||
dismissButton = {
|
||
TextButton(onClick = { showDeleteDialog = false }) {
|
||
Text("Annuler")
|
||
}
|
||
}
|
||
)
|
||
}
|
||
}
|
||
|
||
@Composable
|
||
private fun EmptyMealsView(onAddMealClick: () -> Unit) {
|
||
Column(
|
||
modifier = Modifier
|
||
.fillMaxWidth()
|
||
.padding(vertical = 40.dp, horizontal = 20.dp),
|
||
horizontalAlignment = Alignment.CenterHorizontally
|
||
) {
|
||
Surface(
|
||
modifier = Modifier.size(80.dp),
|
||
shape = CircleShape,
|
||
color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.5f)
|
||
) {
|
||
Box(contentAlignment = Alignment.Center) {
|
||
Icon(
|
||
imageVector = Icons.Default.Restaurant,
|
||
contentDescription = null,
|
||
tint = MaterialTheme.colorScheme.primary,
|
||
modifier = Modifier.size(38.dp)
|
||
)
|
||
}
|
||
}
|
||
|
||
Spacer(modifier = Modifier.height(20.dp))
|
||
|
||
Text(
|
||
text = "Aucun repas pour le moment",
|
||
style = MaterialTheme.typography.titleMedium,
|
||
color = MaterialTheme.colorScheme.onBackground,
|
||
fontWeight = FontWeight.Bold
|
||
)
|
||
|
||
Spacer(modifier = Modifier.height(8.dp))
|
||
|
||
Text(
|
||
text = "Prenez 15 secondes pour noter vos aliments (avec ou sans poids), votre faim et votre satiété sur 10.",
|
||
style = MaterialTheme.typography.bodyMedium,
|
||
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.7f),
|
||
textAlign = TextAlign.Center
|
||
)
|
||
|
||
Spacer(modifier = Modifier.height(20.dp))
|
||
|
||
TextButton(
|
||
onClick = onAddMealClick,
|
||
modifier = Modifier.testTag("empty_state_add_button")
|
||
) {
|
||
Text(
|
||
text = "+ Noter mon premier repas",
|
||
style = MaterialTheme.typography.titleSmall,
|
||
color = MaterialTheme.colorScheme.primary
|
||
)
|
||
}
|
||
}
|
||
}
|