-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add screen where user can type pin number
- Loading branch information
1 parent
48d442c
commit e5a921e
Showing
6 changed files
with
111 additions
and
15 deletions.
There are no files selected for viewing
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,46 @@ | ||
// This file was generated by SquareLine Studio | ||
// SquareLine Studio version: SquareLine Studio 1.3.4 | ||
// LVGL version: 8.3.6 | ||
// Project name: SquareLine_Project | ||
|
||
#include "../ui.h" | ||
|
||
void ui_pin_screen_screen_init(void) { | ||
ui_pin_screen = lv_obj_create(NULL); | ||
lv_obj_add_flag( ui_pin_screen, LV_OBJ_FLAG_SCROLLABLE); | ||
lv_obj_set_scrollbar_mode(ui_pin_screen, LV_SCROLLBAR_MODE_OFF); | ||
lv_obj_set_style_bg_color(ui_pin_screen, lv_color_make(12, 18, 30), LV_PART_MAIN | LV_STATE_DEFAULT ); | ||
lv_obj_set_style_bg_opa(ui_pin_screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT); | ||
lv_obj_set_style_pad_all(ui_pin_screen, 5, LV_PART_MAIN | LV_STATE_DEFAULT); | ||
lv_obj_set_flex_flow(ui_pin_screen, LV_FLEX_FLOW_COLUMN); | ||
lv_obj_set_flex_align(ui_pin_screen, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START); | ||
lv_obj_set_layout(ui_pin_screen, LV_LAYOUT_FLEX); | ||
|
||
|
||
lv_obj_t* ui_pin_textarea = lv_textarea_create(ui_pin_screen); | ||
lv_textarea_set_text(ui_pin_textarea, ""); | ||
lv_textarea_set_max_length(ui_pin_textarea, PIN_LENGTH); | ||
lv_textarea_set_one_line(ui_pin_textarea, true); | ||
lv_textarea_set_password_mode(ui_pin_textarea, true); | ||
lv_obj_align(ui_pin_textarea, LV_ALIGN_TOP_LEFT, 0, 0); | ||
lv_obj_set_pos(ui_pin_textarea, 0, 0); | ||
lv_obj_set_width(ui_pin_textarea, LV_HOR_RES - 10); | ||
lv_obj_set_height(ui_pin_textarea, 40); | ||
|
||
|
||
static const char* btnm_map[] = { | ||
"1", "2", "3", "4", "5", "\n", | ||
"6", "7", "8", "9", "0", "\n", | ||
"OK", "Delete", "" | ||
}; | ||
lv_obj_t* keyboard = lv_btnmatrix_create(ui_pin_screen); | ||
lv_btnmatrix_set_map(keyboard, btnm_map); | ||
lv_obj_set_width(keyboard, LV_HOR_RES - 10); | ||
lv_obj_set_flex_grow(keyboard, 1); | ||
lv_obj_align(keyboard, LV_ALIGN_CENTER, 0, 0); | ||
|
||
lv_obj_add_event_cb(keyboard, ui_event_keyboard_button, LV_EVENT_ALL, NULL); | ||
} | ||
|
||
|
||
|
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
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
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