Question:
The app icon for the service center is not in the form of small eyelashes, but rather the same as the desktop app icons. How can I set a separate icon for it to make its icon in the form of small eyelashes in the service center?
Here is target service center app icon example with eyelashes:
Solution:
By default, the service card project uses MainAbility for service cards, which inherits the main application icon. To set a separate icon in the small eyelash style, you can add a dedicated Ability for service cards and define the corresponding icon in the desired format.
Steps to implement the solution:
Define a dedicated Ability for the service card:
Add a new ability (in this example it is namedWidgetAbility) and assign the appropriate small eyelash-style icon to it.Configure the module:
Modify your module to include both the main ability and the new ability with a separate icon.Example Configuration:
Here's a sample configuration that defines both abilities:
"module": {
"mainAbility": "com.example.cardtest.WidgetAbility",
"deviceType": [
"wearable"
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"name": "com.example.cardtest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"name": "com.example.cardtest.WidgetAbility",
"icon": "$media:widgetIcon",
"description": "$string:widget_ability_description",
"formsEnabled": true,
"label": "$string:widget_ability_description",
"type": "page",
"forms": [
{
"jsComponentName": "widget",
"isDefault": true,
"scheduledUpdateTime": "10:30",
"defaultDimension": "2*2",
"name": "widget",
"description": "This is a service widget.",
"colorMode": "auto",
"type": "JS",
"supportDimensions": [
"2*2"
],
"updateEnabled": true,
"updateDuration": 1
}
],
"launchType": "standard"
}
], //... continues

Top comments (0)