This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
316 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
applications/external/nfc_maker/scenes/nfc_maker_scene_config.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
applications/external/nfc_maker/scenes/nfc_maker_scene_contact.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "../nfc_maker.h" | ||
|
||
enum TextInputResult { | ||
TextInputResultOk, | ||
}; | ||
|
||
static void nfc_maker_scene_contact_text_input_callback(void* context) { | ||
NfcMaker* app = context; | ||
|
||
view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); | ||
} | ||
|
||
void nfc_maker_scene_contact_on_enter(void* context) { | ||
NfcMaker* app = context; | ||
TextInput* text_input = app->text_input; | ||
|
||
text_input_set_header_text(text_input, "Enter First Name:"); | ||
|
||
strlcpy(app->small_buf1, "Ben", SMALL_INPUT_LEN); | ||
|
||
text_input_set_result_callback( | ||
text_input, | ||
nfc_maker_scene_contact_text_input_callback, | ||
app, | ||
app->small_buf1, | ||
SMALL_INPUT_LEN, | ||
true); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); | ||
} | ||
|
||
bool nfc_maker_scene_contact_on_event(void* context, SceneManagerEvent event) { | ||
NfcMaker* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
consumed = true; | ||
switch(event.event) { | ||
case TextInputResultOk: | ||
scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactLast); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_maker_scene_contact_on_exit(void* context) { | ||
NfcMaker* app = context; | ||
text_input_reset(app->text_input); | ||
} |
55 changes: 55 additions & 0 deletions
55
applications/external/nfc_maker/scenes/nfc_maker_scene_contact_last.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "../nfc_maker.h" | ||
|
||
enum TextInputResult { | ||
TextInputResultOk, | ||
}; | ||
|
||
static void nfc_maker_scene_contact_last_text_input_callback(void* context) { | ||
NfcMaker* app = context; | ||
|
||
view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); | ||
} | ||
|
||
void nfc_maker_scene_contact_last_on_enter(void* context) { | ||
NfcMaker* app = context; | ||
TextInput* text_input = app->text_input; | ||
|
||
text_input_set_header_text(text_input, "Enter Last Name:"); | ||
|
||
strlcpy(app->small_buf2, "Dover", SMALL_INPUT_LEN); | ||
|
||
text_input_set_result_callback( | ||
text_input, | ||
nfc_maker_scene_contact_last_text_input_callback, | ||
app, | ||
app->small_buf2, | ||
SMALL_INPUT_LEN, | ||
true); | ||
|
||
text_input_set_minimum_length(text_input, 0); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); | ||
} | ||
|
||
bool nfc_maker_scene_contact_last_on_event(void* context, SceneManagerEvent event) { | ||
NfcMaker* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
consumed = true; | ||
switch(event.event) { | ||
case TextInputResultOk: | ||
scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactMail); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_maker_scene_contact_last_on_exit(void* context) { | ||
NfcMaker* app = context; | ||
text_input_reset(app->text_input); | ||
} |
55 changes: 55 additions & 0 deletions
55
applications/external/nfc_maker/scenes/nfc_maker_scene_contact_mail.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "../nfc_maker.h" | ||
|
||
enum TextInputResult { | ||
TextInputResultOk, | ||
}; | ||
|
||
static void nfc_maker_scene_contact_mail_text_input_callback(void* context) { | ||
NfcMaker* app = context; | ||
|
||
view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); | ||
} | ||
|
||
void nfc_maker_scene_contact_mail_on_enter(void* context) { | ||
NfcMaker* app = context; | ||
TextInput* text_input = app->text_input; | ||
|
||
text_input_set_header_text(text_input, "Enter Mail Address:"); | ||
|
||
strlcpy(app->mail_buf, "[email protected]", MAIL_INPUT_LEN); | ||
|
||
text_input_set_result_callback( | ||
text_input, | ||
nfc_maker_scene_contact_mail_text_input_callback, | ||
app, | ||
app->mail_buf, | ||
MAIL_INPUT_LEN, | ||
true); | ||
|
||
text_input_set_minimum_length(text_input, 0); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); | ||
} | ||
|
||
bool nfc_maker_scene_contact_mail_on_event(void* context, SceneManagerEvent event) { | ||
NfcMaker* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
consumed = true; | ||
switch(event.event) { | ||
case TextInputResultOk: | ||
scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactPhone); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_maker_scene_contact_mail_on_exit(void* context) { | ||
NfcMaker* app = context; | ||
text_input_reset(app->text_input); | ||
} |
55 changes: 55 additions & 0 deletions
55
applications/external/nfc_maker/scenes/nfc_maker_scene_contact_phone.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "../nfc_maker.h" | ||
|
||
enum TextInputResult { | ||
TextInputResultOk, | ||
}; | ||
|
||
static void nfc_maker_scene_contact_phone_text_input_callback(void* context) { | ||
NfcMaker* app = context; | ||
|
||
view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); | ||
} | ||
|
||
void nfc_maker_scene_contact_phone_on_enter(void* context) { | ||
NfcMaker* app = context; | ||
TextInput* text_input = app->text_input; | ||
|
||
text_input_set_header_text(text_input, "Enter Phone Number:"); | ||
|
||
strlcpy(app->phone_buf, "+", PHONE_INPUT_LEN); | ||
|
||
text_input_set_result_callback( | ||
text_input, | ||
nfc_maker_scene_contact_phone_text_input_callback, | ||
app, | ||
app->phone_buf, | ||
PHONE_INPUT_LEN, | ||
false); | ||
|
||
text_input_set_minimum_length(text_input, 0); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); | ||
} | ||
|
||
bool nfc_maker_scene_contact_phone_on_event(void* context, SceneManagerEvent event) { | ||
NfcMaker* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
consumed = true; | ||
switch(event.event) { | ||
case TextInputResultOk: | ||
scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactUrl); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_maker_scene_contact_phone_on_exit(void* context) { | ||
NfcMaker* app = context; | ||
text_input_reset(app->text_input); | ||
} |
55 changes: 55 additions & 0 deletions
55
applications/external/nfc_maker/scenes/nfc_maker_scene_contact_url.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "../nfc_maker.h" | ||
|
||
enum TextInputResult { | ||
TextInputResultOk, | ||
}; | ||
|
||
static void nfc_maker_scene_contact_url_text_input_callback(void* context) { | ||
NfcMaker* app = context; | ||
|
||
view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); | ||
} | ||
|
||
void nfc_maker_scene_contact_url_on_enter(void* context) { | ||
NfcMaker* app = context; | ||
TextInput* text_input = app->text_input; | ||
|
||
text_input_set_header_text(text_input, "Enter URL Link:"); | ||
|
||
strlcpy(app->big_buf, "flipper-xtre.me", BIG_INPUT_LEN); | ||
|
||
text_input_set_result_callback( | ||
text_input, | ||
nfc_maker_scene_contact_url_text_input_callback, | ||
app, | ||
app->big_buf, | ||
BIG_INPUT_LEN, | ||
true); | ||
|
||
text_input_set_minimum_length(text_input, 0); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); | ||
} | ||
|
||
bool nfc_maker_scene_contact_url_on_event(void* context, SceneManagerEvent event) { | ||
NfcMaker* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
consumed = true; | ||
switch(event.event) { | ||
case TextInputResultOk: | ||
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_maker_scene_contact_url_on_exit(void* context) { | ||
NfcMaker* app = context; | ||
text_input_reset(app->text_input); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters