Implemented Scan card menu
This commit was merged in pull request #29.
This commit is contained in:
@@ -7,10 +7,7 @@ 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,
|
||||
card::model::Card, display::primary_lcd::PrimaryLcdDisplay, navigation::navigation::{Action, Navigable, NewState}, views::view::View,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -29,12 +26,13 @@ impl Navigable for JournalView {
|
||||
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()),
|
||||
fn handle_input(&self, input: Action) -> impl core::future::Future<Output = NewState> + Send {
|
||||
let new_state = NewState {
|
||||
view: View::Journal(self.clone()),
|
||||
replace_view: true,
|
||||
redraw: !matches!(input, Action::Timer),
|
||||
};
|
||||
|
||||
future::ready(new_menu)
|
||||
future::ready(new_state)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user