uv_meter_scene_about.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "uv_meter_app_i.hpp"
  2. #define UV_METER_VERSION_APP FAP_VERSION
  3. #define UV_METER_DEVELOPER "Michael Baisch"
  4. #define UV_METER_GITHUB "https://github.com/michaelbaisch/uv_meter"
  5. #define UV_METER_NAME "\e#\e! UV Meter \e!\n"
  6. #define UV_METER_BLANK_INV "\e#\e! \e!\n"
  7. void uv_meter_scene_about_on_enter(void* context) {
  8. furi_assert(context);
  9. auto* app = static_cast<UVMeterApp*>(context);
  10. widget_reset(app->widget);
  11. FuriString* tmp_string = furi_string_alloc();
  12. widget_add_text_box_element(
  13. app->widget, 0, 0, 128, 14, AlignCenter, AlignBottom, UV_METER_BLANK_INV, false);
  14. widget_add_text_box_element(
  15. app->widget, 0, 2, 128, 14, AlignCenter, AlignBottom, UV_METER_NAME, false);
  16. furi_string_printf(tmp_string, "\e#Information\n");
  17. furi_string_cat_printf(tmp_string, "Version: %s\n", UV_METER_VERSION_APP);
  18. furi_string_cat_printf(tmp_string, "Developed by: %s\n", UV_METER_DEVELOPER);
  19. furi_string_cat_printf(tmp_string, "Github: %s\n\n", UV_METER_GITHUB);
  20. furi_string_cat_str(tmp_string, "\e#Description\n");
  21. furi_string_cat_str(tmp_string, "Measure UV radiation using\n");
  22. furi_string_cat_str(tmp_string, "the AS7331 sensor.\n");
  23. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(tmp_string));
  24. furi_string_free(tmp_string);
  25. view_dispatcher_switch_to_view(app->view_dispatcher, UVMeterViewWidget);
  26. }
  27. bool uv_meter_scene_about_on_event(void* context, SceneManagerEvent event) {
  28. UNUSED(context);
  29. UNUSED(event);
  30. return false;
  31. }
  32. void uv_meter_scene_about_on_exit(void* context) {
  33. furi_assert(context);
  34. auto* app = static_cast<UVMeterApp*>(context);
  35. widget_reset(app->widget);
  36. }