fifth labwork fix
This commit is contained in:
parent
3cc69552b6
commit
0c373056e8
@ -9,7 +9,7 @@ data class Note(
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
val id: Int?,
|
||||
@ColumnInfo(name = "text")
|
||||
var Text: String,
|
||||
var text: String,
|
||||
) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
|
@ -61,12 +61,16 @@ fun AddNewEvent(navController: NavController, eventViewModel: EventViewModel) {
|
||||
|
||||
TextField(
|
||||
value = name,
|
||||
onValueChange = { name = it })
|
||||
onValueChange = { name = it },
|
||||
placeholder = {name = "Название события"})
|
||||
|
||||
TextField(
|
||||
value = date,
|
||||
onValueChange = { date = it })
|
||||
var event = Event(null, name, date)
|
||||
onValueChange = { date = it },
|
||||
placeholder = {date = "Дата"})
|
||||
val formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy")
|
||||
val current = date.format(formatter)
|
||||
var event = Event(null, name, current)
|
||||
Button(onClick = {
|
||||
coroutineScope.launch {
|
||||
context.createEvent(navController, eventViewModel, event)
|
||||
|
@ -103,11 +103,11 @@ import kotlinx.coroutines.launch
|
||||
Text("Регистрация", color = Color.Black)
|
||||
}
|
||||
}
|
||||
Row(verticalAlignment = Alignment.Bottom) {
|
||||
TextButton(onClick = {navController?.navigate(Screen.Report.route)}) {
|
||||
Text("Оставить отзыв", color = Color.Black)
|
||||
}
|
||||
}
|
||||
// Row(verticalAlignment = Alignment.Bottom) {
|
||||
// TextButton(onClick = {navController?.navigate(Screen.Report.route)}) {
|
||||
// Text("Оставить отзыв", color = Color.Black)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ fun MounthView(navController: NavHostController){
|
||||
Row {
|
||||
for (l: Event in list) {
|
||||
//val date = LocalDate.parse(l.Date.toString())
|
||||
Row(Modifier.padding(5.dp)) {
|
||||
Column(Modifier.padding(5.dp)) {
|
||||
Text(formattedString, color = Color.Blue)
|
||||
Text(l.Name, color = Color.Black)
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
@ -63,14 +64,15 @@ fun WeekView(navController: NavHostController, eventViewModel: EventViewModel)
|
||||
}
|
||||
var list = events.value
|
||||
|
||||
Column(Modifier.verticalScroll(state = rememberScrollState())) {
|
||||
Column(modifier = Modifier
|
||||
.verticalScroll(rememberScrollState()).fillMaxWidth()) {
|
||||
while (date <= endOfWeek) {
|
||||
val pattern = "yyyy-MM-dd"
|
||||
val simpleDateFormat = SimpleDateFormat(pattern)
|
||||
val daten = simpleDateFormat.format(date)
|
||||
Column {
|
||||
Row {
|
||||
Text(daten, fontSize = 5.em)
|
||||
Text(daten, fontSize = 6.em)
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
@ -89,7 +91,7 @@ fun WeekView(navController: NavHostController, eventViewModel: EventViewModel)
|
||||
}
|
||||
}
|
||||
else{
|
||||
Text(" пусто", fontSize = 7.em, fontStyle = FontStyle.Italic,
|
||||
Text(" пусто", fontSize = 5.em, fontStyle = FontStyle.Italic,
|
||||
color = Color.LightGray
|
||||
)
|
||||
}
|
||||
|
@ -9,7 +9,8 @@ import com.example.pmu_dozorova.room.repository.EventRepository
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class EventViewModel
|
||||
( private val eventRepository: EventRepository): ViewModel() {
|
||||
(
|
||||
private val eventRepository: EventRepository): ViewModel() {
|
||||
private val _events = MutableLiveData<List<Event>>()
|
||||
val events: LiveData<List<Event>> get() = _events
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user