[FL-3678] NFC UI refactor (#3369)

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
MX 2024-01-19 23:24:03 +03:00
parent c27494ac39
commit 7981cb832e
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83
3 changed files with 27 additions and 20 deletions

View File

@ -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",
@ -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,
@ -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(

View File

@ -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);

View File

@ -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);