Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
HarmonyOS
This module provides material effect capabilities. You can configure parameters such as the material type and level to achieve diversified material effects.
Since: 6.1.0(23)
- import { hdsMaterial } from '@kit.UIDesignKit';
getSystemMaterialTypes(): Array<MaterialType>
Obtains all material types supported by the device.
Widget capability: This API can be used in ArkTS widgets since API version 6.1.0(23).
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.UIDesign.HDSComponent.Core
Since: 6.1.0(23)
Returns
| Type | Description |
|---|---|
| Array<MaterialType> | Material types supported by the device. |
Example
- import { hdsMaterial } from '@kit.UIDesignKit';
- import { BusinessError } from '@kit.BasicServicesKit';
-
- try {
- let materialTypes: Array<hdsMaterial.MaterialType> = hdsMaterial.getSystemMaterialTypes();
- } catch (err) {
- let message = (err as BusinessError).message;
- let code = (err as BusinessError).code;
- console.error(`getSystemMaterialTypes failed, code: ${code}, message: ${message}`);
- }
Enumerates material types.
Widget capability: This API can be used in ArkTS widgets since API version 6.1.0(23).
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.UIDesign.HDSComponent.Core
Since: 6.1.0(23)
| Name | Value | Description |
|---|---|---|
| NONE | 0 | No material effect. |
| ADAPTIVE | 100 | Adaptive system material. The immersive material is used by default. |
| IMMERSIVE | 101 | Immersive material (new material). |
Enumerates material levels. The effect of each level is carried on the component that supports material attribute configuration. The exquisite material consumes more performance, while the smooth material consumes less performance.
Widget capability: This API can be used in ArkTS widgets since API version 6.1.0(23).
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.UIDesign.HDSComponent.Core
Since: 6.1.0(23)
| Name | Value | Description |
|---|---|---|
| EXQUISITE | 0 | Exquisite. |
| GENTLE | 1 | Gentle. |
| SMOOTH | 2 | Smooth. |
| ADAPTIVE | 10 | The material effect policy is determined by the system. The system adapts the material level based on the device performance. |
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.