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) val day = weekDays.getOrNull(page)
if (day == null || val visibleIntervals = day?.intervals
day.intervals.all { it.lessons.isEmpty() } ?.withIndex()
) { ?.filter { (_, slot) ->
slot.lessons.any { lesson ->
!lesson.subject.isNullOrBlank() ||
lesson.raw.isNotBlank()
}
}
.orEmpty()
if (visibleIntervals.isEmpty()) {
ScheduleEmptyDay() ScheduleEmptyDay()
} else { } else {
val listState = rememberLazyListState() val listState = rememberLazyListState()
@@ -228,21 +236,14 @@ fun ScheduleScreen(
LazyColumn( LazyColumn(
state = listState, state = listState,
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
verticalArrangement = verticalArrangement = Arrangement.spacedBy(12.dp),
Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues( contentPadding = PaddingValues(
top = 16.dp, top = 16.dp,
bottom = 24.dp bottom = 24.dp
) )
) { ) {
items( items(
items = day.intervals.withIndex() items = visibleIntervals,
.filter { (_, slot) ->
slot.lessons.any { lesson ->
!lesson.subject.isNullOrBlank() ||
lesson.raw.isNotBlank()
}
},
key = { it.index } key = { it.index }
) { (slotIndex, slot) -> ) { (slotIndex, slot) ->
LessonSlot( LessonSlot(
@@ -24,7 +24,7 @@ internal fun ScheduleEmptyDay() {
) { ) {
Column( Column(
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp) verticalArrangement = Arrangement.spacedBy(8.dp)
) { ) {
Icon( Icon(
painter = painterResource(R.drawable.event_busy_24dp), painter = painterResource(R.drawable.event_busy_24dp),
@@ -32,7 +32,10 @@ internal fun ScheduleEmptyDay() {
modifier = Modifier.size(48.dp), modifier = Modifier.size(48.dp),
tint = MaterialTheme.colorScheme.onSurfaceVariant tint = MaterialTheme.colorScheme.onSurfaceVariant
) )
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(2.dp))
{
Text( Text(
text = "Занятий нет", text = "Занятий нет",
style = MaterialTheme.typography.titleMedium style = MaterialTheme.typography.titleMedium
@@ -46,6 +49,7 @@ internal fun ScheduleEmptyDay() {
} }
} }
} }
}
@Composable @Composable
internal fun ScheduleError( internal fun ScheduleError(