卡片编辑功能
卡片提供方提供一个卡片的编辑页面,允许从卡片跳转至编辑页面。
卡片背景模糊
卡片可以在config.json中声明是否支持背景模糊。声明方式如下:
config.json的metaData中,在customizeData中增加一个name为needBlurBackgroundForLauncher的字符串类型的属性, value为“true”表示支持, 否则为不支持。
“forms”: [
{
“name”: “Form_JS_DEMO”,
“description”: “it is js form”,
“type”: “JS”,
“jsComponentName”: “card”,
“colorMode”: “auto”,
“isDefault”: true,
“updateEnabled”: true,
“scheduledUpdateTime”: “10:30”,
“defaultDimension”: “2*2”,
“supportDimensions”: [
“2*2”,
“2*4”
],
“metaData”: {
“customizeData”: [
{
“name”: “needBlurBackgroundForLauncher“,
“value”: “true”
}
]
}
}
]
卡片开发者可以从onCreateForm的回调中,获取是否支持背景模糊:
protected ProviderFormInfo onCreateForm(Intent intent) {
……
// 1. 获取自定义数据
IntentParams intentParams = intent.getParam(AbilitySlice.PARAM_FORM_CUSTOMIZE_KEY);
// 2. 从intentParams中获取是否支持背景模糊
boolean isSupport = (boolean) intentParams.getParam(“fa_card_background_blur_support”);
……
}
- 当前仅JS卡片支持背景模糊。
- 卡片背景模糊需要硬件支持,目前支持搭载麒麟9000或高通骁龙865及以上型号CPU的机型。使用其他机型可能无法预览到背景模糊效果。