nfc_scene_file_select.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <nfc/scenes/nfc_scene_file_select.h>
  2. #include <furi.h>
  3. #include "../nfc_i.h"
  4. const void nfc_scene_file_select_on_enter(void* context) {
  5. Nfc* nfc = (Nfc*)context;
  6. // Process file_select return
  7. if(nfc_file_select(&nfc->device)) {
  8. view_dispatcher_add_scene(nfc->nfc_common.view_dispatcher, nfc->scene_saved_menu);
  9. view_dispatcher_send_navigation_event(
  10. nfc->nfc_common.view_dispatcher, ViewNavigatorEventNext);
  11. } else {
  12. view_dispatcher_send_back_search_scene_event(
  13. nfc->nfc_common.view_dispatcher, NfcSceneStart);
  14. }
  15. }
  16. const bool nfc_scene_file_select_on_event(void* context, uint32_t event) {
  17. return false;
  18. }
  19. const void nfc_scene_file_select_on_exit(void* context) {
  20. }
  21. AppScene* nfc_scene_file_select_alloc() {
  22. AppScene* scene = furi_alloc(sizeof(AppScene));
  23. scene->id = NfcSceneFileSelect;
  24. scene->on_enter = nfc_scene_file_select_on_enter;
  25. scene->on_event = nfc_scene_file_select_on_event;
  26. scene->on_exit = nfc_scene_file_select_on_exit;
  27. return scene;
  28. }
  29. void nfc_scene_file_select_free(AppScene* scene) {
  30. free(scene);
  31. }