nfc_rfid_detector_scene_about.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #include "../nfc_rfid_detector_app_i.h"
  2. void nfc_rfid_detector_scene_about_widget_callback(
  3. GuiButtonType result,
  4. InputType type,
  5. void* context) {
  6. NfcRfidDetectorApp* app = context;
  7. if(type == InputTypeShort) {
  8. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  9. }
  10. }
  11. void nfc_rfid_detector_scene_about_on_enter(void* context) {
  12. NfcRfidDetectorApp* app = context;
  13. FuriString* temp_str;
  14. temp_str = furi_string_alloc();
  15. furi_string_printf(temp_str, "\e#%s\n", "Information");
  16. furi_string_cat_printf(temp_str, "Version: %s\n", NFC_RFID_DETECTOR_VERSION_APP);
  17. furi_string_cat_printf(temp_str, "Developed by: %s\n", NFC_RFID_DETECTOR_DEVELOPED);
  18. furi_string_cat_printf(temp_str, "Github: %s\n\n", NFC_RFID_DETECTOR_GITHUB);
  19. furi_string_cat_printf(temp_str, "\e#%s\n", "Description");
  20. furi_string_cat_printf(
  21. temp_str,
  22. "This application allows\nyou to determine what\ntype of electromagnetic\nfield the reader is using.\nFor LF RFID you can also\nsee the carrier frequency\n\n");
  23. widget_add_text_box_element(
  24. app->widget,
  25. 0,
  26. 0,
  27. 128,
  28. 14,
  29. AlignCenter,
  30. AlignBottom,
  31. "\e#\e! \e!\n",
  32. false);
  33. widget_add_text_box_element(
  34. app->widget,
  35. 0,
  36. 2,
  37. 128,
  38. 14,
  39. AlignCenter,
  40. AlignBottom,
  41. "\e#\e! NFC/RFID detector \e!\n",
  42. false);
  43. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  44. furi_string_free(temp_str);
  45. view_dispatcher_switch_to_view(app->view_dispatcher, NfcRfidDetectorViewWidget);
  46. }
  47. bool nfc_rfid_detector_scene_about_on_event(void* context, SceneManagerEvent event) {
  48. NfcRfidDetectorApp* app = context;
  49. bool consumed = false;
  50. UNUSED(app);
  51. UNUSED(event);
  52. return consumed;
  53. }
  54. void nfc_rfid_detector_scene_about_on_exit(void* context) {
  55. NfcRfidDetectorApp* app = context;
  56. // Clear views
  57. widget_reset(app->widget);
  58. }