mt2503UM2.0信息List界面双行显示
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
UM2.0信息List界面双行显示(UM2.0上才有,UM2.0平台的MP版本为09A.09.32,09B同样适用)
[SOLUTION]
1.1UM2.0信息List界面双行显示
1).在UMDefs.h中的MMI_um_ui_aprc_type_enum加入一个enum:
MMI_UM_UI_APRC_double_line_261
2).在UMApperance.c中的mmi_um_ui_aprc_set_cntx中加入双行显示的case:
MMI_BOOLmmi_um_ui_aprc_set_cntx(mmi_um_ui_aprc_node_struct*aprc_node,
mmi_um_ui_aprc_type_enumaprc_type)
{
...
caseMMI_UM_UI_APRC_double_line_261:
{
aprc_node->type=aprc_type;
aprc_node->draw_func=mmi_um_ui_aprc_double_line_261_draw;
aprc_node->redraw_func=mmi_um_ui_aprc_double_line_261_redraw;
break;
}
…
}
3).在进入inbox时mmi_um_ui_if_entry_inbox中设置setting.aprc_type=MMI_UM_UI_APRC_double_line_261,对于outbox/drafts等中设置是一样的。
4).在UMScrHdlr.c中mmi_um_ui_sh_general_folder_entry修改:
voidmmi_um_ui_sh_general_folder_entry(void*arg)
{
…
switch(scrn_cntx->aprc.type)
{
caseMMI_UM_UI_APRC_double_line_261:
{
mmi_um_ui_aprc_268_struct*aprc_268;
aprc_268=&(aprc_cntx.aprc_268);
/*Generalcontext*/
meMCPy(&(aprc_268->general_aprc_cntx),&aprc_general_cntx,sizeof(mmi_um_ui_aprc_general_cntx_struct));
/*Specifiedcontext*/
aprc_268->get_item_cb=mmi_um_ui_sh_general_folder_get_async_item;
aprc_268->get_item_hint_cb=NULL;
aprc_268->hilite_notify_cb=mmi_um_ui_sh_general_folder_notify_highlight;
scrn_cntx->screen_hdlr.is_scrn_displayed=scrn_cntx->aprc.draw_func(&aprc_cntx);
#ifdef__MMI_UI_SMALL_SCREEN_SUPPORT__
if(mmi_is_redrawing_bk_screens()==TRUE)
{
return;
}
#endif/*__MMI_UI_SMALL_SCREEN_SUPPORT__*/
/*Afterdrawing,thechildshouldberemoved*/
mmi_um_ui_ut_del_relative_scrn(&(scrn_cntx->child_scrn_id));
/*Duetothecategoryusage,itshouldcheckthescreenisdisplayedornot*/
if(scrn_cntx->screen_hdlr.is_scrn_displayed==MMI_FALSE)
{
mmi_um_ui_cc_send_event(scrn_cntx->scrn_id,MMI_UM_UI_EVENT_CHECK,NULL);
}
break;
}
….
}
}
5).在UMScrHdlr.c中修改:
S32mmi_um_ui_sh_get_async_item(S32start_index,gui_iconlist_menu_item*menu_data,S32num_of_item)
{
…
for(i=0;i<num_of_item;i++)
{
/*MAX_SUBMENU_CHARACTERSisthemaxlimitationoflistbufferincategory*/
/*subject*/
copy_len=MAX_SUBMENU_CHARACTERS;
if(msg_detail_info->subject_length<MAX_SUBMENU_CHARACTERS)
{
copy_len=msg_detail_info->subject_length;
}
if(copy_len==0)
{
mmi_ucs2ncpy(
(S8*)menu_data.item_list[1],
(S8*)GetString(STR_UM_EMPTY_SUBJECT_ID),
MMI_UM_MAX_SUBJECT_LEN);
}
else
{
mmi_ucs2ncpy(
(S8*)menu_data.item_list[1],
(S8*)msg_detail_info->subject,
copy_len);
}
/*address*/
if(msg_detail_info->address_length==0)
{
mmi_ucs2ncpy(
(S8*)menu_data.item_list[0],(S8*)GetString(STR_OUTBOX_LIST_MESSAGE),
MMI_UM_MAX_SUBJECT_LEN);
}
else
{
/*Lookupnamefirstifitisphonenumber*/
phb_name=NULL;
/*SMSorMMS*/
if(MMI_UM_MSG_SMS==data_list->data_list_table[start_index+i].msg_type||
MMI_UM_MSG_MMS==data_list->data_list_table[start_index+i].msg_type)
{
if(UM_ADDR_TYPE_PHONE_NUMBER==msg_detail_info->address_type)
{
phb_name=lookUpNumber((PS8)msg_detail_info->address);
if(0==mmi_ucs2strlen(phb_name))
{
/*findthenumberinphonebookbutthereisnoname*/
phb_name=NULL;
}
}
}
if(NULL==phb_name)
{
phb_name=(PS8)msg_detail_info->address;
}
copy_len=MAX_SUBMENU_CHARACTERS-1;
if(mmi_ucs2strlen((S8*)phb_name)<copy_len)
{
copy_len=mmi_ucs2strlen((S8*)phb_name);
}
mmi_ucs2ncpy(
(S8*)menu_data.item_list[0],
(S8*)phb_name,
copy_len);
}
}
6).最终效果实现图如下:
UM2.0信息List界面双行显示(UM2.0上才有,UM2.0平台的MP版本为09A.09.32,09B同样适用)
[SOLUTION]
1.1UM2.0信息List界面双行显示
1).在UMDefs.h中的MMI_um_ui_aprc_type_enum加入一个enum:
MMI_UM_UI_APRC_double_line_261
2).在UMApperance.c中的mmi_um_ui_aprc_set_cntx中加入双行显示的case:
MMI_BOOLmmi_um_ui_aprc_set_cntx(mmi_um_ui_aprc_node_struct*aprc_node,
mmi_um_ui_aprc_type_enumaprc_type)
{
...
caseMMI_UM_UI_APRC_double_line_261:
{
aprc_node->type=aprc_type;
aprc_node->draw_func=mmi_um_ui_aprc_double_line_261_draw;
aprc_node->redraw_func=mmi_um_ui_aprc_double_line_261_redraw;
break;
}
…
}
3).在进入inbox时mmi_um_ui_if_entry_inbox中设置setting.aprc_type=MMI_UM_UI_APRC_double_line_261,对于outbox/drafts等中设置是一样的。
4).在UMScrHdlr.c中mmi_um_ui_sh_general_folder_entry修改:
voidmmi_um_ui_sh_general_folder_entry(void*arg)
{
…
switch(scrn_cntx->aprc.type)
{
caseMMI_UM_UI_APRC_double_line_261:
{
mmi_um_ui_aprc_268_struct*aprc_268;
aprc_268=&(aprc_cntx.aprc_268);
/*Generalcontext*/
meMCPy(&(aprc_268->general_aprc_cntx),&aprc_general_cntx,sizeof(mmi_um_ui_aprc_general_cntx_struct));
/*Specifiedcontext*/
aprc_268->get_item_cb=mmi_um_ui_sh_general_folder_get_async_item;
aprc_268->get_item_hint_cb=NULL;
aprc_268->hilite_notify_cb=mmi_um_ui_sh_general_folder_notify_highlight;
scrn_cntx->screen_hdlr.is_scrn_displayed=scrn_cntx->aprc.draw_func(&aprc_cntx);
#ifdef__MMI_UI_SMALL_SCREEN_SUPPORT__
if(mmi_is_redrawing_bk_screens()==TRUE)
{
return;
}
#endif/*__MMI_UI_SMALL_SCREEN_SUPPORT__*/
/*Afterdrawing,thechildshouldberemoved*/
mmi_um_ui_ut_del_relative_scrn(&(scrn_cntx->child_scrn_id));
/*Duetothecategoryusage,itshouldcheckthescreenisdisplayedornot*/
if(scrn_cntx->screen_hdlr.is_scrn_displayed==MMI_FALSE)
{
mmi_um_ui_cc_send_event(scrn_cntx->scrn_id,MMI_UM_UI_EVENT_CHECK,NULL);
}
break;
}
….
}
}
5).在UMScrHdlr.c中修改:
S32mmi_um_ui_sh_get_async_item(S32start_index,gui_iconlist_menu_item*menu_data,S32num_of_item)
{
…
for(i=0;i<num_of_item;i++)
{
/*MAX_SUBMENU_CHARACTERSisthemaxlimitationoflistbufferincategory*/
/*subject*/
copy_len=MAX_SUBMENU_CHARACTERS;
if(msg_detail_info->subject_length<MAX_SUBMENU_CHARACTERS)
{
copy_len=msg_detail_info->subject_length;
}
if(copy_len==0)
{
mmi_ucs2ncpy(
(S8*)menu_data.item_list[1],
(S8*)GetString(STR_UM_EMPTY_SUBJECT_ID),
MMI_UM_MAX_SUBJECT_LEN);
}
else
{
mmi_ucs2ncpy(
(S8*)menu_data.item_list[1],
(S8*)msg_detail_info->subject,
copy_len);
}
/*address*/
if(msg_detail_info->address_length==0)
{
mmi_ucs2ncpy(
(S8*)menu_data.item_list[0],(S8*)GetString(STR_OUTBOX_LIST_MESSAGE),
MMI_UM_MAX_SUBJECT_LEN);
}
else
{
/*Lookupnamefirstifitisphonenumber*/
phb_name=NULL;
/*SMSorMMS*/
if(MMI_UM_MSG_SMS==data_list->data_list_table[start_index+i].msg_type||
MMI_UM_MSG_MMS==data_list->data_list_table[start_index+i].msg_type)
{
if(UM_ADDR_TYPE_PHONE_NUMBER==msg_detail_info->address_type)
{
phb_name=lookUpNumber((PS8)msg_detail_info->address);
if(0==mmi_ucs2strlen(phb_name))
{
/*findthenumberinphonebookbutthereisnoname*/
phb_name=NULL;
}
}
}
if(NULL==phb_name)
{
phb_name=(PS8)msg_detail_info->address;
}
copy_len=MAX_SUBMENU_CHARACTERS-1;
if(mmi_ucs2strlen((S8*)phb_name)<copy_len)
{
copy_len=mmi_ucs2strlen((S8*)phb_name);
}
mmi_ucs2ncpy(
(S8*)menu_data.item_list[0],
(S8*)phb_name,
copy_len);
}
}
6).最终效果实现图如下: