目录

DvNotification

Class Info

public class DvNotification

该类为消息通知的消息属性定义类,提供消息通知的相关属性设置接口及属性常量定义。

本能力需要DV Engine版本在1.0.2.300及以上才支持。

Public Field Summary

Qualifier and Type

Field and Description

public static final String

KEY_PACKAGE_NAME

public static final String

KEY_TEMPLATE

public static final String

KEY_ICON_INDEX

public static final String

KEY_TITLE

public static final String

KEY_SUBTITLE

public static final String

KEY_CONTENT

public static final String

KEY_DATE

public static final String

KEY_GUIDE_DISTANCE

public static final String

KEY_DISTANCE_UNIT

public static final String

KEY_DIRECTION_INDEX

public static final String

KEY_GUIDE_TEXT

public static final String

KEY_VIBRATE

public static final int

COMMON_LAYOUT_TEMPLATE

public static final int

GUIDE_LAYOUT_TEMPLATE

Constants

[h2]KEY_PACKAGE_NAME

Field

public static final String KEY_PACKAGE_NAME

发送消息的应用包名对应的属性,必选参数。

另请参阅:Constant-values。

[h2]KEY_TEMPLATE

Field

public static final String KEY_TEMPLATE

消息模板对应的属性,必选参数。

另请参阅:Constant-values。

[h2]KEY_ICON_INDEX

Field

public static final String KEY_ICON_INDEX

通用消息模板的图片索引属性,消息模板为COMMON_LAYOUT_TEMPLATE时有效,为可选字段。

另请参阅:Constant-values。

[h2]KEY_TITLE

Field

public static final String KEY_TITLE

通用消息模板的标题属性,消息模板为COMMON_LAYOUT_TEMPLATE时有效,为可选字段。

另请参阅:Constant-values。

[h2]KEY_SUBTITLE

Field

public static final String KEY_SUBTITLE

通用消息模板的子标题属性,消息模板为COMMON_LAYOUT_TEMPLATE时有效,为可选字段。

另请参阅:Constant-values。

[h2]KEY_CONTENT

Field

public static final String KEY_CONTENT

通用消息模板的内容属性,消息模板为COMMON_LAYOUT_TEMPLATE时有效,为可选字段。

另请参阅:Constant-values。

[h2]KEY_DATE

Field

public static final String KEY_DATE

通用消息模板显示的时间属性,消息模板为COMMON_LAYOUT_TEMPLATE时有效,如果需要设备显示具体消息生成的时间,为可选字段。

另请参阅:Constant-values。

[h2]KEY_GUIDE_DISTANCE

Field

public static final String KEY_GUIDE_DISTANCE

导航消息的导航距离属性,消息模板为GUIDE_LAYOUT_TEMPLATE时有效,为可选字段。

另请参阅:Constant-values。

[h2]KEY_DISTANCE_UNIT

Field

public static final String KEY_DISTANCE_UNIT

导航消息的导航距离单位属性,消息模板为GUIDE_LAYOUT_TEMPLATE时有效,为可选字段。

另请参阅:Constant-values。

[h2]KEY_DIRECTION_INDEX

Field

public static final String KEY_DIRECTION_INDEX

导航消息的导航图标索引属性。消息模板为GUIDE_LAYOUT_TEMPLATE时有效,为可选字段。EMUI10.1版本存在预置的图片,对应的索引取值如下:

0x01 左转

0x02 右转

0x03 左前方

0x04 右前方

0x05 左后方

0x06 右后方

0x07 左转调头

0x08 右转调头

0x09 到达。

另请参阅:Constant-values。

[h2]KEY_GUIDE_TEXT

Field

public static final String KEY_GUIDE_TEXT

导航消息的导航内容属性,消息模板为GUIDE_LAYOUT_TEMPLATE时有效,为可选字段。

另请参阅:Constant-values。

[h2]KEY_VIBRATE

Field

public static final String KEY_VIBRATE

消息提醒的震动方式,具体参考DvNotificationService章节,为可选字段。

另请参阅:Constant-values。

[h2]COMMON_LAYOUT_TEMPLATE

Field

public static final int COMMON_LAYOUT_TEMPLATE

通用消息模板的定义。当前暂不支持这种模板的显示,预留模板。

另请参阅:Constant-values。

[h2]GUIDE_LAYOUT_TEMPLATE

Field

public static final int GUIDE_LAYOUT_TEMPLATE

导航消息模板的定义。

另请参阅:Constant-values。

Public Method Summary

Qualifier and Type

Method Name and Description

String

getNotificationProperty (int messsageTemplate)

获取消息通知的消息属性值。

void

setNotificationProperty(int messsageTemplate, MapnotificationProperty)

设置消息通知的消息属性。

Public Methods

[h2]getNotificationProperty

Method

public String getNotificationProperty (int messsageTemplate)

获取消息通知的消息属性值。

Parameters

Name

Description

messsageTemplate

消息模板,目前取值仅支持模板GUIDE_LAYOUT_TEMPLATE。

Return

Type

Description

String

消息通知的消息属性值。

[h2]setNotificationProperty

Method

public void setNotificationProperty(int messsageTemplate, MapnotificationProperty)

设置消息通知的消息属性。

Parameters

Name

Description

messsageTemplate

消息模板,目前取值仅支持模板GUIDE_LAYOUT_TEMPLATE。

notificationProperty

消息属性的MAP集合,其中key为消息的属性,value是属性对应的取值。