boilerplate_scene_scene_2.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "../malveke_gb_photo.h"
  2. #include "../helpers/boilerplate_custom_event.h"
  3. #include "../views/boilerplate_scene_2.h"
  4. void boilerplate_scene_2_callback(BoilerplateCustomEvent event, void* context) {
  5. furi_assert(context);
  6. Boilerplate* app = context;
  7. view_dispatcher_send_custom_event(app->view_dispatcher, event);
  8. }
  9. void boilerplate_scene_scene_2_on_enter(void* context) {
  10. furi_assert(context);
  11. Boilerplate* app = context;
  12. boilerplate_scene_2_set_callback(app->boilerplate_scene_2, boilerplate_scene_2_callback, app);
  13. view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdScene2);
  14. }
  15. bool boilerplate_scene_scene_2_on_event(void* context, SceneManagerEvent event) {
  16. Boilerplate* app = context;
  17. bool consumed = false;
  18. if(event.type == SceneManagerEventTypeCustom) {
  19. switch(event.event) {
  20. case BoilerplateCustomEventScene2Left:
  21. case BoilerplateCustomEventScene2Right:
  22. break;
  23. case BoilerplateCustomEventScene2Up:
  24. case BoilerplateCustomEventScene2Down:
  25. break;
  26. case BoilerplateCustomEventScene2Back:
  27. notification_message(app->notification, &sequence_reset_red);
  28. notification_message(app->notification, &sequence_reset_green);
  29. notification_message(app->notification, &sequence_reset_blue);
  30. if(!scene_manager_search_and_switch_to_previous_scene(
  31. app->scene_manager, BoilerplateSceneMenu)) {
  32. scene_manager_stop(app->scene_manager);
  33. view_dispatcher_stop(app->view_dispatcher);
  34. }
  35. consumed = true;
  36. break;
  37. }
  38. }
  39. return consumed;
  40. }
  41. void boilerplate_scene_scene_2_on_exit(void* context) {
  42. Boilerplate* app = context;
  43. UNUSED(app);
  44. }