hex_viewer_scene_scene_2.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "../hex_viewer.h"
  2. #include "../helpers/hex_viewer_custom_event.h"
  3. #include "../helpers/hex_viewer_haptic.h"
  4. #include "../helpers/hex_viewer_led.h"
  5. #include "../views/hex_viewer_scene_2.h"
  6. void hex_viewer_scene_scene_2_on_enter(void* context) {
  7. furi_assert(context);
  8. HexViewer* app = context;
  9. FuriString* buffer;
  10. buffer = furi_string_alloc();
  11. furi_string_printf(
  12. buffer,
  13. "File path: %s\nFile size: %lu (0x%lX)",
  14. furi_string_get_cstr(app->file_path),
  15. app->model->file_size,
  16. app->model->file_size);
  17. DialogMessage* message = dialog_message_alloc();
  18. dialog_message_set_header(message, "Hex Viewer v2.0", 16, 2, AlignLeft, AlignTop);
  19. dialog_message_set_icon(message, &I_hex_10px, 3, 2);
  20. dialog_message_set_text(message, furi_string_get_cstr(buffer), 3, 16, AlignLeft, AlignTop);
  21. dialog_message_set_buttons(message, NULL, NULL, "Back");
  22. dialog_message_show(app->dialogs, message);
  23. furi_string_free(buffer);
  24. dialog_message_free(message);
  25. scene_manager_search_and_switch_to_previous_scene(
  26. app->scene_manager, HexViewerViewIdStartscreen);
  27. }
  28. bool hex_viewer_scene_scene_2_on_event(void* context, SceneManagerEvent event) {
  29. HexViewer* app = context;
  30. UNUSED(app);
  31. UNUSED(event);
  32. bool consumed = true;
  33. return consumed;
  34. }
  35. void hex_viewer_scene_scene_2_on_exit(void* context) {
  36. HexViewer* app = context;
  37. UNUSED(app);
  38. }