nfc_scene_not_implemented.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "../nfc_i.h"
  2. void nfc_scene_not_implemented_dialog_callback(DialogExResult result, void* context) {
  3. Nfc* nfc = (Nfc*)context;
  4. view_dispatcher_send_custom_event(nfc->view_dispatcher, result);
  5. }
  6. void nfc_scene_not_implemented_on_enter(void* context) {
  7. Nfc* nfc = (Nfc*)context;
  8. // TODO Set data from worker
  9. DialogEx* dialog_ex = nfc->dialog_ex;
  10. dialog_ex_set_left_button_text(dialog_ex, "Back");
  11. dialog_ex_set_header(dialog_ex, "Not implemented", 60, 24, AlignCenter, AlignCenter);
  12. dialog_ex_set_context(dialog_ex, nfc);
  13. dialog_ex_set_result_callback(dialog_ex, nfc_scene_not_implemented_dialog_callback);
  14. view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx);
  15. }
  16. bool nfc_scene_not_implemented_on_event(void* context, SceneManagerEvent event) {
  17. Nfc* nfc = (Nfc*)context;
  18. if(event.type == SceneManagerEventTypeCustom) {
  19. if(event.event == DialogExResultLeft) {
  20. return scene_manager_previous_scene(nfc->scene_manager);
  21. }
  22. }
  23. return false;
  24. }
  25. void nfc_scene_not_implemented_on_exit(void* context) {
  26. Nfc* nfc = (Nfc*)context;
  27. DialogEx* dialog_ex = nfc->dialog_ex;
  28. dialog_ex_set_header(dialog_ex, NULL, 0, 0, AlignCenter, AlignCenter);
  29. dialog_ex_set_text(dialog_ex, NULL, 0, 0, AlignCenter, AlignTop);
  30. dialog_ex_set_left_button_text(dialog_ex, NULL);
  31. dialog_ex_set_result_callback(dialog_ex, NULL);
  32. dialog_ex_set_context(dialog_ex, NULL);
  33. }