Explorar el Código

fix: remove startscreen

sc hace 2 años
padre
commit
9a83d5a9d2

+ 1 - 6
flipbip.c

@@ -118,11 +118,6 @@ FlipBip* flipbip_app_alloc() {
 
     view_dispatcher_add_view(
         app->view_dispatcher, FlipBipViewIdMenu, submenu_get_view(app->submenu));
-    app->flipbip_startscreen = flipbip_startscreen_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        FlipBipViewIdStartscreen,
-        flipbip_startscreen_get_view(app->flipbip_startscreen));
     app->flipbip_scene_1 = flipbip_scene_1_alloc();
     view_dispatcher_add_view(
         app->view_dispatcher, FlipBipViewIdScene1, flipbip_scene_1_get_view(app->flipbip_scene_1));
@@ -189,7 +184,7 @@ int32_t flipbip_app(void* p) {
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
 
     scene_manager_next_scene(
-        app->scene_manager, FlipBipSceneStartscreen); //Start with start screen
+        app->scene_manager, FlipBipSceneMenu); //Start with start screen
     //scene_manager_next_scene(app->scene_manager, FlipBipSceneMenu); //if you want to directly start with Menu
 
     furi_hal_power_suppress_charge_enter();

+ 0 - 2
flipbip.h

@@ -12,7 +12,6 @@
 #include <gui/modules/variable_item_list.h>
 #include <gui/modules/text_input.h>
 #include "scenes/flipbip_scene.h"
-#include "views/flipbip_startscreen.h"
 #include "views/flipbip_scene_1.h"
 
 #define FLIPBIP_VERSION "v1.12.0"
@@ -32,7 +31,6 @@ typedef struct {
     SceneManager* scene_manager;
     VariableItemList* variable_item_list;
     TextInput* text_input;
-    FlipBipStartscreen* flipbip_startscreen;
     FlipBipScene1* flipbip_scene_1;
     // Settings options
     int haptic;

BIN
icons/Auth_62x31.png


BIN
icons/ButtonCenter_7x7.png


BIN
icons/ButtonDown_10x5.png


BIN
icons/ButtonLeftSmall_3x5.png


BIN
icons/ButtonLeft_4x7.png


BIN
icons/ButtonRightSmall_3x5.png


BIN
icons/ButtonRight_4x7.png


BIN
icons/ButtonUp_10x5.png


+ 0 - 1
scenes/flipbip_scene_config.h

@@ -1,4 +1,3 @@
-ADD_SCENE(flipbip, startscreen, Startscreen)
 ADD_SCENE(flipbip, menu, Menu)
 ADD_SCENE(flipbip, scene_1, Scene_1)
 ADD_SCENE(flipbip, settings, Settings)

+ 0 - 55
scenes/flipbip_scene_startscreen.c

@@ -1,55 +0,0 @@
-#include "../flipbip.h"
-#include "../helpers/flipbip_custom_event.h"
-#include "../views/flipbip_startscreen.h"
-
-void flipbip_scene_startscreen_callback(FlipBipCustomEvent event, void* context) {
-    furi_assert(context);
-    FlipBip* app = context;
-    view_dispatcher_send_custom_event(app->view_dispatcher, event);
-}
-
-void flipbip_scene_startscreen_on_enter(void* context) {
-    furi_assert(context);
-    FlipBip* app = context;
-    flipbip_startscreen_set_callback(
-        app->flipbip_startscreen, flipbip_scene_startscreen_callback, app);
-    view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewIdStartscreen);
-}
-
-bool flipbip_scene_startscreen_on_event(void* context, SceneManagerEvent event) {
-    FlipBip* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        switch(event.event) {
-        case FlipBipCustomEventStartscreenLeft:
-        case FlipBipCustomEventStartscreenRight:
-            break;
-        case FlipBipCustomEventStartscreenUp:
-        case FlipBipCustomEventStartscreenDown:
-            break;
-        case FlipBipCustomEventStartscreenOk:
-            scene_manager_next_scene(app->scene_manager, FlipBipSceneMenu);
-            consumed = true;
-            break;
-        case FlipBipCustomEventStartscreenBack:
-            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, FlipBipSceneStartscreen)) {
-                scene_manager_stop(app->scene_manager);
-                view_dispatcher_stop(app->view_dispatcher);
-            }
-            consumed = true;
-            break;
-        }
-    }
-
-    return consumed;
-}
-
-void flipbip_scene_startscreen_on_exit(void* context) {
-    FlipBip* app = context;
-    UNUSED(app);
-}

+ 0 - 130
views/flipbip_startscreen.c

@@ -1,130 +0,0 @@
-#include "../flipbip.h"
-#include <furi.h>
-#include <furi_hal.h>
-#include <input/input.h>
-#include <gui/elements.h>
-#include "flipbip_icons.h"
-
-struct FlipBipStartscreen {
-    View* view;
-    FlipBipStartscreenCallback callback;
-    void* context;
-};
-
-typedef struct {
-    int some_value;
-} FlipBipStartscreenModel;
-
-void flipbip_startscreen_set_callback(
-    FlipBipStartscreen* instance,
-    FlipBipStartscreenCallback callback,
-    void* context) {
-    furi_assert(instance);
-    furi_assert(callback);
-    instance->callback = callback;
-    instance->context = context;
-}
-
-void flipbip_startscreen_draw(Canvas* canvas, FlipBipStartscreenModel* model) {
-    UNUSED(model);
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-
-    canvas_draw_icon(canvas, 1, 33, &I_Auth_62x31);
-
-    canvas_set_font(canvas, FontPrimary);
-    canvas_draw_str(canvas, 18, 11, "FlipBIP - BIP32/39/44");
-
-    canvas_set_font(canvas, FontSecondary);
-    canvas_draw_str(canvas, 23, 22, "Crypto toolkit for Flipper");
-    canvas_draw_str(canvas, 99, 34, FLIPBIP_VERSION);
-
-    elements_button_right(canvas, "Start");
-}
-
-static void flipbip_startscreen_model_init(FlipBipStartscreenModel* const model) {
-    model->some_value = 1;
-}
-
-bool flipbip_startscreen_input(InputEvent* event, void* context) {
-    furi_assert(context);
-    FlipBipStartscreen* instance = context;
-    if(event->type == InputTypeRelease) {
-        switch(event->key) {
-        case InputKeyBack:
-            with_view_model(
-                instance->view,
-                FlipBipStartscreenModel * model,
-                {
-                    UNUSED(model);
-                    instance->callback(FlipBipCustomEventStartscreenBack, instance->context);
-                },
-                true);
-            break;
-        case InputKeyLeft:
-        case InputKeyRight:
-        case InputKeyUp:
-        case InputKeyDown:
-        case InputKeyOk:
-            with_view_model(
-                instance->view,
-                FlipBipStartscreenModel * model,
-                {
-                    UNUSED(model);
-                    instance->callback(FlipBipCustomEventStartscreenOk, instance->context);
-                },
-                true);
-            break;
-        case InputKeyMAX:
-            break;
-        }
-    }
-    return true;
-}
-
-void flipbip_startscreen_exit(void* context) {
-    furi_assert(context);
-}
-
-void flipbip_startscreen_enter(void* context) {
-    furi_assert(context);
-    FlipBipStartscreen* instance = (FlipBipStartscreen*)context;
-    with_view_model(
-        instance->view,
-        FlipBipStartscreenModel * model,
-        { flipbip_startscreen_model_init(model); },
-        true);
-}
-
-FlipBipStartscreen* flipbip_startscreen_alloc() {
-    FlipBipStartscreen* instance = malloc(sizeof(FlipBipStartscreen));
-    instance->view = view_alloc();
-    view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(FlipBipStartscreenModel));
-    view_set_context(instance->view, instance); // furi_assert crashes in events without this
-    view_set_draw_callback(instance->view, (ViewDrawCallback)flipbip_startscreen_draw);
-    view_set_input_callback(instance->view, flipbip_startscreen_input);
-    //view_set_enter_callback(instance->view, flipbip_startscreen_enter);
-    //view_set_exit_callback(instance->view, flipbip_startscreen_exit);
-
-    with_view_model(
-        instance->view,
-        FlipBipStartscreenModel * model,
-        { flipbip_startscreen_model_init(model); },
-        true);
-
-    return instance;
-}
-
-void flipbip_startscreen_free(FlipBipStartscreen* instance) {
-    furi_assert(instance);
-
-    with_view_model(
-        instance->view, FlipBipStartscreenModel * model, { UNUSED(model); }, true);
-    view_free(instance->view);
-    free(instance);
-}
-
-View* flipbip_startscreen_get_view(FlipBipStartscreen* instance) {
-    furi_assert(instance);
-    return instance->view;
-}

+ 0 - 19
views/flipbip_startscreen.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#include <gui/view.h>
-#include "../helpers/flipbip_custom_event.h"
-
-typedef struct FlipBipStartscreen FlipBipStartscreen;
-
-typedef void (*FlipBipStartscreenCallback)(FlipBipCustomEvent event, void* context);
-
-void flipbip_startscreen_set_callback(
-    FlipBipStartscreen* flipbip_startscreen,
-    FlipBipStartscreenCallback callback,
-    void* context);
-
-View* flipbip_startscreen_get_view(FlipBipStartscreen* flipbip_static);
-
-FlipBipStartscreen* flipbip_startscreen_alloc();
-
-void flipbip_startscreen_free(FlipBipStartscreen* flipbip_static);