[FL-867] GUI: ViewPort arrangement API, better input and draw dispatching (#333)

* Input: refactoring, platform agnostic key configuration, update usage across project. Minor queue usage fixes and tick timings.
* Gui: lighter and more efficient input and draw call dispatching, ViewPort rearranging API. View: conditional model updates, API usage update.
* BT: smaller update delay
* GUI: ViewPort visibility check
This commit is contained in:
あく
2021-02-10 12:06:29 +03:00
committed by GitHub
parent 928bca4eaa
commit 2d09b8e318
18 changed files with 299 additions and 199 deletions

View File

@@ -9,12 +9,15 @@ bool dolphin_view_first_start_input(InputEvent* event, void* context) {
with_view_model(
dolphin->idle_view_first_start, (DolphinViewFirstStartModel * model) {
if(model->page > 0) model->page--;
return true;
});
} else if(event->key == InputKeyRight) {
uint32_t page;
with_view_model(
dolphin->idle_view_first_start,
(DolphinViewFirstStartModel * model) { page = ++model->page; });
dolphin->idle_view_first_start, (DolphinViewFirstStartModel * model) {
page = ++model->page;
return true;
});
if(page > 8) {
dolphin_save(dolphin);
view_dispatcher_switch_to_view(dolphin->idle_view_dispatcher, DolphinViewIdleMain);
@@ -140,6 +143,7 @@ void dolphin_task() {
dolphin->idle_view_stats, (DolphinViewIdleStatsModel * model) {
model->icounter = dolphin_state_get_icounter(dolphin->state);
model->butthurt = dolphin_state_get_butthurt(dolphin->state);
return true;
});
furi_record_create("dolphin", dolphin);
@@ -153,6 +157,7 @@ void dolphin_task() {
dolphin->idle_view_stats, (DolphinViewIdleStatsModel * model) {
model->icounter = dolphin_state_get_icounter(dolphin->state);
model->butthurt = dolphin_state_get_butthurt(dolphin->state);
return true;
});
} else if(event.type == DolphinEventTypeSave) {
dolphin_state_save(dolphin->state);