mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 11:28:36 -07:00
BLE Spam add more gui modules
This commit is contained in:
21
applications/external/ble_spam/ble_spam.c
vendored
21
applications/external/ble_spam/ble_spam.c
vendored
@@ -391,6 +391,18 @@ int32_t ble_spam(void* p) {
|
||||
view_set_input_callback(view_main, input_callback);
|
||||
view_dispatcher_add_view(state->ctx.view_dispatcher, ViewMain, view_main);
|
||||
|
||||
state->ctx.byte_input = byte_input_alloc();
|
||||
view_dispatcher_add_view(
|
||||
state->ctx.view_dispatcher, ViewByteInput, byte_input_get_view(state->ctx.byte_input));
|
||||
|
||||
state->ctx.submenu = submenu_alloc();
|
||||
view_dispatcher_add_view(
|
||||
state->ctx.view_dispatcher, ViewSubmenu, submenu_get_view(state->ctx.submenu));
|
||||
|
||||
state->ctx.text_input = text_input_alloc();
|
||||
view_dispatcher_add_view(
|
||||
state->ctx.view_dispatcher, ViewTextInput, text_input_get_view(state->ctx.text_input));
|
||||
|
||||
state->ctx.variable_item_list = variable_item_list_alloc();
|
||||
view_dispatcher_add_view(
|
||||
state->ctx.view_dispatcher,
|
||||
@@ -401,6 +413,15 @@ int32_t ble_spam(void* p) {
|
||||
scene_manager_next_scene(state->ctx.scene_manager, SceneMain);
|
||||
view_dispatcher_run(state->ctx.view_dispatcher);
|
||||
|
||||
view_dispatcher_remove_view(state->ctx.view_dispatcher, ViewByteInput);
|
||||
byte_input_free(state->ctx.byte_input);
|
||||
|
||||
view_dispatcher_remove_view(state->ctx.view_dispatcher, ViewSubmenu);
|
||||
submenu_free(state->ctx.submenu);
|
||||
|
||||
view_dispatcher_remove_view(state->ctx.view_dispatcher, ViewTextInput);
|
||||
text_input_free(state->ctx.text_input);
|
||||
|
||||
view_dispatcher_remove_view(state->ctx.view_dispatcher, ViewVariableItemList);
|
||||
variable_item_list_free(state->ctx.variable_item_list);
|
||||
|
||||
|
||||
9
applications/external/ble_spam/ble_spam.h
vendored
9
applications/external/ble_spam/ble_spam.h
vendored
@@ -1,12 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <gui/view_dispatcher.h>
|
||||
#include <gui/modules/byte_input.h>
|
||||
#include <gui/modules/submenu.h>
|
||||
#include <gui/modules/text_input.h>
|
||||
#include <gui/modules/variable_item_list.h>
|
||||
|
||||
#include "scenes/_setup.h"
|
||||
|
||||
enum {
|
||||
ViewMain,
|
||||
ViewByteInput,
|
||||
ViewSubmenu,
|
||||
ViewTextInput,
|
||||
ViewVariableItemList,
|
||||
};
|
||||
|
||||
@@ -18,5 +24,8 @@ typedef struct {
|
||||
ViewDispatcher* view_dispatcher;
|
||||
SceneManager* scene_manager;
|
||||
|
||||
ByteInput* byte_input;
|
||||
Submenu* submenu;
|
||||
TextInput* text_input;
|
||||
VariableItemList* variable_item_list;
|
||||
} Ctx;
|
||||
|
||||
Reference in New Issue
Block a user