QtRoS 2 лет назад
Родитель
Сommit
8f15b70192

+ 1 - 1
application.fam

@@ -13,6 +13,6 @@ App(
     fap_libs=["assets"],
     fap_icon="icons/hex_10px.png",
 	fap_icon_assets="icons",
-    fap_category="Misc",
+    fap_category="Tools",
 
 )

+ 25 - 25
helpers/hex_viewer_custom_event.h

@@ -1,30 +1,30 @@
 #pragma once
 
 typedef enum {
-    BoilerplateCustomEventStartscreenUp,
-    BoilerplateCustomEventStartscreenDown,
-    BoilerplateCustomEventStartscreenLeft,
-    BoilerplateCustomEventStartscreenRight,
-    BoilerplateCustomEventStartscreenOk,
-    BoilerplateCustomEventStartscreenBack,
-    BoilerplateCustomEventScene1Up,
-    BoilerplateCustomEventScene1Down,
-    BoilerplateCustomEventScene1Left,
-    BoilerplateCustomEventScene1Right,
-    BoilerplateCustomEventScene1Ok,
-    BoilerplateCustomEventScene1Back,
-    BoilerplateCustomEventScene2Up,
-    BoilerplateCustomEventScene2Down,
-    BoilerplateCustomEventScene2Left,
-    BoilerplateCustomEventScene2Right,
-    BoilerplateCustomEventScene2Ok,
-    BoilerplateCustomEventScene2Back,
-} BoilerplateCustomEvent;
+    HexViewerCustomEventStartscreenUp,
+    HexViewerCustomEventStartscreenDown,
+    HexViewerCustomEventStartscreenLeft,
+    HexViewerCustomEventStartscreenRight,
+    HexViewerCustomEventStartscreenOk,
+    HexViewerCustomEventStartscreenBack,
+    HexViewerCustomEventScene1Up,
+    HexViewerCustomEventScene1Down,
+    HexViewerCustomEventScene1Left,
+    HexViewerCustomEventScene1Right,
+    HexViewerCustomEventScene1Ok,
+    HexViewerCustomEventScene1Back,
+    HexViewerCustomEventScene2Up,
+    HexViewerCustomEventScene2Down,
+    HexViewerCustomEventScene2Left,
+    HexViewerCustomEventScene2Right,
+    HexViewerCustomEventScene2Ok,
+    HexViewerCustomEventScene2Back,
+} HexViewerCustomEvent;
 
-enum BoilerplateCustomEventType {
+enum HexViewerCustomEventType {
     // Reserve first 100 events for button types and indexes, starting from 0
-    BoilerplateCustomEventMenuVoid,
-    BoilerplateCustomEventMenuSelected,
+    HexViewerCustomEventMenuVoid,
+    HexViewerCustomEventMenuSelected,
 };
 
 #pragma pack(push, 1)
@@ -34,15 +34,15 @@ typedef union {
         uint16_t type;
         int16_t value;
     } content;
-} BoilerplateCustomEventMenu;
+} HexViewerCustomEventMenu;
 #pragma pack(pop)
 
 static inline uint32_t hex_viewer_custom_menu_event_pack(uint16_t type, int16_t value) {
-    BoilerplateCustomEventMenu event = {.content = {.type = type, .value = value}};
+    HexViewerCustomEventMenu event = {.content = {.type = type, .value = value}};
     return event.packed_value;
 }
 static inline void hex_viewer_custom_menu_event_unpack(uint32_t packed_value, uint16_t* type, int16_t* value) {
-    BoilerplateCustomEventMenu event = {.packed_value = packed_value};
+    HexViewerCustomEventMenu event = {.packed_value = packed_value};
     if(type) *type = event.content.type;
     if(value) *value = event.content.value;
 }

+ 3 - 3
helpers/hex_viewer_haptic.c

@@ -3,7 +3,7 @@
 
 
 void hex_viewer_play_happy_bump(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     if (app->haptic != 1) {
         return;
     }
@@ -13,7 +13,7 @@ void hex_viewer_play_happy_bump(void* context) {
 }
 
 void hex_viewer_play_bad_bump(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     if (app->haptic != 1) {
         return;
     }
@@ -23,7 +23,7 @@ void hex_viewer_play_bad_bump(void* context) {
 }
 
 void hex_viewer_play_long_bump(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     if (app->haptic != 1) {
         return;
     }

+ 2 - 2
helpers/hex_viewer_led.c

@@ -4,7 +4,7 @@
 
 
 void hex_viewer_led_set_rgb(void* context, int red, int green, int blue) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     if (app->led != 1) {
         return;
     }
@@ -30,7 +30,7 @@ void hex_viewer_led_set_rgb(void* context, int red, int green, int blue) {
 }
 
 void hex_viewer_led_reset(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     notification_message(app->notification, &sequence_reset_red);
     notification_message(app->notification, &sequence_reset_green);
     notification_message(app->notification, &sequence_reset_blue);

+ 2 - 2
helpers/hex_viewer_speaker.c

@@ -4,7 +4,7 @@
 #define NOTE_INPUT 587.33f
 
 void hex_viewer_play_input_sound(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     if (app->speaker != 1) {
         return;
     }
@@ -16,7 +16,7 @@ void hex_viewer_play_input_sound(void* context) {
 }
 
 void hex_viewer_stop_all_sound(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     if (app->speaker != 1) {
         return;
     }

+ 21 - 21
helpers/hex_viewer_storage.c

@@ -16,7 +16,7 @@ static void hex_viewer_close_config_file(FlipperFormat* file) {
 }
 
 void hex_viewer_save_settings(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     if (app->save_settings == 0) {
         return;
     }
@@ -26,13 +26,13 @@ void hex_viewer_save_settings(void* context) {
     FlipperFormat* fff_file = flipper_format_file_alloc(storage);
     
     // Overwrite wont work, so delete first
-    if(storage_file_exists(storage, BOILERPLATE_SETTINGS_SAVE_PATH)) {
-        storage_simply_remove(storage, BOILERPLATE_SETTINGS_SAVE_PATH);
+    if(storage_file_exists(storage, HEX_VIEWER_SETTINGS_SAVE_PATH)) {
+        storage_simply_remove(storage, HEX_VIEWER_SETTINGS_SAVE_PATH);
     }
 
     // Open File, create if not exists
-    if(!storage_common_stat(storage, BOILERPLATE_SETTINGS_SAVE_PATH, NULL) == FSE_OK) {
-        FURI_LOG_D(TAG, "Config file %s is not found. Will create new.", BOILERPLATE_SETTINGS_SAVE_PATH);
+    if(!storage_common_stat(storage, HEX_VIEWER_SETTINGS_SAVE_PATH, NULL) == FSE_OK) {
+        FURI_LOG_D(TAG, "Config file %s is not found. Will create new.", HEX_VIEWER_SETTINGS_SAVE_PATH);
         if(storage_common_stat(storage, CONFIG_FILE_DIRECTORY_PATH, NULL) == FSE_NOT_EXIST) {
             FURI_LOG_D(
                 TAG,
@@ -44,24 +44,24 @@ void hex_viewer_save_settings(void* context) {
         }
     }
 
-    if(!flipper_format_file_open_new(fff_file, BOILERPLATE_SETTINGS_SAVE_PATH)) {
+    if(!flipper_format_file_open_new(fff_file, HEX_VIEWER_SETTINGS_SAVE_PATH)) {
         //totp_close_config_file(fff_file);
-        FURI_LOG_E(TAG, "Error creating new file %s", BOILERPLATE_SETTINGS_SAVE_PATH);
+        FURI_LOG_E(TAG, "Error creating new file %s", HEX_VIEWER_SETTINGS_SAVE_PATH);
         hex_viewer_close_storage();
         return;
     }
     
     // Store Settings
     flipper_format_write_header_cstr(
-        fff_file, BOILERPLATE_SETTINGS_HEADER, BOILERPLATE_SETTINGS_FILE_VERSION);
+        fff_file, HEX_VIEWER_SETTINGS_HEADER, HEX_VIEWER_SETTINGS_FILE_VERSION);
     flipper_format_write_uint32(
-        fff_file, BOILERPLATE_SETTINGS_KEY_HAPTIC, &app->haptic, 1);
+        fff_file, HEX_VIEWER_SETTINGS_KEY_HAPTIC, &app->haptic, 1);
     flipper_format_write_uint32(
-        fff_file, BOILERPLATE_SETTINGS_KEY_SPEAKER, &app->speaker, 1);
+        fff_file, HEX_VIEWER_SETTINGS_KEY_SPEAKER, &app->speaker, 1);
     flipper_format_write_uint32(
-        fff_file, BOILERPLATE_SETTINGS_KEY_LED, &app->led, 1);
+        fff_file, HEX_VIEWER_SETTINGS_KEY_LED, &app->led, 1);
     flipper_format_write_uint32(
-        fff_file, BOILERPLATE_SETTINGS_KEY_SAVE_SETTINGS, &app->save_settings, 1);
+        fff_file, HEX_VIEWER_SETTINGS_KEY_SAVE_SETTINGS, &app->save_settings, 1);
     
     if(!flipper_format_rewind(fff_file)) {
         hex_viewer_close_config_file(fff_file);
@@ -75,11 +75,11 @@ void hex_viewer_save_settings(void* context) {
 }
 
 void hex_viewer_read_settings(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     Storage* storage = hex_viewer_open_storage();
     FlipperFormat* fff_file = flipper_format_file_alloc(storage);
 
-    if(storage_common_stat(storage, BOILERPLATE_SETTINGS_SAVE_PATH, NULL) != FSE_OK) {
+    if(storage_common_stat(storage, HEX_VIEWER_SETTINGS_SAVE_PATH, NULL) != FSE_OK) {
         hex_viewer_close_config_file(fff_file);
         hex_viewer_close_storage();
         return;
@@ -87,8 +87,8 @@ void hex_viewer_read_settings(void* context) {
     uint32_t file_version;
     FuriString* temp_str = furi_string_alloc();
 
-    if (!flipper_format_file_open_existing(fff_file, BOILERPLATE_SETTINGS_SAVE_PATH)) {
-        FURI_LOG_E(TAG, "Cannot open file %s", BOILERPLATE_SETTINGS_SAVE_PATH);
+    if (!flipper_format_file_open_existing(fff_file, HEX_VIEWER_SETTINGS_SAVE_PATH)) {
+        FURI_LOG_E(TAG, "Cannot open file %s", HEX_VIEWER_SETTINGS_SAVE_PATH);
         hex_viewer_close_config_file(fff_file);
         hex_viewer_close_storage();
         return;
@@ -101,17 +101,17 @@ void hex_viewer_read_settings(void* context) {
         return;
     }
 
-    if(file_version < BOILERPLATE_SETTINGS_FILE_VERSION) {
+    if(file_version < HEX_VIEWER_SETTINGS_FILE_VERSION) {
         FURI_LOG_I(TAG, "old config version, will be removed.");
         hex_viewer_close_config_file(fff_file);
         hex_viewer_close_storage();
         return;
     }
 
-    flipper_format_read_uint32(fff_file, BOILERPLATE_SETTINGS_KEY_HAPTIC, &app->haptic, 1);
-    flipper_format_read_uint32(fff_file, BOILERPLATE_SETTINGS_KEY_SPEAKER, &app->speaker, 1);
-    flipper_format_read_uint32(fff_file, BOILERPLATE_SETTINGS_KEY_LED, &app->led, 1);
-    flipper_format_read_uint32(fff_file, BOILERPLATE_SETTINGS_KEY_SAVE_SETTINGS, &app->save_settings, 1);
+    flipper_format_read_uint32(fff_file, HEX_VIEWER_SETTINGS_KEY_HAPTIC, &app->haptic, 1);
+    flipper_format_read_uint32(fff_file, HEX_VIEWER_SETTINGS_KEY_SPEAKER, &app->speaker, 1);
+    flipper_format_read_uint32(fff_file, HEX_VIEWER_SETTINGS_KEY_LED, &app->led, 1);
+    flipper_format_read_uint32(fff_file, HEX_VIEWER_SETTINGS_KEY_SAVE_SETTINGS, &app->save_settings, 1);
 
     flipper_format_rewind(fff_file);
 

+ 8 - 8
helpers/hex_viewer_storage.h

@@ -4,15 +4,15 @@
 #include <flipper_format/flipper_format_i.h>
 #include "../hex_viewer.h"
 
-#define BOILERPLATE_SETTINGS_FILE_VERSION 1
+#define HEX_VIEWER_SETTINGS_FILE_VERSION 1
 #define CONFIG_FILE_DIRECTORY_PATH EXT_PATH("apps_data/hex_viewer")
-#define BOILERPLATE_SETTINGS_SAVE_PATH CONFIG_FILE_DIRECTORY_PATH "/hex_viewer.conf"
-#define BOILERPLATE_SETTINGS_SAVE_PATH_TMP BOILERPLATE_SETTINGS_SAVE_PATH ".tmp"
-#define BOILERPLATE_SETTINGS_HEADER "Boilerplate Config File"
-#define BOILERPLATE_SETTINGS_KEY_HAPTIC "Haptic"
-#define BOILERPLATE_SETTINGS_KEY_LED "Led"
-#define BOILERPLATE_SETTINGS_KEY_SPEAKER "Speaker"
-#define BOILERPLATE_SETTINGS_KEY_SAVE_SETTINGS "SaveSettings"
+#define HEX_VIEWER_SETTINGS_SAVE_PATH CONFIG_FILE_DIRECTORY_PATH "/hex_viewer.conf"
+#define HEX_VIEWER_SETTINGS_SAVE_PATH_TMP HEX_VIEWER_SETTINGS_SAVE_PATH ".tmp"
+#define HEX_VIEWER_SETTINGS_HEADER "HexViewer Config File"
+#define HEX_VIEWER_SETTINGS_KEY_HAPTIC "Haptic"
+#define HEX_VIEWER_SETTINGS_KEY_LED "Led"
+#define HEX_VIEWER_SETTINGS_KEY_SPEAKER "Speaker"
+#define HEX_VIEWER_SETTINGS_KEY_SAVE_SETTINGS "SaveSettings"
 
 void hex_viewer_save_settings(void* context);
 void hex_viewer_read_settings(void* context);

+ 19 - 19
hex_viewer.c

@@ -2,25 +2,25 @@
 
 bool hex_viewer_custom_event_callback(void* context, uint32_t event) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     return scene_manager_handle_custom_event(app->scene_manager, event);
 }
 
 void hex_viewer_tick_event_callback(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     scene_manager_handle_tick_event(app->scene_manager);
 }
 
 //leave app if back button pressed
 bool hex_viewer_navigation_event_callback(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     return scene_manager_handle_back_event(app->scene_manager);
 }
 
-Boilerplate* hex_viewer_app_alloc() {
-    Boilerplate* app = malloc(sizeof(Boilerplate));
+HexViewer* hex_viewer_app_alloc() {
+    HexViewer* app = malloc(sizeof(HexViewer));
     app->gui = furi_record_open(RECORD_GUI);
     app->notification = furi_record_open(RECORD_NOTIFICATION);
     
@@ -51,35 +51,35 @@ Boilerplate* hex_viewer_app_alloc() {
     // Load configs
     hex_viewer_read_settings(app);
 
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdMenu, submenu_get_view(app->submenu));
+    view_dispatcher_add_view(app->view_dispatcher, HexViewerViewIdMenu, submenu_get_view(app->submenu));
     app->hex_viewer_startscreen = hex_viewer_startscreen_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdStartscreen, hex_viewer_startscreen_get_view(app->hex_viewer_startscreen));
+    view_dispatcher_add_view(app->view_dispatcher, HexViewerViewIdStartscreen, hex_viewer_startscreen_get_view(app->hex_viewer_startscreen));
     app->hex_viewer_scene_1 = hex_viewer_scene_1_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdScene1, hex_viewer_scene_1_get_view(app->hex_viewer_scene_1));
+    view_dispatcher_add_view(app->view_dispatcher, HexViewerViewIdScene1, hex_viewer_scene_1_get_view(app->hex_viewer_scene_1));
     app->hex_viewer_scene_2 = hex_viewer_scene_2_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdScene2, hex_viewer_scene_2_get_view(app->hex_viewer_scene_2));
+    view_dispatcher_add_view(app->view_dispatcher, HexViewerViewIdScene2, hex_viewer_scene_2_get_view(app->hex_viewer_scene_2));
     app->button_menu = button_menu_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdScene3, button_menu_get_view(app->button_menu));
+    view_dispatcher_add_view(app->view_dispatcher, HexViewerViewIdScene3, button_menu_get_view(app->button_menu));
     
     app->variable_item_list = variable_item_list_alloc();
-    view_dispatcher_add_view(app->view_dispatcher, BoilerplateViewIdSettings, variable_item_list_get_view(app->variable_item_list));
+    view_dispatcher_add_view(app->view_dispatcher, HexViewerViewIdSettings, variable_item_list_get_view(app->variable_item_list));
 
     //End Scene Additions
 
     return app;
 }
 
-void hex_viewer_app_free(Boilerplate* app) {
+void hex_viewer_app_free(HexViewer* app) {
     furi_assert(app);
     
     // Scene manager
     scene_manager_free(app->scene_manager);
 
     // View Dispatcher
-    view_dispatcher_remove_view(app->view_dispatcher, BoilerplateViewIdMenu);
-    view_dispatcher_remove_view(app->view_dispatcher, BoilerplateViewIdScene1);
-    view_dispatcher_remove_view(app->view_dispatcher, BoilerplateViewIdScene2);
-    view_dispatcher_remove_view(app->view_dispatcher, BoilerplateViewIdSettings);
+    view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdMenu);
+    view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdScene1);
+    view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdScene2);
+    view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdSettings);
     submenu_free(app->submenu);
 
     view_dispatcher_free(app->view_dispatcher);
@@ -98,12 +98,12 @@ void hex_viewer_app_free(Boilerplate* app) {
 
 int32_t hex_viewer_app(void* p) {
     UNUSED(p);
-    Boilerplate* app = hex_viewer_app_alloc();
+    HexViewer* app = hex_viewer_app_alloc();
     
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
     
-    scene_manager_next_scene(app->scene_manager, BoilerplateSceneStartscreen); //Start with start screen
-    //scene_manager_next_scene(app->scene_manager, BoilerplateSceneMenu); //if you want to directly start with Menu
+    scene_manager_next_scene(app->scene_manager, HexViewerSceneStartscreen); //Start with start screen
+    //scene_manager_next_scene(app->scene_manager, HexViewerSceneMenu); //if you want to directly start with Menu
 
     furi_hal_power_suppress_charge_enter();
 

+ 26 - 26
hex_viewer.h

@@ -20,7 +20,7 @@
 #include "views/hex_viewer_scene_2.h"
 #include "helpers/hex_viewer_storage.h"
 
-#define TAG "Boilerplate"
+#define TAG "HexViewer"
 
 #define SUBGHZ_APP_EXTENSION ".sub"
 #define SUBGHZ_APP_FOLDER ANY_PATH("subghz")
@@ -32,9 +32,9 @@ typedef struct {
     Submenu* submenu;
     SceneManager* scene_manager;
     VariableItemList* variable_item_list;
-    BoilerplateStartscreen* hex_viewer_startscreen;
-    BoilerplateScene1* hex_viewer_scene_1;
-    BoilerplateScene2* hex_viewer_scene_2;
+    HexViewerStartscreen* hex_viewer_startscreen;
+    HexViewerScene1* hex_viewer_scene_1;
+    HexViewerScene2* hex_viewer_scene_2;
     DialogsApp* dialogs; // File Browser
     FuriString* file_path; // File Browser
     uint32_t haptic; 
@@ -42,35 +42,35 @@ typedef struct {
     uint32_t led;
     uint32_t save_settings;
     ButtonMenu* button_menu; // Button Menu
-} Boilerplate;
+} HexViewer;
 
 typedef enum {
-    BoilerplateViewIdStartscreen,
-    BoilerplateViewIdMenu,
-    BoilerplateViewIdScene1,
-    BoilerplateViewIdScene2,
-    BoilerplateViewIdScene3,
-    BoilerplateViewIdScene4,
-    BoilerplateViewIdScene5,
-    BoilerplateViewIdSettings,
-} BoilerplateViewId;
+    HexViewerViewIdStartscreen,
+    HexViewerViewIdMenu,
+    HexViewerViewIdScene1,
+    HexViewerViewIdScene2,
+    HexViewerViewIdScene3,
+    HexViewerViewIdScene4,
+    HexViewerViewIdScene5,
+    HexViewerViewIdSettings,
+} HexViewerViewId;
 
 typedef enum {
-    BoilerplateHapticOff,
-    BoilerplateHapticOn,
-} BoilerplateHapticState;
+    HexViewerHapticOff,
+    HexViewerHapticOn,
+} HexViewerHapticState;
 
 typedef enum {
-    BoilerplateSpeakerOff,
-    BoilerplateSpeakerOn,
-} BoilerplateSpeakerState;
+    HexViewerSpeakerOff,
+    HexViewerSpeakerOn,
+} HexViewerSpeakerState;
 
 typedef enum {
-    BoilerplateLedOff,
-    BoilerplateLedOn,
-} BoilerplateLedState;
+    HexViewerLedOff,
+    HexViewerLedOn,
+} HexViewerLedState;
 
 typedef enum {
-    BoilerplateSettingsOff,
-    BoilerplateSettingsOn,
-} BoilerplateSettingsStoreState;
+    HexViewerSettingsOff,
+    HexViewerSettingsOn,
+} HexViewerSettingsStoreState;

+ 1 - 1
scenes/hex_viewer_scene.c

@@ -26,5 +26,5 @@ const SceneManagerHandlers hex_viewer_scene_handlers = {
     .on_enter_handlers = hex_viewer_on_enter_handlers,
     .on_event_handlers = hex_viewer_on_event_handlers,
     .on_exit_handlers = hex_viewer_on_exit_handlers,
-    .scene_num = BoilerplateSceneNum,
+    .scene_num = HexViewerSceneNum,
 };

+ 3 - 3
scenes/hex_viewer_scene.h

@@ -3,11 +3,11 @@
 #include <gui/scene_manager.h>
 
 // Generate scene id and total number
-#define ADD_SCENE(prefix, name, id) BoilerplateScene##id,
+#define ADD_SCENE(prefix, name, id) HexViewerScene##id,
 typedef enum {
 #include "hex_viewer_scene_config.h"
-    BoilerplateSceneNum,
-} BoilerplateScene;
+    HexViewerSceneNum,
+} HexViewerScene;
 #undef ADD_SCENE
 
 extern const SceneManagerHandlers hex_viewer_scene_handlers;

+ 16 - 16
scenes/hex_viewer_scene_menu.c

@@ -10,12 +10,12 @@ enum SubmenuIndex {
 };
 
 void hex_viewer_scene_menu_submenu_callback(void* context, uint32_t index) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     view_dispatcher_send_custom_event(app->view_dispatcher, index);
 }
 
 void hex_viewer_scene_menu_on_enter(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
 
     submenu_add_item(app->submenu, "Scene 1 (empty)", SubmenuIndexScene1, hex_viewer_scene_menu_submenu_callback, app);
     submenu_add_item(app->submenu, "Scene 2 (Inputs/Effects)", SubmenuIndexScene2, hex_viewer_scene_menu_submenu_callback, app);
@@ -23,13 +23,13 @@ void hex_viewer_scene_menu_on_enter(void* context) {
     submenu_add_item(app->submenu, "Scene 4 (File Browser)", SubmenuIndexScene4, hex_viewer_scene_menu_submenu_callback, app);
     submenu_add_item(app->submenu, "Settings", SubmenuIndexSettings, hex_viewer_scene_menu_submenu_callback, app);
 
-    submenu_set_selected_item(app->submenu, scene_manager_get_scene_state(app->scene_manager, BoilerplateSceneMenu));
+    submenu_set_selected_item(app->submenu, scene_manager_get_scene_state(app->scene_manager, HexViewerSceneMenu));
 
-    view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdMenu);
+    view_dispatcher_switch_to_view(app->view_dispatcher, HexViewerViewIdMenu);
 }
 
 bool hex_viewer_scene_menu_on_event(void* context, SceneManagerEvent event) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     UNUSED(app);
     if(event.type == SceneManagerEventTypeBack) {
         //exit app
@@ -39,26 +39,26 @@ bool hex_viewer_scene_menu_on_event(void* context, SceneManagerEvent event) {
     } else if(event.type == SceneManagerEventTypeCustom) {
         if(event.event == SubmenuIndexScene1) {
             scene_manager_set_scene_state(
-                app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene1);
-            scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_1);
+                app->scene_manager, HexViewerSceneMenu, SubmenuIndexScene1);
+            scene_manager_next_scene(app->scene_manager, HexViewerSceneScene_1);
             return true;
         } else if (event.event == SubmenuIndexScene2) {
             scene_manager_set_scene_state(
-                app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene2);
-            scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_2);
+                app->scene_manager, HexViewerSceneMenu, SubmenuIndexScene2);
+            scene_manager_next_scene(app->scene_manager, HexViewerSceneScene_2);
             return true;
         } else if (event.event == SubmenuIndexScene3) {
             scene_manager_set_scene_state(
-                app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene3);
-            scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_3);
+                app->scene_manager, HexViewerSceneMenu, SubmenuIndexScene3);
+            scene_manager_next_scene(app->scene_manager, HexViewerSceneScene_3);
         } else if (event.event == SubmenuIndexScene4) {
             scene_manager_set_scene_state(
-                app->scene_manager, BoilerplateSceneMenu, SubmenuIndexScene4);
-            scene_manager_next_scene(app->scene_manager, BoilerplateSceneScene_4);
+                app->scene_manager, HexViewerSceneMenu, SubmenuIndexScene4);
+            scene_manager_next_scene(app->scene_manager, HexViewerSceneScene_4);
         } else if (event.event == SubmenuIndexSettings) {
             scene_manager_set_scene_state(
-                app->scene_manager, BoilerplateSceneMenu, SubmenuIndexSettings);
-            scene_manager_next_scene(app->scene_manager, BoilerplateSceneSettings);
+                app->scene_manager, HexViewerSceneMenu, SubmenuIndexSettings);
+            scene_manager_next_scene(app->scene_manager, HexViewerSceneSettings);
             return true;
         }
     }
@@ -66,6 +66,6 @@ bool hex_viewer_scene_menu_on_event(void* context, SceneManagerEvent event) {
 }
 
 void hex_viewer_scene_menu_on_exit(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     submenu_reset(app->submenu);
 }

+ 12 - 12
scenes/hex_viewer_scene_scene_1.c

@@ -2,37 +2,37 @@
 #include "../helpers/hex_viewer_custom_event.h"
 #include "../views/hex_viewer_scene_1.h"
 
-void hex_viewer_scene_1_callback(BoilerplateCustomEvent event, void* context) {
+void hex_viewer_scene_1_callback(HexViewerCustomEvent event, void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     view_dispatcher_send_custom_event(app->view_dispatcher, event);
 }
 
 void hex_viewer_scene_scene_1_on_enter(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     hex_viewer_scene_1_set_callback(app->hex_viewer_scene_1, hex_viewer_scene_1_callback, app);
-    view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdScene1);
+    view_dispatcher_switch_to_view(app->view_dispatcher, HexViewerViewIdScene1);
 }
 
 bool hex_viewer_scene_scene_1_on_event(void* context, SceneManagerEvent event) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     bool consumed = false;
     
     if(event.type == SceneManagerEventTypeCustom) {
         switch(event.event) {
-            case BoilerplateCustomEventScene1Left:
-            case BoilerplateCustomEventScene1Right:
+            case HexViewerCustomEventScene1Left:
+            case HexViewerCustomEventScene1Right:
                 break;
-            case BoilerplateCustomEventScene1Up:
-            case BoilerplateCustomEventScene1Down:
+            case HexViewerCustomEventScene1Up:
+            case HexViewerCustomEventScene1Down:
                 break;
-            case BoilerplateCustomEventScene1Back:
+            case HexViewerCustomEventScene1Back:
                 notification_message(app->notification, &sequence_reset_red);
                 notification_message(app->notification, &sequence_reset_green);
                 notification_message(app->notification, &sequence_reset_blue);
                 if(!scene_manager_search_and_switch_to_previous_scene(
-                    app->scene_manager, BoilerplateSceneMenu)) {
+                    app->scene_manager, HexViewerSceneMenu)) {
                         scene_manager_stop(app->scene_manager);
                         view_dispatcher_stop(app->view_dispatcher);
                     }
@@ -45,6 +45,6 @@ bool hex_viewer_scene_scene_1_on_event(void* context, SceneManagerEvent event) {
 }
 
 void hex_viewer_scene_scene_1_on_exit(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     UNUSED(app);
 }

+ 12 - 12
scenes/hex_viewer_scene_scene_2.c

@@ -4,37 +4,37 @@
 #include "../helpers/hex_viewer_led.h"
 #include "../views/hex_viewer_scene_2.h"
 
-void hex_viewer_scene_2_callback(BoilerplateCustomEvent event, void* context) {
+void hex_viewer_scene_2_callback(HexViewerCustomEvent event, void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     view_dispatcher_send_custom_event(app->view_dispatcher, event);
 }
 
 void hex_viewer_scene_scene_2_on_enter(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     hex_viewer_scene_2_set_callback(app->hex_viewer_scene_2, hex_viewer_scene_2_callback, app);
-    view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdScene2);
+    view_dispatcher_switch_to_view(app->view_dispatcher, HexViewerViewIdScene2);
 }
 
 bool hex_viewer_scene_scene_2_on_event(void* context, SceneManagerEvent event) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     bool consumed = false;
 
     if(event.type == SceneManagerEventTypeCustom) {
         switch(event.event) {
-            case BoilerplateCustomEventScene2Left:
-            case BoilerplateCustomEventScene2Right:
+            case HexViewerCustomEventScene2Left:
+            case HexViewerCustomEventScene2Right:
                 break;
-            case BoilerplateCustomEventScene2Up:
-            case BoilerplateCustomEventScene2Down:
+            case HexViewerCustomEventScene2Up:
+            case HexViewerCustomEventScene2Down:
                 break;
-            case BoilerplateCustomEventScene2Back:
+            case HexViewerCustomEventScene2Back:
                 notification_message(app->notification, &sequence_reset_red);
                 notification_message(app->notification, &sequence_reset_green);
                 notification_message(app->notification, &sequence_reset_blue);
                 if(!scene_manager_search_and_switch_to_previous_scene(
-                    app->scene_manager, BoilerplateSceneMenu)) {
+                    app->scene_manager, HexViewerSceneMenu)) {
                         scene_manager_stop(app->scene_manager);
                         view_dispatcher_stop(app->view_dispatcher);
                     }
@@ -47,7 +47,7 @@ bool hex_viewer_scene_scene_2_on_event(void* context, SceneManagerEvent event) {
 }
 
 void hex_viewer_scene_scene_2_on_exit(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     UNUSED(app);
 }
 

+ 11 - 11
scenes/hex_viewer_scene_scene_3.c

@@ -13,16 +13,16 @@ typedef enum {
 } ButtonIndex;
 
 static void hex_viewer_scene_3_callback(void* context, int32_t index, InputType type) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
 
     uint16_t custom_type;
     if(type == InputTypePress) {
-        custom_type = BoilerplateCustomEventMenuSelected;
+        custom_type = HexViewerCustomEventMenuSelected;
     } else if(type == InputTypeRelease) {
-        custom_type = BoilerplateCustomEventMenuVoid;
+        custom_type = HexViewerCustomEventMenuVoid;
     } else if(type == InputTypeShort) {
         //somehow ButtonMenuItemTypeCommon uses InputTypeShort
-        custom_type = BoilerplateCustomEventMenuSelected;
+        custom_type = HexViewerCustomEventMenuSelected;
     } else {
         furi_crash("Unexpected Input Type");
     }
@@ -31,7 +31,7 @@ static void hex_viewer_scene_3_callback(void* context, int32_t index, InputType
 
 void hex_viewer_scene_scene_3_on_enter(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     ButtonMenu* button_menu = app->button_menu;
     SceneManager* scene_manager = app->scene_manager;
 
@@ -83,21 +83,21 @@ void hex_viewer_scene_scene_3_on_enter(void* context) {
 
     button_menu_set_header(button_menu, "Button Menu");
     const int16_t button_index =
-        (signed)scene_manager_get_scene_state(app->scene_manager, BoilerplateViewIdScene3);
+        (signed)scene_manager_get_scene_state(app->scene_manager, HexViewerViewIdScene3);
     button_menu_set_selected_item(button_menu, button_index);
-    scene_manager_set_scene_state(scene_manager, BoilerplateSceneScene_3, ButtonIndexButton1);
+    scene_manager_set_scene_state(scene_manager, HexViewerSceneScene_3, ButtonIndexButton1);
 
-    view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdScene3);
+    view_dispatcher_switch_to_view(app->view_dispatcher, HexViewerViewIdScene3);
 }
 
 bool hex_viewer_scene_scene_3_on_event(void* context, SceneManagerEvent event) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     bool consumed = false;
 
     if(event.type == SceneManagerEventTypeCustom) {
         const uint16_t custom_type = hex_viewer_custom_menu_event_get_type(event.event);
         const int16_t button_index = hex_viewer_custom_menu_event_get_value(event.event);
-        if (custom_type == BoilerplateCustomEventMenuSelected) {
+        if (custom_type == HexViewerCustomEventMenuSelected) {
             switch(button_index) {
                 case ButtonIndexButton1:
                     hex_viewer_play_happy_bump(app);
@@ -132,7 +132,7 @@ bool hex_viewer_scene_scene_3_on_event(void* context, SceneManagerEvent event) {
 }
 
 void hex_viewer_scene_scene_3_on_exit(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     button_menu_reset(app->button_menu);
     notification_message(app->notification, &sequence_reset_red);
     notification_message(app->notification, &sequence_reset_green);

+ 2 - 2
scenes/hex_viewer_scene_scene_4.c

@@ -2,7 +2,7 @@
 
 void hex_viewer_scene_scene_4_on_enter(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     DialogsFileBrowserOptions browser_options;
     
     // This will filter the browser to only show one file type and also add an icon
@@ -23,7 +23,7 @@ void hex_viewer_scene_scene_4_on_enter(void* context) {
 
     if(success) {
         // Load page to do something with result
-        //scene_manager_next_scene(app->scene_manager, BoilerplateViewIdMenu);
+        //scene_manager_next_scene(app->scene_manager, HexViewerViewIdMenu);
         scene_manager_previous_scene(app->scene_manager); // temp for showcase
     } else {
         // This is basically if someone quites the browser

+ 17 - 17
scenes/hex_viewer_scene_settings.c

@@ -12,8 +12,8 @@ const char* const haptic_text[2] = {
     "ON",
 };
 const uint32_t haptic_value[2] = {
-    BoilerplateHapticOff,
-    BoilerplateHapticOn,
+    HexViewerHapticOff,
+    HexViewerHapticOn,
 };
 
 const char* const speaker_text[2] = {
@@ -21,8 +21,8 @@ const char* const speaker_text[2] = {
     "ON",
 };
 const uint32_t speaker_value[2] = {
-    BoilerplateSpeakerOff,
-    BoilerplateSpeakerOn,
+    HexViewerSpeakerOff,
+    HexViewerSpeakerOn,
 };
 
 const char* const led_text[2] = {
@@ -30,8 +30,8 @@ const char* const led_text[2] = {
     "ON",
 };
 const uint32_t led_value[2] = {
-    BoilerplateLedOff,
-    BoilerplateLedOn,
+    HexViewerLedOff,
+    HexViewerLedOn,
 };
 
 const char* const settings_text[2] = {
@@ -39,13 +39,13 @@ const char* const settings_text[2] = {
     "ON",
 };
 const uint32_t settings_value[2] = {
-    BoilerplateSettingsOff,
-    BoilerplateSettingsOn,
+    HexViewerSettingsOff,
+    HexViewerSettingsOn,
 };
 
 
 static void hex_viewer_scene_settings_set_haptic(VariableItem* item) {
-    Boilerplate* app = variable_item_get_context(item);
+    HexViewer* app = variable_item_get_context(item);
     uint8_t index = variable_item_get_current_value_index(item);
 
     variable_item_set_current_value_text(item, haptic_text[index]);
@@ -53,33 +53,33 @@ static void hex_viewer_scene_settings_set_haptic(VariableItem* item) {
 }
 
 static void hex_viewer_scene_settings_set_speaker(VariableItem* item) {
-    Boilerplate* app = variable_item_get_context(item);
+    HexViewer* app = variable_item_get_context(item);
     uint8_t index = variable_item_get_current_value_index(item);
     variable_item_set_current_value_text(item, speaker_text[index]);
     app->speaker = speaker_value[index];
 }
 
 static void hex_viewer_scene_settings_set_led(VariableItem* item) {
-    Boilerplate* app = variable_item_get_context(item);
+    HexViewer* app = variable_item_get_context(item);
     uint8_t index = variable_item_get_current_value_index(item);
     variable_item_set_current_value_text(item, led_text[index]);
     app->led = led_value[index];
 }
 
 static void hex_viewer_scene_settings_set_save_settings(VariableItem* item) {
-    Boilerplate* app = variable_item_get_context(item);
+    HexViewer* app = variable_item_get_context(item);
     uint8_t index = variable_item_get_current_value_index(item);
     variable_item_set_current_value_text(item, settings_text[index]);
     app->save_settings = settings_value[index];
 }
 
 void hex_viewer_scene_settings_submenu_callback(void* context, uint32_t index) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     view_dispatcher_send_custom_event(app->view_dispatcher, index);
 }
 
 void hex_viewer_scene_settings_on_enter(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     VariableItem* item;
     uint8_t value_index;
 
@@ -127,11 +127,11 @@ void hex_viewer_scene_settings_on_enter(void* context) {
     variable_item_set_current_value_index(item, value_index);
     variable_item_set_current_value_text(item, settings_text[value_index]);
     
-    view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdSettings);
+    view_dispatcher_switch_to_view(app->view_dispatcher, HexViewerViewIdSettings);
 }
 
 bool hex_viewer_scene_settings_on_event(void* context, SceneManagerEvent event) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     UNUSED(app);
     bool consumed = false;
     if(event.type == SceneManagerEventTypeCustom) {
@@ -141,7 +141,7 @@ bool hex_viewer_scene_settings_on_event(void* context, SceneManagerEvent event)
 }
 
 void hex_viewer_scene_settings_on_exit(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     variable_item_list_set_selected_item(app->variable_item_list, 0);
     variable_item_list_reset(app->variable_item_list);
 }

+ 14 - 14
scenes/hex_viewer_scene_startscreen.c

@@ -2,41 +2,41 @@
 #include "../helpers/hex_viewer_custom_event.h"
 #include "../views/hex_viewer_startscreen.h"
 
-void hex_viewer_scene_startscreen_callback(BoilerplateCustomEvent event, void* context) {
+void hex_viewer_scene_startscreen_callback(HexViewerCustomEvent event, void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     view_dispatcher_send_custom_event(app->view_dispatcher, event);
 }
 
 void hex_viewer_scene_startscreen_on_enter(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     hex_viewer_startscreen_set_callback(app->hex_viewer_startscreen, hex_viewer_scene_startscreen_callback, app);
-    view_dispatcher_switch_to_view(app->view_dispatcher, BoilerplateViewIdStartscreen);
+    view_dispatcher_switch_to_view(app->view_dispatcher, HexViewerViewIdStartscreen);
 }
 
 bool hex_viewer_scene_startscreen_on_event(void* context, SceneManagerEvent event) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     bool consumed = false;
     
     if(event.type == SceneManagerEventTypeCustom) {
         switch(event.event) {
-            case BoilerplateCustomEventStartscreenLeft:
-            case BoilerplateCustomEventStartscreenRight:
+            case HexViewerCustomEventStartscreenLeft:
+            case HexViewerCustomEventStartscreenRight:
                 break;
-            case BoilerplateCustomEventStartscreenUp:
-            case BoilerplateCustomEventStartscreenDown:
+            case HexViewerCustomEventStartscreenUp:
+            case HexViewerCustomEventStartscreenDown:
                 break;
-            case BoilerplateCustomEventStartscreenOk:
-                scene_manager_next_scene(app->scene_manager, BoilerplateSceneMenu);
+            case HexViewerCustomEventStartscreenOk:
+                scene_manager_next_scene(app->scene_manager, HexViewerSceneMenu);
                 consumed = true;
                 break;
-            case BoilerplateCustomEventStartscreenBack:
+            case HexViewerCustomEventStartscreenBack:
                 notification_message(app->notification, &sequence_reset_red);
                 notification_message(app->notification, &sequence_reset_green);
                 notification_message(app->notification, &sequence_reset_blue);
                 if(!scene_manager_search_and_switch_to_previous_scene(
-                    app->scene_manager, BoilerplateSceneStartscreen)) {
+                    app->scene_manager, HexViewerSceneStartscreen)) {
                         scene_manager_stop(app->scene_manager);
                         view_dispatcher_stop(app->view_dispatcher);
                     }
@@ -49,6 +49,6 @@ bool hex_viewer_scene_startscreen_on_event(void* context, SceneManagerEvent even
 }
 
 void hex_viewer_scene_startscreen_on_exit(void* context) {
-    Boilerplate* app = context;
+    HexViewer* app = context;
     UNUSED(app);
 }

+ 20 - 20
views/hex_viewer_scene_1.c

@@ -5,20 +5,20 @@
 #include <gui/elements.h>
 #include <dolphin/dolphin.h>
 
-struct BoilerplateScene1 {
+struct HexViewerScene1 {
     View* view;
-    BoilerplateScene1Callback callback;
+    HexViewerScene1Callback callback;
     void* context;
 };
 
 
 typedef struct {
     int some_value;
-} BoilerplateScene1Model;
+} HexViewerScene1Model;
 
 void hex_viewer_scene_1_set_callback(
-    BoilerplateScene1* instance,
-    BoilerplateScene1Callback callback,
+    HexViewerScene1* instance,
+    HexViewerScene1Callback callback,
     void* context) {
     furi_assert(instance);
     furi_assert(callback);
@@ -26,7 +26,7 @@ void hex_viewer_scene_1_set_callback(
     instance->context = context;
 }
 
-void hex_viewer_scene_1_draw(Canvas* canvas, BoilerplateScene1Model* model) {
+void hex_viewer_scene_1_draw(Canvas* canvas, HexViewerScene1Model* model) {
     UNUSED(model);
     canvas_clear(canvas);
     canvas_set_color(canvas, ColorBlack);
@@ -37,22 +37,22 @@ void hex_viewer_scene_1_draw(Canvas* canvas, BoilerplateScene1Model* model) {
     canvas_draw_str_aligned(canvas, 0, 32, AlignLeft, AlignTop, "used as hex_viewer"); 
 }
 
-static void hex_viewer_scene_1_model_init(BoilerplateScene1Model* const model) {
+static void hex_viewer_scene_1_model_init(HexViewerScene1Model* const model) {
     model->some_value = 1;
 }
 
 bool hex_viewer_scene_1_input(InputEvent* event, void* context) {
     furi_assert(context); 
-    BoilerplateScene1* instance = context;
+    HexViewerScene1* instance = context;
     if (event->type == InputTypeRelease) {
         switch(event->key) {
             case InputKeyBack:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene1Model * model,
+                    HexViewerScene1Model * model,
                     {
                         UNUSED(model);
-                        instance->callback(BoilerplateCustomEventScene1Back, instance->context);
+                        instance->callback(HexViewerCustomEventScene1Back, instance->context);
                     },
                     true);
                 break;
@@ -63,7 +63,7 @@ bool hex_viewer_scene_1_input(InputEvent* event, void* context) {
             case InputKeyOk:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene1Model* model,
+                    HexViewerScene1Model* model,
                     {
                         UNUSED(model);
                     },
@@ -82,10 +82,10 @@ void hex_viewer_scene_1_exit(void* context) {
 
 void hex_viewer_scene_1_enter(void* context) {
     furi_assert(context);
-    BoilerplateScene1* instance = (BoilerplateScene1*)context;
+    HexViewerScene1* instance = (HexViewerScene1*)context;
     with_view_model(
         instance->view,
-        BoilerplateScene1Model * model,
+        HexViewerScene1Model * model,
         {
             hex_viewer_scene_1_model_init(model);
         },
@@ -93,10 +93,10 @@ void hex_viewer_scene_1_enter(void* context) {
     );
 }
 
-BoilerplateScene1* hex_viewer_scene_1_alloc() {
-    BoilerplateScene1* instance = malloc(sizeof(BoilerplateScene1));
+HexViewerScene1* hex_viewer_scene_1_alloc() {
+    HexViewerScene1* instance = malloc(sizeof(HexViewerScene1));
     instance->view = view_alloc();
-    view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateScene1Model));
+    view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(HexViewerScene1Model));
     view_set_context(instance->view, instance); // furi_assert crashes in events without this
     view_set_draw_callback(instance->view, (ViewDrawCallback)hex_viewer_scene_1_draw);
     view_set_input_callback(instance->view, hex_viewer_scene_1_input);
@@ -105,7 +105,7 @@ BoilerplateScene1* hex_viewer_scene_1_alloc() {
 
     with_view_model(
         instance->view,
-        BoilerplateScene1Model * model,
+        HexViewerScene1Model * model,
         {
             hex_viewer_scene_1_model_init(model);
         },
@@ -115,12 +115,12 @@ BoilerplateScene1* hex_viewer_scene_1_alloc() {
     return instance;
 }
 
-void hex_viewer_scene_1_free(BoilerplateScene1* instance) {
+void hex_viewer_scene_1_free(HexViewerScene1* instance) {
     furi_assert(instance);
 
     with_view_model(
         instance->view,
-        BoilerplateScene1Model * model,
+        HexViewerScene1Model * model,
         {
             UNUSED(model);
         },
@@ -129,7 +129,7 @@ void hex_viewer_scene_1_free(BoilerplateScene1* instance) {
     free(instance);
 }
 
-View* hex_viewer_scene_1_get_view(BoilerplateScene1* instance) {
+View* hex_viewer_scene_1_get_view(HexViewerScene1* instance) {
     furi_assert(instance);
     return instance->view;
 }

+ 7 - 7
views/hex_viewer_scene_1.h

@@ -3,17 +3,17 @@
 #include <gui/view.h>
 #include "../helpers/hex_viewer_custom_event.h"
 
-typedef struct BoilerplateScene1 BoilerplateScene1;
+typedef struct HexViewerScene1 HexViewerScene1;
 
-typedef void (*BoilerplateScene1Callback)(BoilerplateCustomEvent event, void* context);
+typedef void (*HexViewerScene1Callback)(HexViewerCustomEvent event, void* context);
 
 void hex_viewer_scene_1_set_callback(
-    BoilerplateScene1* hex_viewer_scene_1,
-    BoilerplateScene1Callback callback,
+    HexViewerScene1* hex_viewer_scene_1,
+    HexViewerScene1Callback callback,
     void* context);
 
-View* hex_viewer_scene_1_get_view(BoilerplateScene1* hex_viewer_static);
+View* hex_viewer_scene_1_get_view(HexViewerScene1* hex_viewer_static);
 
-BoilerplateScene1* hex_viewer_scene_1_alloc();
+HexViewerScene1* hex_viewer_scene_1_alloc();
 
-void hex_viewer_scene_1_free(BoilerplateScene1* hex_viewer_static);
+void hex_viewer_scene_1_free(HexViewerScene1* hex_viewer_static);

+ 27 - 27
views/hex_viewer_scene_2.c

@@ -8,15 +8,15 @@
 #include "../helpers/hex_viewer_speaker.h"
 #include "../helpers/hex_viewer_led.h"
 
-struct BoilerplateScene2 {
+struct HexViewerScene2 {
     View* view;
-    BoilerplateScene2Callback callback;
+    HexViewerScene2Callback callback;
     void* context;
 };
 
 typedef struct {
     int screen_text;
-} BoilerplateScene2Model;
+} HexViewerScene2Model;
 
 char buttonText[11][14] = {
     "",
@@ -33,8 +33,8 @@ char buttonText[11][14] = {
 };
 
 void hex_viewer_scene_2_set_callback(
-    BoilerplateScene2* instance,
-    BoilerplateScene2Callback callback,
+    HexViewerScene2* instance,
+    HexViewerScene2Callback callback,
     void* context) {
     furi_assert(instance);
     furi_assert(callback);
@@ -42,7 +42,7 @@ void hex_viewer_scene_2_set_callback(
     instance->context = context;
 }
 
-void hex_viewer_scene_2_draw(Canvas* canvas, BoilerplateScene2Model* model) {
+void hex_viewer_scene_2_draw(Canvas* canvas, HexViewerScene2Model* model) {
     canvas_clear(canvas);
     canvas_set_color(canvas, ColorBlack);
     canvas_set_font(canvas, FontPrimary);
@@ -54,23 +54,23 @@ void hex_viewer_scene_2_draw(Canvas* canvas, BoilerplateScene2Model* model) {
     free(strInput);
 }
 
-static void hex_viewer_scene_2_model_init(BoilerplateScene2Model* const model) {
+static void hex_viewer_scene_2_model_init(HexViewerScene2Model* const model) {
     model->screen_text = 0;
 }
 
 bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
     furi_assert(context);
-    BoilerplateScene2* instance = context;
+    HexViewerScene2* instance = context;
     if (event->type == InputTypeRelease) {
         switch(event->key) {
             case InputKeyBack:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         UNUSED(model);
                         hex_viewer_stop_all_sound(instance->context);
-                        instance->callback(BoilerplateCustomEventScene2Back, instance->context);
+                        instance->callback(HexViewerCustomEventScene2Back, instance->context);
                         hex_viewer_play_long_bump(instance->context);
                     },
                     true);
@@ -78,7 +78,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyUp:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 6;
                         hex_viewer_play_bad_bump(instance->context);
@@ -90,7 +90,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyDown:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 7;
                         hex_viewer_play_bad_bump(instance->context);
@@ -102,7 +102,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyLeft:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 8;
                         hex_viewer_play_bad_bump(instance->context);
@@ -114,7 +114,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyRight:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 9;
                         hex_viewer_play_bad_bump(instance->context);
@@ -126,7 +126,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyOk:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 10;
                         hex_viewer_play_bad_bump(instance->context);
@@ -143,7 +143,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyUp:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 1;
                         hex_viewer_play_happy_bump(instance->context);
@@ -154,7 +154,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyDown:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 2;
                         hex_viewer_play_happy_bump(instance->context);
@@ -165,7 +165,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyLeft:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 3;
                         hex_viewer_play_happy_bump(instance->context);
@@ -176,7 +176,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyRight:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 4;
                         hex_viewer_play_happy_bump(instance->context);
@@ -187,7 +187,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
             case InputKeyOk:
                 with_view_model(
                     instance->view,
-                    BoilerplateScene2Model * model,
+                    HexViewerScene2Model * model,
                     {
                         model->screen_text = 5;
                         hex_viewer_play_happy_bump(instance->context);
@@ -206,7 +206,7 @@ bool hex_viewer_scene_2_input(InputEvent* event, void* context) {
 
 void hex_viewer_scene_2_exit(void* context) {
     furi_assert(context);
-    Boilerplate* app = context;
+    HexViewer* app = context;
     hex_viewer_stop_all_sound(app);
     //hex_viewer_led_reset(app);
 }
@@ -216,10 +216,10 @@ void hex_viewer_scene_2_enter(void* context) {
     dolphin_deed(DolphinDeedPluginStart);
 }
 
-BoilerplateScene2* hex_viewer_scene_2_alloc() {
-    BoilerplateScene2* instance = malloc(sizeof(BoilerplateScene2));
+HexViewerScene2* hex_viewer_scene_2_alloc() {
+    HexViewerScene2* instance = malloc(sizeof(HexViewerScene2));
     instance->view = view_alloc();
-    view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateScene2Model));
+    view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(HexViewerScene2Model));
     view_set_context(instance->view, instance);
     view_set_draw_callback(instance->view, (ViewDrawCallback)hex_viewer_scene_2_draw);
     view_set_input_callback(instance->view, hex_viewer_scene_2_input);
@@ -228,7 +228,7 @@ BoilerplateScene2* hex_viewer_scene_2_alloc() {
 
     with_view_model(
         instance->view,
-        BoilerplateScene2Model * model,
+        HexViewerScene2Model * model,
         {
             hex_viewer_scene_2_model_init(model);
         },
@@ -237,7 +237,7 @@ BoilerplateScene2* hex_viewer_scene_2_alloc() {
     return instance;
 }
 
-void hex_viewer_scene_2_free(BoilerplateScene2* instance) {
+void hex_viewer_scene_2_free(HexViewerScene2* instance) {
     furi_assert(instance);
 
 
@@ -245,7 +245,7 @@ void hex_viewer_scene_2_free(BoilerplateScene2* instance) {
     free(instance);
 }
 
-View* hex_viewer_scene_2_get_view(BoilerplateScene2* instance) {
+View* hex_viewer_scene_2_get_view(HexViewerScene2* instance) {
     furi_assert(instance);
 
 

+ 7 - 7
views/hex_viewer_scene_2.h

@@ -3,17 +3,17 @@
 #include <gui/view.h>
 #include "../helpers/hex_viewer_custom_event.h"
 
-typedef struct BoilerplateScene2 BoilerplateScene2;
+typedef struct HexViewerScene2 HexViewerScene2;
 
-typedef void (*BoilerplateScene2Callback)(BoilerplateCustomEvent event, void* context);
+typedef void (*HexViewerScene2Callback)(HexViewerCustomEvent event, void* context);
 
 void hex_viewer_scene_2_set_callback(
-    BoilerplateScene2* instance,
-    BoilerplateScene2Callback callback,
+    HexViewerScene2* instance,
+    HexViewerScene2Callback callback,
     void * context);
 
-BoilerplateScene2* hex_viewer_scene_2_alloc();
+HexViewerScene2* hex_viewer_scene_2_alloc();
 
-void hex_viewer_scene_2_free(BoilerplateScene2* hex_viewer_static);
+void hex_viewer_scene_2_free(HexViewerScene2* hex_viewer_static);
 
-View* hex_viewer_scene_2_get_view(BoilerplateScene2* boilerpate_static);
+View* hex_viewer_scene_2_get_view(HexViewerScene2* boilerpate_static);

+ 21 - 21
views/hex_viewer_startscreen.c

@@ -4,20 +4,20 @@
 #include <input/input.h>
 #include <gui/elements.h>
 
-struct BoilerplateStartscreen {
+struct HexViewerStartscreen {
     View* view;
-    BoilerplateStartscreenCallback callback;
+    HexViewerStartscreenCallback callback;
     void* context;
 };
 
 
 typedef struct {
     int some_value;
-} BoilerplateStartscreenModel;
+} HexViewerStartscreenModel;
 
 void hex_viewer_startscreen_set_callback(
-    BoilerplateStartscreen* instance,
-    BoilerplateStartscreenCallback callback,
+    HexViewerStartscreen* instance,
+    HexViewerStartscreenCallback callback,
     void* context) {
     furi_assert(instance);
     furi_assert(callback);
@@ -25,7 +25,7 @@ void hex_viewer_startscreen_set_callback(
     instance->context = context;
 }
 
-void hex_viewer_startscreen_draw(Canvas* canvas, BoilerplateStartscreenModel* model) {
+void hex_viewer_startscreen_draw(Canvas* canvas, HexViewerStartscreenModel* model) {
     UNUSED(model);
     canvas_clear(canvas);
     canvas_set_color(canvas, ColorBlack);
@@ -37,22 +37,22 @@ void hex_viewer_startscreen_draw(Canvas* canvas, BoilerplateStartscreenModel* mo
     elements_button_center(canvas, "Start"); 
 }
 
-static void hex_viewer_startscreen_model_init(BoilerplateStartscreenModel* const model) {
+static void hex_viewer_startscreen_model_init(HexViewerStartscreenModel* const model) {
     model->some_value = 1;
 }
 
 bool hex_viewer_startscreen_input(InputEvent* event, void* context) {
     furi_assert(context); 
-    BoilerplateStartscreen* instance = context;
+    HexViewerStartscreen* instance = context;
     if (event->type == InputTypeRelease) {
         switch(event->key) {
             case InputKeyBack:
                 with_view_model(
                     instance->view,
-                    BoilerplateStartscreenModel * model,
+                    HexViewerStartscreenModel * model,
                     {
                         UNUSED(model);
-                        instance->callback(BoilerplateCustomEventStartscreenBack, instance->context);
+                        instance->callback(HexViewerCustomEventStartscreenBack, instance->context);
                     },
                     true);
                 break;
@@ -63,10 +63,10 @@ bool hex_viewer_startscreen_input(InputEvent* event, void* context) {
             case InputKeyOk:
                 with_view_model(
                     instance->view,
-                    BoilerplateStartscreenModel* model,
+                    HexViewerStartscreenModel* model,
                     {
                         UNUSED(model);
-                        instance->callback(BoilerplateCustomEventStartscreenOk, instance->context);
+                        instance->callback(HexViewerCustomEventStartscreenOk, instance->context);
                     },
                     true);
                 break;
@@ -83,10 +83,10 @@ void hex_viewer_startscreen_exit(void* context) {
 
 void hex_viewer_startscreen_enter(void* context) {
     furi_assert(context);
-    BoilerplateStartscreen* instance = (BoilerplateStartscreen*)context;
+    HexViewerStartscreen* instance = (HexViewerStartscreen*)context;
     with_view_model(
         instance->view,
-        BoilerplateStartscreenModel * model,
+        HexViewerStartscreenModel * model,
         {
             hex_viewer_startscreen_model_init(model);
         },
@@ -94,10 +94,10 @@ void hex_viewer_startscreen_enter(void* context) {
     );
 }
 
-BoilerplateStartscreen* hex_viewer_startscreen_alloc() {
-    BoilerplateStartscreen* instance = malloc(sizeof(BoilerplateStartscreen));
+HexViewerStartscreen* hex_viewer_startscreen_alloc() {
+    HexViewerStartscreen* instance = malloc(sizeof(HexViewerStartscreen));
     instance->view = view_alloc();
-    view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(BoilerplateStartscreenModel));
+    view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(HexViewerStartscreenModel));
     view_set_context(instance->view, instance); // furi_assert crashes in events without this
     view_set_draw_callback(instance->view, (ViewDrawCallback)hex_viewer_startscreen_draw);
     view_set_input_callback(instance->view, hex_viewer_startscreen_input);
@@ -106,7 +106,7 @@ BoilerplateStartscreen* hex_viewer_startscreen_alloc() {
 
     with_view_model(
         instance->view,
-        BoilerplateStartscreenModel * model,
+        HexViewerStartscreenModel * model,
         {
             hex_viewer_startscreen_model_init(model);
         },
@@ -116,12 +116,12 @@ BoilerplateStartscreen* hex_viewer_startscreen_alloc() {
     return instance;
 }
 
-void hex_viewer_startscreen_free(BoilerplateStartscreen* instance) {
+void hex_viewer_startscreen_free(HexViewerStartscreen* instance) {
     furi_assert(instance);
 
     with_view_model(
         instance->view,
-        BoilerplateStartscreenModel * model,
+        HexViewerStartscreenModel * model,
         {
             UNUSED(model);
         },
@@ -130,7 +130,7 @@ void hex_viewer_startscreen_free(BoilerplateStartscreen* instance) {
     free(instance);
 }
 
-View* hex_viewer_startscreen_get_view(BoilerplateStartscreen* instance) {
+View* hex_viewer_startscreen_get_view(HexViewerStartscreen* instance) {
     furi_assert(instance);
     return instance->view;
 }

+ 7 - 7
views/hex_viewer_startscreen.h

@@ -3,17 +3,17 @@
 #include <gui/view.h>
 #include "../helpers/hex_viewer_custom_event.h"
 
-typedef struct BoilerplateStartscreen BoilerplateStartscreen;
+typedef struct HexViewerStartscreen HexViewerStartscreen;
 
-typedef void (*BoilerplateStartscreenCallback)(BoilerplateCustomEvent event, void* context);
+typedef void (*HexViewerStartscreenCallback)(HexViewerCustomEvent event, void* context);
 
 void hex_viewer_startscreen_set_callback(
-    BoilerplateStartscreen* hex_viewer_startscreen,
-    BoilerplateStartscreenCallback callback,
+    HexViewerStartscreen* hex_viewer_startscreen,
+    HexViewerStartscreenCallback callback,
     void* context);
 
-View* hex_viewer_startscreen_get_view(BoilerplateStartscreen* hex_viewer_static);
+View* hex_viewer_startscreen_get_view(HexViewerStartscreen* hex_viewer_static);
 
-BoilerplateStartscreen* hex_viewer_startscreen_alloc();
+HexViewerStartscreen* hex_viewer_startscreen_alloc();
 
-void hex_viewer_startscreen_free(BoilerplateStartscreen* hex_viewer_static);
+void hex_viewer_startscreen_free(HexViewerStartscreen* hex_viewer_static);