nfc maker - add keyboard

This commit is contained in:
MX
2023-07-08 19:52:04 +03:00
parent 7e14f997e7
commit 0109361fe9
22 changed files with 966 additions and 39 deletions

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_https_text_input_callback(void* context) {
void nfc_maker_scene_https_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Enter HTTPS Link:");
nfc_maker_text_input_set_header_text(text_input, "Enter HTTPS Link:");
strlcpy(app->text_buf, "google.com", TEXT_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_https_text_input_callback,
app,
@@ -49,5 +49,5 @@ bool nfc_maker_scene_https_on_event(void* context, SceneManagerEvent event) {
void nfc_maker_scene_https_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_mail_text_input_callback(void* context) {
void nfc_maker_scene_mail_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Enter EMail Address:");
nfc_maker_text_input_set_header_text(text_input, "Enter Email Address:");
strlcpy(app->text_buf, "ben.dover@example.com", TEXT_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_mail_text_input_callback,
app,
@@ -49,5 +49,5 @@ bool nfc_maker_scene_mail_on_event(void* context, SceneManagerEvent event) {
void nfc_maker_scene_mail_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}

View File

@@ -22,7 +22,7 @@ void nfc_maker_scene_menu_on_enter(void* context) {
submenu, "HTTPS Link", NfcMakerSceneHttps, nfc_maker_scene_menu_submenu_callback, app);
submenu_add_item(
submenu, "Mail Address", NfcMakerSceneMail, nfc_maker_scene_menu_submenu_callback, app);
submenu, "Email Address", NfcMakerSceneMail, nfc_maker_scene_menu_submenu_callback, app);
submenu_add_item(
submenu, "Phone Number", NfcMakerScenePhone, nfc_maker_scene_menu_submenu_callback, app);

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_name_text_input_callback(void* context) {
void nfc_maker_scene_name_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Name the NFC tag:");
nfc_maker_text_input_set_header_text(text_input, "Name the NFC tag:");
set_random_name(app->name_buf, TEXT_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_name_text_input_callback,
app,
@@ -28,7 +28,7 @@ void nfc_maker_scene_name_on_enter(void* context) {
ValidatorIsFile* validator_is_file =
validator_is_file_alloc_init(NFC_APP_FOLDER, NFC_APP_EXTENSION, NULL);
text_input_set_validator(text_input, validator_is_file_callback, validator_is_file);
nfc_maker_text_input_set_validator(text_input, validator_is_file_callback, validator_is_file);
view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput);
}
@@ -53,5 +53,5 @@ bool nfc_maker_scene_name_on_event(void* context, SceneManagerEvent event) {
void nfc_maker_scene_name_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_phone_text_input_callback(void* context) {
void nfc_maker_scene_phone_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Enter Phone Number:");
nfc_maker_text_input_set_header_text(text_input, "Enter Phone Number:");
strlcpy(app->text_buf, "+", TEXT_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_phone_text_input_callback,
app,
@@ -49,5 +49,5 @@ bool nfc_maker_scene_phone_on_event(void* context, SceneManagerEvent event) {
void nfc_maker_scene_phone_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_text_text_input_callback(void* context) {
void nfc_maker_scene_text_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Enter Text Note:");
nfc_maker_text_input_set_header_text(text_input, "Enter Text Note:");
strlcpy(app->text_buf, "Lorem ipsum", TEXT_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_text_text_input_callback,
app,
@@ -49,5 +49,5 @@ bool nfc_maker_scene_text_on_event(void* context, SceneManagerEvent event) {
void nfc_maker_scene_text_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_url_text_input_callback(void* context) {
void nfc_maker_scene_url_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Enter Plain URL:");
nfc_maker_text_input_set_header_text(text_input, "Enter Plain URL:");
strlcpy(app->text_buf, "https://google.com", TEXT_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_url_text_input_callback,
app,
@@ -49,5 +49,5 @@ bool nfc_maker_scene_url_on_event(void* context, SceneManagerEvent event) {
void nfc_maker_scene_url_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_wifi_text_input_callback(void* context) {
void nfc_maker_scene_wifi_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Enter WiFi SSID:");
nfc_maker_text_input_set_header_text(text_input, "Enter WiFi SSID:");
strlcpy(app->text_buf, "Bill Wi the Science Fi", WIFI_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_wifi_text_input_callback,
app,
@@ -51,5 +51,5 @@ bool nfc_maker_scene_wifi_on_event(void* context, SceneManagerEvent event) {
void nfc_maker_scene_wifi_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}

View File

@@ -12,13 +12,13 @@ static void nfc_maker_scene_wifi_pass_text_input_callback(void* context) {
void nfc_maker_scene_wifi_pass_on_enter(void* context) {
NfcMaker* app = context;
TextInput* text_input = app->text_input;
NFCMaker_TextInput* text_input = app->text_input;
text_input_set_header_text(text_input, "Enter WiFi Password:");
nfc_maker_text_input_set_header_text(text_input, "Enter WiFi Password:");
strlcpy(app->pass_buf, "244466666", WIFI_INPUT_LEN);
text_input_set_result_callback(
nfc_maker_text_input_set_result_callback(
text_input,
nfc_maker_scene_wifi_pass_text_input_callback,
app,
@@ -49,5 +49,5 @@ bool nfc_maker_scene_wifi_pass_on_event(void* context, SceneManagerEvent event)
void nfc_maker_scene_wifi_pass_on_exit(void* context) {
NfcMaker* app = context;
text_input_reset(app->text_input);
nfc_maker_text_input_reset(app->text_input);
}