From: CCC <2393524978@qq.com> Date: Tue, 10 Oct 2023 09:56:04 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=e19fb1d5564998b6dca972f32397ddf792005942;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c b/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c index ac47c2b1..ad5f24b9 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c @@ -1214,8 +1214,14 @@ static void mmi_phonebook_contacts_list_create(lv_obj_t * obj, nv_watch_phoneboo lv_page_set_edge_flash(list, true); lv_obj_add_style(list, LV_LIST_PART_EDGE_FLASH, &lv_watch_cont_opa1); lv_obj_add_style(list, LV_LIST_PART_BG, &lv_watch_style_transp); +#ifdef USE_LV_WATCH_UI_240_240_CIRCLE + lv_obj_set_size(list, LV_HOR_RES - 40, LV_VER_RES - 40 - 20); + lv_obj_align(list, label_title, LV_ALIGN_OUT_BOTTOM_MID, 0, 5); // 0); +#else lv_obj_set_size(list, LV_HOR_RES, LV_VER_RES - 40); lv_obj_align(list, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0); +#endif + lv_list_set_scrollbar_mode(list, LV_SCROLLBAR_MODE_OFF); lv_watch_obj_add_element(list); ext->list = list; @@ -1401,6 +1407,50 @@ void mmi_phonebook_contact_list_set(app_adaptor_contact_t * contact_list, uint8_ lv_mem_free(nvm_contact_list); } + + +static nv_watch_switch_t s_white_list_switch = {0}; + +void mmi_white_list_switch_nv_write(void) +{ + uint32_t nv_data_length = sizeof(nv_watch_switch_t); + + if(nv_data_length != UI_NV_Write_Req(NV_SECTION_UI_WHITE_LIST_SWITCH, 0, nv_data_length, (uint8_t *)&s_white_list_switch)) + { + printf("[@CHENG_DEBUG][%s][%d]: nv write fail\n", __FUNCTION__, __LINE__); + } +} + +void mmi_white_list_switch_nv_read(void) +{ + uint32_t nv_data_length = sizeof(nv_watch_switch_t); + + if(nv_data_length != UI_NV_Read_Req(NV_SECTION_UI_WHITE_LIST_SWITCH, 0, nv_data_length, (uint8_t *)&s_white_list_switch)) + { + printf("[@CHENG_DEBUG][%s][%d]: nv read fail\n", __FUNCTION__, __LINE__); + } +} + +void mmi_white_list_switch_nv_default(nv_watch_switch_t * data) +{ + data->switch_flag = MMI_WHITE_LIST_SWITCH_DEFAULT; +} + +// 0-close; 1-open +uint8_t mmi_white_list_switch_get(void) +{ + return (s_white_list_switch.switch_flag); +} + +void mmi_white_list_switch_set(uint8_t value) +{ + if(0 == value || 1 == value) + { + s_white_list_switch.switch_flag = value; + mmi_white_list_switch_nv_write(); + } +} + #endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.h b/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.h index c01bb980..09b52a91 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.h @@ -93,6 +93,13 @@ typedef struct #endif void mmi_phonebook_contact_list_set(app_adaptor_contact_t * contact_list, uint8_t count); + +void mmi_white_list_switch_nv_read(void); +void mmi_white_list_switch_nv_default(nv_watch_switch_t * data); +// 0-close; 1-open +uint8_t mmi_white_list_switch_get(void); +void mmi_white_list_switch_set(uint8_t value); + #endif