lfrfid_scene_raw_success.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "../lfrfid_i.h"
  2. void lfrfid_scene_raw_success_on_enter(void* context) {
  3. LfRfid* app = context;
  4. Widget* widget = app->widget;
  5. widget_add_button_element(widget, GuiButtonTypeCenter, "OK", lfrfid_widget_callback, app);
  6. widget_add_string_multiline_element(
  7. widget,
  8. 0,
  9. 1,
  10. AlignLeft,
  11. AlignTop,
  12. FontSecondary,
  13. "RAW RFID read success!\nNow you can analyze files\nOr send them to developers");
  14. view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewWidget);
  15. }
  16. bool lfrfid_scene_raw_success_on_event(void* context, SceneManagerEvent event) {
  17. LfRfid* app = context;
  18. SceneManager* scene_manager = app->scene_manager;
  19. bool consumed = false;
  20. if(event.type == SceneManagerEventTypeCustom) {
  21. consumed = true;
  22. if(event.event == GuiButtonTypeCenter) {
  23. scene_manager_search_and_switch_to_previous_scene(
  24. scene_manager, LfRfidSceneExtraActions);
  25. }
  26. }
  27. return consumed;
  28. }
  29. void lfrfid_scene_raw_success_on_exit(void* context) {
  30. LfRfid* app = context;
  31. widget_reset(app->widget);
  32. }