[FL-1371][FL-1502] Lfrfid app: fixes. (#555)

* Gui module byte-input: changed api
* Gui: changed font height in multiline text according to guideline
* Apps lrfid, nfc: changed send and receive icon
* App lfrfid: fix text, fix scene switсh
* Elements: multiline text framed, fix paddings
* Gui: remove duplicate definition of elements_multiline_text_framed
* App NFC: update byte_input callback signature
* App subghz: fix text lines in capture scene
* App subghz: position of the text is aligned with the guidelines and other scenes
* App subghz: removed mockup

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
SG
2021-07-05 02:01:16 +10:00
committed by GitHub
parent f82a4a2260
commit 7734fb4018
33 changed files with 725 additions and 726 deletions

View File

@@ -11,13 +11,13 @@ void LfRfidAppSceneEmulate::on_enter(LfRfidApp* app, bool need_restore) {
auto popup = app->view_controller.get<PopupVM>();
popup->set_header("LF emulating", 89, 30, AlignCenter, AlignTop);
popup->set_header("Emulating", 89, 30, AlignCenter, AlignTop);
if(strlen(app->worker.key.get_name())) {
popup->set_text(app->worker.key.get_name(), 89, 43, AlignCenter, AlignTop);
} else {
popup->set_text(string_get_cstr(data_string), 89, 43, AlignCenter, AlignTop);
}
popup->set_icon(0, 4, I_RFIDDolphinSend_98x60);
popup->set_icon(0, 3, I_RFIDDolphinSend_97x61);
app->view_controller.switch_to<PopupVM>();
app->worker.start_emulate();

View File

@@ -3,8 +3,8 @@
void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool need_restore) {
auto popup = app->view_controller.get<PopupVM>();
popup->set_header("Reading\nLF RFID", 70, 34, AlignLeft, AlignTop);
popup->set_icon(0, 4, I_RFIDDolphinReceive_98x60);
popup->set_header("Reading\nLF RFID", 89, 34, AlignCenter, AlignTop);
popup->set_icon(0, 3, I_RFIDDolphinReceive_97x61);
app->view_controller.switch_to<PopupVM>();
app->worker.start_read();

View File

@@ -50,7 +50,7 @@ void LfRfidAppSceneSaveData::on_exit(LfRfidApp* app) {
app->view_controller.get<ByteInputVM>()->clean();
}
void LfRfidAppSceneSaveData::save_callback(void* context, uint8_t* bytes, uint8_t bytes_count) {
void LfRfidAppSceneSaveData::save_callback(void* context) {
LfRfidApp* app = static_cast<LfRfidApp*>(context);
LfRfidApp::Event event;
event.type = LfRfidApp::EventType::Next;

View File

@@ -8,7 +8,7 @@ public:
void on_exit(LfRfidApp* app) final;
private:
static void save_callback(void* context, uint8_t* bytes, uint8_t bytes_count);
static void save_callback(void* context);
uint8_t old_key_data[LFRFID_KEY_SIZE] = {
0xAA,
0xAA,

View File

@@ -18,7 +18,7 @@ bool LfRfidAppSceneWriteSuccess::on_event(LfRfidApp* app, LfRfidApp::Event* even
if(event->type == LfRfidApp::EventType::Back) {
app->scene_controller.search_and_switch_to_previous_scene(
{LfRfidApp::SceneType::ReadedMenu});
{LfRfidApp::SceneType::ReadedMenu, LfRfidApp::SceneType::SelectKey});
consumed = true;
}

View File

@@ -12,13 +12,13 @@ void LfRfidAppSceneWrite::on_enter(LfRfidApp* app, bool need_restore) {
auto popup = app->view_controller.get<PopupVM>();
popup->set_header("LF writing", 89, 30, AlignCenter, AlignTop);
popup->set_header("Writing", 89, 30, AlignCenter, AlignTop);
if(strlen(app->worker.key.get_name())) {
popup->set_text(app->worker.key.get_name(), 89, 43, AlignCenter, AlignTop);
} else {
popup->set_text(string_get_cstr(data_string), 89, 43, AlignCenter, AlignTop);
}
popup->set_icon(0, 4, I_RFIDDolphinSend_98x60);
popup->set_icon(0, 3, I_RFIDDolphinSend_97x61);
app->view_controller.switch_to<PopupVM>();
app->worker.start_write();

View File

@@ -1,4 +1,5 @@
#include "string-element.h"
#include <gui/elements.h>
StringElement::StringElement() {
}
@@ -9,7 +10,7 @@ StringElement::~StringElement() {
void StringElement::draw(Canvas* canvas) {
if(text) {
canvas_set_font(canvas, font);
canvas_draw_str_aligned(canvas, x, y, horizontal, vertical, text);
elements_multiline_text_aligned(canvas, x, y, horizontal, vertical, text);
}
}