Compare commits

..
6 Commits
Author SHA1 Message Date
Sweetbread ec4ee64d68 fixup! impr: add animation 2025-04-24 16:51:54 +03:00
Sweetbread d0347426c3 impr: show images in blogposts 2025-04-23 23:23:08 +03:00
Sweetbread 6260796084 deps: update 2025-04-23 23:19:56 +03:00
Sweetbread 269781586a impr: add animation 2025-04-23 23:19:47 +03:00
Sweetbread b6eed728e3 impr: LoginActivity.kt
- Style changed
- Added loading indicator
- Added login/password validation
2025-04-23 23:19:34 +03:00
Sweetbread 3fcd4b013e feat: add marked divider 2025-04-23 23:19:34 +03:00
@@ -147,7 +147,7 @@ fun ScheduleDay(modifier: Modifier = Modifier, date: LocalDate) {
@Composable
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 end = LocalDateTime.of(unit.date, unit.end).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 end = unit.end.format(DateTimeFormatter.ofPattern("HH:mm"))
var ratio by remember { mutableFloatStateOf(getRatio()) }
var rel by remember { mutableFloatStateOf(getRel()) }
LaunchedEffect(Unit) {
while (true) {
@@ -170,7 +170,7 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
val millisUntilNextMinute = (60 - seconds) * 1000L - calendar.get(Calendar.MILLISECOND)
delay(millisUntilNextMinute)
ratio = getRatio()
rel = getRel()
}
}
@@ -283,7 +283,7 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
verticalAlignment = Alignment.CenterVertically) {
Text(begin.toString(), fontWeight = FontWeight.Bold)
AnimatedVisibility (
(0f <= rel) and (rel < 1f),
(0f < rel) and (rel < 1f),
modifier = Modifier
.weight(1f)
.padding(horizontal = 2.dp)