添加星期

在ShowCategory33Screen_ext中找到

switch (idle_screen_type)
    {
        case NORMAL_IDLE_SCREEN:
//#ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__//将代码解放出来,不用将定义宏代码
            set_main_LCD_dt_date_hide_function(cat33_hide_date_display);//重要的函数,需要解放出来cat33_hide_date_display
            analog_clock_initialize();
            set_main_LCD_dt_time_hide_function(dummy_dt_hide_function);
            set_main_LCD_day_hide_function(cat33_hide_day_string_display);//重要的函数需要解放
    set_dt_display(DT_IDLE_SCREEN);
//#else /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
          // set_main_LCD_dt_date_hide_function(dummy_dt_hide_function);
          // set_main_LCD_dt_time_hide_function(cat33_hide_time_display);
   // set_main_LCD_day_hide_function(cat33_hide_day_string_display);
//#endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
#if defined(__MMI_KLG__) || defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__)
            set_dt_display(DT_IDLE_SCREEN_2);
#else /* defined(__MMI_KLG__) || defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) */
            set_dt_display(DT_IDLE_SCREEN);
#endif /* defined(__MMI_KLG__) || defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) */
            break;

然后进入 set_dt_display函数中

 

        case DT_IDLE_SCREEN:
        {
            //if (PhnsetGetShowDateTimeStatus() == MMI_FALSE)//需要注释掉
           // {
           //     break; /* check if dispaly tiem date on idel screen is enabel or not */
           // }
            main_LCD_dt_object.flags = (flags & DT_FLAGS_TYPE);
            main_LCD_dt_object.date.hide_function = MMI_main_LCD_dt_date_hide_function;
            main_LCD_dt_object.time.hide_function = MMI_main_LCD_dt_time_hide_function;

   MMI_main_LCD_dt_hide_function = hide_main_LCD_date_time;    /* set function pointer of hide func of date time of main lcd */
            MMI_main_LCD_dt_display_function = show_main_LCD_date_time; /* set func piinter of show date time of main lcd */

        #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
            MMI_main_LCD_dt_update_function = update_main_LCD_date_time;
        #else
            MMI_main_LCD_dt_update_function = update_main_LCD_date_time;        /* set function of upadet date time of main lcd */
        #endif

            MMI_main_LCD_dt_update_function(); /* upadet date tiem *///更新时间,很重要
            enable_main_LCD_date_time_display = 0;
            MMI_main_LCD_dt_display_function(); /* display date tiem on main lcd */
            enable_main_LCD_date_time_display = 1;

查看下面函数代码
void update_main_LCD_date_time(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    GetDateTime(&main_LCD_dt_object.date.t);//获取星期的函数
    main_LCD_dt_object.time.t = main_LCD_dt_object.date.t;
//#ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
    set_day_display();//显示星期的函数
//#endif

    wgui_clock_update_main_lcd();
}

void set_day_display(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    day_string = get_string((U16) (STR_IDLESCREEN_SUNDAY + main_LCD_dt_object.date.t.DayIndex));
}


show_main_LCD_day_display需要释放宏
重点:记住转载STR_IDLESCREEN_SUNDAY字串的时候,需要释放宏

你可能感兴趣的:(UI,Date,String,function,ext,variables)