implement journal view skelleton
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user