[FL-2455] LFRFID, iButton: more-menu fix (#1151)

* Items order changed
* iButton,Rfid: correct order in enums

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Dmitry Pavlov 2022-04-22 22:01:21 +03:00 committed by GitHub
parent 7ed5b9053a
commit ec71a5c9d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -2,9 +2,9 @@
#include "../ibutton_app.h"
typedef enum {
SubmenuIndexWrite,
SubmenuIndexEmulate,
SubmenuIndexSave,
SubmenuIndexEmulate,
SubmenuIndexWrite,
} SubmenuIndex;
static void submenu_callback(void* context, uint32_t index) {
@ -22,11 +22,11 @@ void iButtonSceneReadKeyMenu::on_enter(iButtonApp* app) {
iButtonAppViewManager* view_manager = app->get_view_manager();
Submenu* submenu = view_manager->get_submenu();
submenu_add_item(submenu, "Save", SubmenuIndexSave, submenu_callback, app);
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, submenu_callback, app);
if(ibutton_key_get_type(app->get_key()) == iButtonKeyDS1990) {
submenu_add_item(submenu, "Write", SubmenuIndexWrite, submenu_callback, app);
}
submenu_add_item(submenu, "Save", SubmenuIndexSave, submenu_callback, app);
submenu_add_item(submenu, "Emulate", SubmenuIndexEmulate, submenu_callback, app);
submenu_set_selected_item(submenu, submenu_item_selected);
view_manager->switch_to(iButtonAppViewManager::Type::iButtonAppViewSubmenu);

View File

@ -1,17 +1,17 @@
#include "lfrfid_app_scene_read_menu.h"
typedef enum {
SubmenuWrite,
SubmenuSave,
SubmenuEmulate,
SubmenuWrite,
} SubmenuIndex;
void LfRfidAppSceneReadKeyMenu::on_enter(LfRfidApp* app, bool need_restore) {
auto submenu = app->view_controller.get<SubmenuVM>();
submenu->add_item("Write", SubmenuWrite, submenu_callback, app);
submenu->add_item("Save", SubmenuSave, submenu_callback, app);
submenu->add_item("Emulate", SubmenuEmulate, submenu_callback, app);
submenu->add_item("Write", SubmenuWrite, submenu_callback, app);
if(need_restore) {
submenu->set_selected_item(submenu_item_selected);