Skip to content

Commit

Permalink
[FL-3678] NFC UI refactor (flipperdevices#3369)
Browse files Browse the repository at this point in the history
Co-authored-by: あく <[email protected]>
Co-authored-by: gornekich <[email protected]>
  • Loading branch information
3 people committed Jan 19, 2024
1 parent c27494a commit 7981cb8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,15 @@ static void nfc_protocol_support_scene_saved_menu_on_enter(NfcApp* instance) {
nfc_protocol_support[protocol]->scene_saved_menu.on_enter(instance);

// Trailer submenu items
submenu_add_item(
submenu,
"Info",
SubmenuIndexCommonInfo,
nfc_protocol_support_common_submenu_callback,
instance);
if(nfc_has_shadow_file(instance)) {
submenu_add_item(
submenu,
"Restore to Original State",
SubmenuIndexCommonRestore,
nfc_protocol_support_common_submenu_callback,
instance);
}

submenu_add_item(
submenu,
"Rename",
Expand All @@ -409,15 +412,12 @@ static void nfc_protocol_support_scene_saved_menu_on_enter(NfcApp* instance) {
SubmenuIndexCommonDelete,
nfc_protocol_support_common_submenu_callback,
instance);

if(nfc_has_shadow_file(instance)) {
submenu_add_item(
submenu,
"Restore Data Changes",
SubmenuIndexCommonRestore,
nfc_protocol_support_common_submenu_callback,
instance);
}
submenu_add_item(
submenu,
"Info",
SubmenuIndexCommonInfo,
nfc_protocol_support_common_submenu_callback,
instance);

submenu_set_selected_item(
instance->submenu,
Expand Down Expand Up @@ -582,9 +582,14 @@ static void nfc_protocol_support_scene_emulate_on_enter(NfcApp* instance) {

} else {
widget_add_string_element(widget, 90, 13, AlignCenter, AlignTop, FontPrimary, "Emulating");
furi_string_set(
temp_str, nfc_device_get_name(instance->nfc_device, NfcDeviceNameTypeFull));
furi_string_cat_printf(temp_str, "\n%s", furi_string_get_cstr(instance->file_name));
if(!furi_string_empty(instance->file_name)) {
furi_string_set(temp_str, instance->file_name);
} else {
furi_string_printf(
temp_str,
"Unsaved\n%s",
nfc_device_get_name(instance->nfc_device, NfcDeviceNameTypeFull));
}
}

widget_add_text_box_element(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ static void nfc_scene_mf_classic_write_initial_setup_view(NfcApp* instance) {
scene_manager_get_scene_state(instance->scene_manager, NfcSceneMfClassicWriteInitial);

if(state == NfcSceneMfClassicWriteInitialStateCardSearch) {
popup_set_header(instance->popup, "Writing", 95, 20, AlignCenter, AlignCenter);
popup_set_text(
instance->popup, "Apply the initial\ncard only", 128, 32, AlignRight, AlignCenter);
instance->popup, "Apply the initial\ncard only", 95, 38, AlignCenter, AlignCenter);
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
} else {
popup_set_header(popup, "Writing\nDon't move...", 52, 32, AlignLeft, AlignCenter);
Expand Down
3 changes: 2 additions & 1 deletion applications/main/nfc/scenes/nfc_scene_mf_ultralight_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ static void nfc_scene_mf_ultralight_write_setup_view(NfcApp* instance) {
scene_manager_get_scene_state(instance->scene_manager, NfcSceneMfUltralightWrite);

if(state == NfcSceneMfUltralightWriteStateCardSearch) {
popup_set_header(instance->popup, "Writing", 95, 20, AlignCenter, AlignCenter);
popup_set_text(
instance->popup, "Apply the initial\ncard only", 128, 32, AlignRight, AlignCenter);
instance->popup, "Apply the initial\ncard only", 95, 38, AlignCenter, AlignCenter);
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
} else {
popup_set_header(popup, "Writing\nDon't move...", 52, 32, AlignLeft, AlignCenter);
Expand Down

0 comments on commit 7981cb8

Please sign in to comment.