esubghz_chat_chat_box.c 1006 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "../esubghz_chat_i.h"
  2. /* Prepares the text box scene. */
  3. void scene_on_enter_chat_box(void* context)
  4. {
  5. FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_chat_box");
  6. furi_assert(context);
  7. ESubGhzChatState* state = context;
  8. text_box_reset(state->chat_box);
  9. text_box_set_text(state->chat_box,
  10. furi_string_get_cstr(state->chat_box_store));
  11. text_box_set_focus(state->chat_box, TextBoxFocusEnd);
  12. view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_ChatBox);
  13. }
  14. /* Handles scene manager events for the text box scene. No events are handled
  15. * here. */
  16. bool scene_on_event_chat_box(void* context, SceneManagerEvent event)
  17. {
  18. UNUSED(event);
  19. FURI_LOG_T(APPLICATION_NAME, "scene_on_event_chat_box");
  20. furi_assert(context);
  21. return false;
  22. }
  23. /* Cleans up the text box scene. */
  24. void scene_on_exit_chat_box(void* context)
  25. {
  26. FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_chat_box");
  27. furi_assert(context);
  28. ESubGhzChatState* state = context;
  29. text_box_reset(state->chat_box);
  30. }