日历的提醒内容可以根据需要修改

129 篇文章 0 订阅
修改注意两方面:
1,reminder_buff 的长度:
2,显示内容:
如果需要在提醒中显示Details,请修改长度并在 mmi_tdl_entry_reminder 中添加一段代码,修改后如下:
1,reminder_buff 的长度:
#define MMI_TDL_MAX_REMINDER_NOTE_EN_SIZE     \
    (MMI_TDL_MAX_NOTE_EN_LEN + MMI_TDL_MAX_REMINDER_PREFIX_EN_LEN + MAX_TDL_LOCATION_SIZE * ENCODING_LENGTH)
2,显示内容:
void mmi_tdl_entry_reminder(void)
{
。。。。。。
    if (g_tdl_cntx.reminder_type == SRV_TDL_VCAL_TASK)
    {
        mmi_ucs2cpy(g_tdl_edit_cntx.reminder_buff, GetString(STR_GLOBAL_TIME));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_ID_CAL_COLON));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        date_string(&g_tdl_cntx.task_reminder.due_time, date_buff, DT_IDLE_SCREEN);
        time_string(&g_tdl_cntx.task_reminder.due_time, time_buff, DT_IDLE_SCREEN);
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)date_buff);
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)time_buff);    
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_GLOBAL_SUBJECT));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_ID_CAL_COLON));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)g_tdl_cntx.task_reminder.subject);
        memcpy(&alarm, &g_tdl_cntx.task_reminder.alarm, sizeof(srv_tdl_alarm_struct));
        //show details
        if (0 != mmi_ucs2strlen((S8*)g_tdl_cntx.event_reminder.details))
        {
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_GLOBAL_DETAILS));//
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_ID_CAL_COLON));
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*) g_tdl_cntx.event_reminder.details);
        }
    }
    else if (g_tdl_cntx.reminder_type == SRV_TDL_VCAL_EVENT)
    {
        mmi_tdl_set_fields(SRV_TDL_VCAL_EVENT, g_tdl_cntx.event_reminder.category);
        mmi_ucs2cpy(g_tdl_edit_cntx.reminder_buff, GetString(STR_GLOBAL_TIME));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_ID_CAL_COLON));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        date_string(&g_tdl_cntx.event_reminder.start_time, date_buff, DT_IDLE_SCREEN);
        time_string(&g_tdl_cntx.event_reminder.start_time, time_buff, DT_IDLE_SCREEN);
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)date_buff);
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)time_buff); 
        if (mmi_tdl_get_period_type() == MMI_TDL_FIELD_MASK_ALL_DATE)
        {
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"~");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            date_string(&g_tdl_cntx.event_reminder.end_time, (UI_string_type)date_buff, DT_IDLE_SCREEN);
            time_string(&g_tdl_cntx.event_reminder.end_time, (UI_string_type)time_buff, DT_IDLE_SCREEN);        
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)date_buff);
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)time_buff);        
        }
        
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_GLOBAL_SUBJECT));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_ID_CAL_COLON));
        mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
        mmi_ucs2ncat(
            g_tdl_edit_cntx.reminder_buff, 
            (S8*)g_tdl_cntx.event_reminder.subject,
            MAX_TODO_NOTE_LEN);
        memcpy(&alarm, &g_tdl_cntx.event_reminder.alarm, sizeof(srv_tdl_alarm_struct));   
        
        if (mmi_tdl_is_field_valid(MMI_TDL_FIELD_MASK_LOCATION) &&
            0 != mmi_ucs2strlen((S8*)g_tdl_cntx.event_reminder.location))
        {
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_TODO_LOCATION));
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_ID_CAL_COLON));
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*) g_tdl_cntx.event_reminder.location);
        }
        //show details
        if (0 != mmi_ucs2strlen((S8*)g_tdl_cntx.event_reminder.details))
        {
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_GLOBAL_DETAILS));//
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, GetString(STR_ID_CAL_COLON));
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*)L"\n");
            mmi_ucs2cat(g_tdl_edit_cntx.reminder_buff, (S8*) g_tdl_cntx.event_reminder.details);
        }
    
    }
    
    note_len = mmi_ucs2strlen(g_tdl_edit_cntx.reminder_buff);
。。。。。。
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值