Some update UI 2

This commit is contained in:
2026-10-21 12:33:55 +03:00
parent e1019b18d3
commit 2a4e010b21
2 changed files with 28 additions and 23 deletions
@@ -218,9 +218,17 @@ fun ScheduleScreen(
val day = weekDays.getOrNull(page)
if (day == null ||
day.intervals.all { it.lessons.isEmpty() }
) {
val visibleIntervals = day?.intervals
?.withIndex()
?.filter { (_, slot) ->
slot.lessons.any { lesson ->
!lesson.subject.isNullOrBlank() ||
lesson.raw.isNotBlank()
}
}
.orEmpty()
if (visibleIntervals.isEmpty()) {
ScheduleEmptyDay()
} else {
val listState = rememberLazyListState()
@@ -228,21 +236,14 @@ fun ScheduleScreen(
LazyColumn(
state = listState,
modifier = Modifier.fillMaxSize(),
verticalArrangement =
Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(
top = 16.dp,
bottom = 24.dp
)
) {
items(
items = day.intervals.withIndex()
.filter { (_, slot) ->
slot.lessons.any { lesson ->
!lesson.subject.isNullOrBlank() ||
lesson.raw.isNotBlank()
}
},
items = visibleIntervals,
key = { it.index }
) { (slotIndex, slot) ->
LessonSlot(
@@ -24,7 +24,7 @@ internal fun ScheduleEmptyDay() {
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp)
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
Icon(
painter = painterResource(R.drawable.event_busy_24dp),
@@ -32,7 +32,10 @@ internal fun ScheduleEmptyDay() {
modifier = Modifier.size(48.dp),
tint = MaterialTheme.colorScheme.onSurfaceVariant
)
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(2.dp))
{
Text(
text = "Занятий нет",
style = MaterialTheme.typography.titleMedium
@@ -46,6 +49,7 @@ internal fun ScheduleEmptyDay() {
}
}
}
}
@Composable
internal fun ScheduleError(