metroflip_scene_about.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "../metroflip_i.h"
  2. #include <dolphin/dolphin.h>
  3. #include "../api/metroflip/metroflip_api.h"
  4. #define TAG "Metroflip:Scene:About"
  5. void metroflip_scene_about_on_enter(void* context) {
  6. Metroflip* app = context;
  7. Widget* widget = app->widget;
  8. dolphin_deed(DolphinDeedNfcReadSuccess);
  9. furi_string_reset(app->text_box_store);
  10. FuriString* str = furi_string_alloc();
  11. furi_string_printf(str, "\e#About:\n\n");
  12. furi_string_cat_printf(
  13. str,
  14. "Metroflip is a multi-protocol metro card reader app for the Flipper Zero, created by luu176, inspired by the Metrodroid project. It enables the parsing and analysis of metro cards from transit systems around the world, providing a proof-of-concept for exploring transit card data in a portable format.");
  15. widget_add_text_scroll_element(widget, 0, 0, 128, 64, furi_string_get_cstr(str));
  16. widget_add_button_element(
  17. widget, GuiButtonTypeRight, "Exit", metroflip_exit_widget_callback, app);
  18. furi_string_free(str);
  19. view_dispatcher_switch_to_view(app->view_dispatcher, MetroflipViewWidget);
  20. }
  21. bool metroflip_scene_about_on_event(void* context, SceneManagerEvent event) {
  22. Metroflip* app = context;
  23. bool consumed = false;
  24. if(event.type == SceneManagerEventTypeCustom) {
  25. if(event.event == GuiButtonTypeLeft) {
  26. consumed = scene_manager_previous_scene(app->scene_manager);
  27. }
  28. } else if(event.type == SceneManagerEventTypeBack) {
  29. scene_manager_search_and_switch_to_previous_scene(app->scene_manager, MetroflipSceneStart);
  30. consumed = true;
  31. }
  32. return consumed;
  33. }
  34. void metroflip_scene_about_on_exit(void* context) {
  35. Metroflip* app = context;
  36. widget_reset(app->widget);
  37. }