Navigated back handing base
This commit is contained in:
@@ -99,6 +99,9 @@ impl NavigatedPage<DictionaryMessage> for DictionaryState {
|
|||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DictionaryState {
|
impl DictionaryState {
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ impl NavigatedPage<DictionaryQuizMessage> for DictionaryQuizState {
|
|||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DictionaryQuizState {
|
impl DictionaryQuizState {
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ impl NavigatedPage<HistoryMessage> for HistoryState {
|
|||||||
Back => Some(Page::PreviousPage),
|
Back => Some(Page::PreviousPage),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HistoryState {
|
impl HistoryState {
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ macro_rules! message_navigation {
|
|||||||
|
|
||||||
pub trait NavigatedPage<T> {
|
pub trait NavigatedPage<T> {
|
||||||
fn navigate(&self, message: &T) -> Option<Page>;
|
fn navigate(&self, message: &T) -> Option<Page>;
|
||||||
|
fn navigated(&mut self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait KeyPressedPage {
|
pub trait KeyPressedPage {
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ impl NavigatedPage<QuizMessage> for QuizState {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl QuizState {
|
impl QuizState {
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ impl NavigatedPage<RandomizerMessage> for RandomizerState {
|
|||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for RandomizerState {
|
impl Default for RandomizerState {
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ impl NavigatedPage<RepetitionMessage> for RepetitionState {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RepetitionState {
|
impl RepetitionState {
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ impl NavigatedPage<RepetitionSettingsMessage> for RepetitionSettingsState {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RepetitionSettingsState {
|
impl RepetitionSettingsState {
|
||||||
|
|||||||
+8
-1
@@ -58,6 +58,10 @@ impl NavigatedPage<RepetitionsMessage> for RepetitionsState {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
self.selected_set = None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RepetitionsState {
|
impl RepetitionsState {
|
||||||
@@ -273,9 +277,12 @@ impl RepetitionsState {
|
|||||||
|
|
||||||
if let Some(history) = history {
|
if let Some(history) = history {
|
||||||
for (date, activity) in history {
|
for (date, activity) in history {
|
||||||
let distance = *date - now;
|
let distance = now - *date;
|
||||||
let index = counts.len() as i64 - distance.num_days() - 1;
|
let index = counts.len() as i64 - distance.num_days() - 1;
|
||||||
|
|
||||||
|
if index == 210 {
|
||||||
|
println!("invalid index")
|
||||||
|
}
|
||||||
if index < 0 {
|
if index < 0 {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ impl NavigatedPage<SelectorMessage> for SelectorState {
|
|||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SelectorState {
|
impl SelectorState {
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ impl NavigatedPage<SyncMessage> for SyncState {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SyncState {
|
impl SyncState {
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ impl NavigatedPage<WordMessage> for WordState {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WordState {
|
impl WordState {
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ impl NavigatedPage<WritingMessage> for WritingState {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn navigated(&mut self) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WritingState {
|
impl WritingState {
|
||||||
|
|||||||
Reference in New Issue
Block a user