Код: Выделить всё
@Composable
fun createCard(diaryEntries: List, navController: NavController) {
LazyColumn(
modifier = Modifier.fillMaxSize()
) {
items(diaryEntries) { entry ->
OutlinedCard(
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surface,
),
border = BorderStroke(1.dp, Color.Black),
modifier = Modifier
.fillMaxWidth()
.height(100.dp)
.padding(horizontal = 16.dp, vertical = 8.dp)
.clickable {
navController.navigate("ViewDiaryEntry/${entry.id}")
}
) {
Row(
modifier = Modifier.fillMaxSize(),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = formatDate(entry.date),
fontSize = 25.sp,
fontWeight = FontWeight.Bold,
)
}
}
}
}
}
Код: Выделить всё
@Composable
fun ViewDiaryEntry(entry: DiaryEntry, navController: NavController){
val context = LocalContext.current
val sharedPreferences = context.getSharedPreferences("DiaryEntries", Context.MODE_PRIVATE)
Column {
AppBarForDiaryView(
title = "Diary Entry",
onBackPressed = {
navController.popBackStack()
}
)
ViewTheDetails(entry = entry)
}
}
Как это исправить?
Подробнее здесь: https://stackoverflow.com/questions/783 ... other-page