Skip to content

Commit

Permalink
hideo-wear: Simple layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Mar 31, 2024
1 parent 38968da commit c5355bf
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions src/apps/hideo-wear/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,34 @@
namespace Hideo::Wear {

Ui::Child app() {
return Ui::text("Hello, world!") |
Ui::center() |
Ui::minSize(192);
auto [date, time] = DateTime{};
auto dateTime = Io::format(
// Mon. 28 Jul
"{}. {} {}",
date.month.abbr(),
date.dayOfMonth() + 1,
date.year.val()
);

auto clock = Ui::vflow(
16,
Layout::Align::CENTER,
Ui::displayMedium("{02}:{02}", time.hour, time.minute),
Ui::titleMedium(dateTime.unwrap())
);

return Ui::stack(
Ui::image(Media::loadImageOrFallback("bundle://skift-wallpapers/images/abstract.qoi"_url).unwrap()) | Ui::cover(),
clock | Ui::center()
) |
Ui::maxSize(192);
}

} // namespace Hideo::Wear

Res<> entryPoint(Sys::Ctx &ctx) {
return Ui::runApp(ctx, Hideo::Wear::app());
return Ui::runApp(
ctx,
Hideo::Wear::app()
);
}

0 comments on commit c5355bf

Please sign in to comment.