Compare commits

..

6 Commits

Author SHA1 Message Date
ec4ee64d68 fixup! impr: add animation 2025-04-24 16:51:54 +03:00
d0347426c3
impr: show images in blogposts 2025-04-23 23:23:08 +03:00
6260796084
deps: update 2025-04-23 23:19:56 +03:00
269781586a
impr: add animation 2025-04-23 23:19:47 +03:00
b6eed728e3
impr: LoginActivity.kt
- Style changed
- Added loading indicator
- Added login/password validation
2025-04-23 23:19:34 +03:00
3fcd4b013e
feat: add marked divider 2025-04-23 23:19:34 +03:00

View File

@ -147,7 +147,7 @@ fun ScheduleDay(modifier: Modifier = Modifier, date: LocalDate) {
@Composable @Composable
fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Boolean = false) { fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Boolean = false) {
fun getRatio(): Float { fun getRel(): Float {
val begin = LocalDateTime.of(unit.date, unit.begin).atZone(ZoneId.of("Europe/Moscow")).toEpochSecond() val begin = LocalDateTime.of(unit.date, unit.begin).atZone(ZoneId.of("Europe/Moscow")).toEpochSecond()
val end = LocalDateTime.of(unit.date, unit.end).atZone(ZoneId.of("Europe/Moscow")).toEpochSecond() val end = LocalDateTime.of(unit.date, unit.end).atZone(ZoneId.of("Europe/Moscow")).toEpochSecond()
val now = LocalDateTime.now().atZone(ZoneId.of("Europe/Moscow")).toEpochSecond() val now = LocalDateTime.now().atZone(ZoneId.of("Europe/Moscow")).toEpochSecond()
@ -160,7 +160,7 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
val begin = unit.begin.format(DateTimeFormatter.ofPattern("HH:mm")) val begin = unit.begin.format(DateTimeFormatter.ofPattern("HH:mm"))
val end = unit.end.format(DateTimeFormatter.ofPattern("HH:mm")) val end = unit.end.format(DateTimeFormatter.ofPattern("HH:mm"))
var ratio by remember { mutableFloatStateOf(getRatio()) } var rel by remember { mutableFloatStateOf(getRel()) }
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
while (true) { while (true) {
@ -170,7 +170,7 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
val millisUntilNextMinute = (60 - seconds) * 1000L - calendar.get(Calendar.MILLISECOND) val millisUntilNextMinute = (60 - seconds) * 1000L - calendar.get(Calendar.MILLISECOND)
delay(millisUntilNextMinute) delay(millisUntilNextMinute)
ratio = getRatio() rel = getRel()
} }
} }
@ -283,7 +283,7 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
verticalAlignment = Alignment.CenterVertically) { verticalAlignment = Alignment.CenterVertically) {
Text(begin.toString(), fontWeight = FontWeight.Bold) Text(begin.toString(), fontWeight = FontWeight.Bold)
AnimatedVisibility ( AnimatedVisibility (
(0f <= rel) and (rel < 1f), (0f < rel) and (rel < 1f),
modifier = Modifier modifier = Modifier
.weight(1f) .weight(1f)
.padding(horizontal = 2.dp) .padding(horizontal = 2.dp)