implement journal view skelleton

This commit is contained in:
2026-08-18 19:53:56 +00:00
parent a089c3a1ec
commit b55b444db4
4 changed files with 54 additions and 1 deletions
+40
View File
@@ -0,0 +1,40 @@
use core::future;
use alloc::vec::Vec;
use embedded_graphics::pixelcolor::Rgb565;
use embedded_graphics::prelude::RgbColor;
use embedded_graphics_core::draw_target::DrawTarget;
use crate::{
card::model::Card,
display::primary_lcd::PrimaryLcdDisplay,
navigation::navigation::{Action, Navigable},
views::view::View,
};
#[derive(Debug, Clone)]
pub struct JournalView {
pub cards: Vec<Card>,
pub selected_card: usize,
}
impl Navigable for JournalView {
fn display(
&self,
display: &mut PrimaryLcdDisplay<'static>,
) -> impl core::future::Future<Output = ()> + Send {
display.clear(Rgb565::BLACK).unwrap();
core::future::ready(())
}
fn handle_input(&self, input: Action) -> impl core::future::Future<Output = View> + Send {
let new_menu = match input {
Action::Ok => View::Journal(self.clone()),
_ => View::Journal(self.clone()),
};
future::ready(new_menu)
}
}