BigW Consortium Gitlab

Commit 349109a4 by Gabor Committed by Kiss-Vamosi Gabor

lv_app_kb: LV_APP_KB_MODE_ANIM added

parent b7445f23
......@@ -15,6 +15,9 @@
/*********************
* DEFINES
*********************/
#ifndef LV_APP_KB_ANIM_TIME
#define LV_APP_KB_ANIM_TIME 300 /*ms*/
#endif
/**********************
* TYPEDEFS
......@@ -157,6 +160,11 @@ lv_obj_t * lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv
lv_ta_set_cursor_show(kb_ta, true);
}
if(kb_mode & LV_APP_KB_MODE_ANIM) {
lv_obj_anim(kb_btnm, LV_ANIM_FLOAT_BOTTOM | ANIM_IN, LV_APP_KB_ANIM_TIME, 0, NULL);
}
return kb_btnm;
}
......@@ -185,8 +193,12 @@ void lv_app_kb_close(bool ok)
if(kb_mode & LV_APP_KB_MODE_CURSOR_MANAGE) {
lv_ta_set_cursor_show(kb_ta, false);
}
lv_obj_del(kb_btnm);
if(kb_mode & LV_APP_KB_MODE_ANIM) {
lv_obj_anim(kb_btnm, LV_ANIM_FLOAT_BOTTOM | ANIM_OUT, LV_APP_KB_ANIM_TIME, 0, lv_obj_del);
} else {
lv_obj_del(kb_btnm);
}
kb_btnm = NULL;
kb_ta = NULL;
......
......@@ -21,10 +21,11 @@
**********************/
typedef enum
{
LV_APP_KB_MODE_TXT = 0x01,
LV_APP_KB_MODE_NUM = 0x02,
LV_APP_KB_MODE_WIN_RESIZE = 0x04,
LV_APP_KB_MODE_CURSOR_MANAGE = 0x08,
LV_APP_KB_MODE_TXT = 0x0001,
LV_APP_KB_MODE_NUM = 0x0002,
LV_APP_KB_MODE_WIN_RESIZE = 0x0004,
LV_APP_KB_MODE_CURSOR_MANAGE = 0x0008,
LV_APP_KB_MODE_ANIM = 0x0010,
}lv_app_kb_mode_t;
/**********************
......
......@@ -198,7 +198,7 @@
/*Keyboard*/
#define USE_LV_APP_KB 1
#if USE_LV_APP_KB != 0
/*No settings*/
#define LV_APP_KB_ANIM_TIME 300 /*ms*/
#endif
/*==================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment