Compare commits

..
5 Commits
Author SHA1 Message Date
Sweetbread 7f613a2106 impr: show images in blogposts 2025-04-24 20:56:54 +03:00
Sweetbread 99effd1e52 deps: update 2025-04-24 20:56:54 +03:00
Sweetbread 764eedc837 impr: add animation 2025-04-24 20:56:53 +03:00
Sweetbread 90d1f69f0d impr: LoginActivity.kt
- Style changed
- Added loading indicator
- Added login/password validation
2025-04-24 20:56:53 +03:00
Sweetbread 7bfcb3d3c9 feat: add marked divider 2025-04-24 20:56:53 +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 getRel(): Float {
fun getRatio(): 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 rel by remember { mutableFloatStateOf(getRel()) }
var ratio by remember { mutableFloatStateOf(getRatio()) }
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)
rel = getRel()
ratio = getRatio()
}
}
@@ -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)