mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-20 03:41:42 +03:00
[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:
parent
c27494ac39
commit
7981cb832e
@ -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);
|
nfc_protocol_support[protocol]->scene_saved_menu.on_enter(instance);
|
||||||
|
|
||||||
// Trailer submenu items
|
// Trailer submenu items
|
||||||
|
if(nfc_has_shadow_file(instance)) {
|
||||||
submenu_add_item(
|
submenu_add_item(
|
||||||
submenu,
|
submenu,
|
||||||
"Info",
|
"Restore to Original State",
|
||||||
SubmenuIndexCommonInfo,
|
SubmenuIndexCommonRestore,
|
||||||
nfc_protocol_support_common_submenu_callback,
|
nfc_protocol_support_common_submenu_callback,
|
||||||
instance);
|
instance);
|
||||||
|
}
|
||||||
|
|
||||||
submenu_add_item(
|
submenu_add_item(
|
||||||
submenu,
|
submenu,
|
||||||
"Rename",
|
"Rename",
|
||||||
@ -409,15 +412,12 @@ static void nfc_protocol_support_scene_saved_menu_on_enter(NfcApp* instance) {
|
|||||||
SubmenuIndexCommonDelete,
|
SubmenuIndexCommonDelete,
|
||||||
nfc_protocol_support_common_submenu_callback,
|
nfc_protocol_support_common_submenu_callback,
|
||||||
instance);
|
instance);
|
||||||
|
|
||||||
if(nfc_has_shadow_file(instance)) {
|
|
||||||
submenu_add_item(
|
submenu_add_item(
|
||||||
submenu,
|
submenu,
|
||||||
"Restore Data Changes",
|
"Info",
|
||||||
SubmenuIndexCommonRestore,
|
SubmenuIndexCommonInfo,
|
||||||
nfc_protocol_support_common_submenu_callback,
|
nfc_protocol_support_common_submenu_callback,
|
||||||
instance);
|
instance);
|
||||||
}
|
|
||||||
|
|
||||||
submenu_set_selected_item(
|
submenu_set_selected_item(
|
||||||
instance->submenu,
|
instance->submenu,
|
||||||
@ -582,9 +582,14 @@ static void nfc_protocol_support_scene_emulate_on_enter(NfcApp* instance) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
widget_add_string_element(widget, 90, 13, AlignCenter, AlignTop, FontPrimary, "Emulating");
|
widget_add_string_element(widget, 90, 13, AlignCenter, AlignTop, FontPrimary, "Emulating");
|
||||||
furi_string_set(
|
if(!furi_string_empty(instance->file_name)) {
|
||||||
temp_str, nfc_device_get_name(instance->nfc_device, NfcDeviceNameTypeFull));
|
furi_string_set(temp_str, instance->file_name);
|
||||||
furi_string_cat_printf(temp_str, "\n%s", furi_string_get_cstr(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(
|
widget_add_text_box_element(
|
||||||
|
@ -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);
|
scene_manager_get_scene_state(instance->scene_manager, NfcSceneMfClassicWriteInitial);
|
||||||
|
|
||||||
if(state == NfcSceneMfClassicWriteInitialStateCardSearch) {
|
if(state == NfcSceneMfClassicWriteInitialStateCardSearch) {
|
||||||
|
popup_set_header(instance->popup, "Writing", 95, 20, AlignCenter, AlignCenter);
|
||||||
popup_set_text(
|
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);
|
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
|
||||||
} else {
|
} else {
|
||||||
popup_set_header(popup, "Writing\nDon't move...", 52, 32, AlignLeft, AlignCenter);
|
popup_set_header(popup, "Writing\nDon't move...", 52, 32, AlignLeft, AlignCenter);
|
||||||
|
@ -46,8 +46,9 @@ static void nfc_scene_mf_ultralight_write_setup_view(NfcApp* instance) {
|
|||||||
scene_manager_get_scene_state(instance->scene_manager, NfcSceneMfUltralightWrite);
|
scene_manager_get_scene_state(instance->scene_manager, NfcSceneMfUltralightWrite);
|
||||||
|
|
||||||
if(state == NfcSceneMfUltralightWriteStateCardSearch) {
|
if(state == NfcSceneMfUltralightWriteStateCardSearch) {
|
||||||
|
popup_set_header(instance->popup, "Writing", 95, 20, AlignCenter, AlignCenter);
|
||||||
popup_set_text(
|
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);
|
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
|
||||||
} else {
|
} else {
|
||||||
popup_set_header(popup, "Writing\nDon't move...", 52, 32, AlignLeft, AlignCenter);
|
popup_set_header(popup, "Writing\nDon't move...", 52, 32, AlignLeft, AlignCenter);
|
||||||
|
Loading…
Reference in New Issue
Block a user