• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.app.ability.ConfigurationConstant (Constants Related to Environment Variables)
2
3The ConfigurationConstant module provides preset enumerated values related to [Configuration](js-apis-app-ability-configuration.md) operations.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8
9## Modules to Import
10
11```ts
12import { ConfigurationConstant } from '@kit.AbilityKit';
13```
14
15## ColorMode
16
17Enumerates the dark/light color modes, which are used in the [Configuration.colorMode](../apis-ability-kit/js-apis-app-ability-configuration.md#configuration) field. You can use these predefined enumerated values to set or obtain the dark/light color mode of the system or application.
18
19**Atomic service API**: This API can be used in atomic services since API version 11.
20
21**System capability**: SystemCapability.Ability.AbilityBase
22
23| Name| Value| Description|
24| -------- | -------- | -------- |
25| COLOR_MODE_NOT_SET | -1 | Unspecified color mode.|
26| COLOR_MODE_DARK | 0 | Dark mode.|
27| COLOR_MODE_LIGHT | 1 | Light mode.|
28
29
30## Direction
31
32Enumerates the screen directions, which are used in the [Configuration.direction](../apis-ability-kit/js-apis-app-ability-configuration.md#configuration) field. You can use these predefined enumerated values to set or obtain the screen direction of the system or application.
33
34**Atomic service API**: This API can be used in atomic services since API version 11.
35
36**System capability**: SystemCapability.Ability.AbilityBase
37
38| Name| Value| Description|
39| -------- | -------- | -------- |
40| DIRECTION_NOT_SET | -1 | Unspecified direction.|
41| DIRECTION_VERTICAL | 0 | Vertical direction.|
42| DIRECTION_HORIZONTAL | 1 | Horizontal direction.|
43
44
45## ScreenDensity
46
47Enumerates the pixel densities of the screen, which are used in the [Configuration.screenDensity](../apis-ability-kit/js-apis-app-ability-configuration.md#configuration) field. You can use these predefined enumerated values to set or obtain the pixel density of the screen.<br>The font size is positively correlated with the screen pixel density. By monitoring changes in the screen pixel density, you can detect adjustments in the font size. Typically, for the same physical size, the higher the screen pixel density, the larger the font display effect.
48
49**Atomic service API**: This API can be used in atomic services since API version 11.
50
51**System capability**: SystemCapability.Ability.AbilityBase
52
53| Name| Value| Description|
54| -------- | -------- | -------- |
55| SCREEN_DENSITY_NOT_SET | 0 | The screen pixel density is not set.|
56| SCREEN_DENSITY_SDPI | 120 | The pixel density of the screen is 'SDPI'.|
57| SCREEN_DENSITY_MDPI | 160 | The pixel density of the screen is 'MDPI'.|
58| SCREEN_DENSITY_LDPI | 240 | The pixel density of the screen is 'LDPI'.|
59| SCREEN_DENSITY_XLDPI | 320 | The pixel density of the screen is 'XLDPI'.|
60| SCREEN_DENSITY_XXLDPI | 480 | The pixel density of the screen is 'XXLDPI'.|
61| SCREEN_DENSITY_XXXLDPI | 640 | The pixel density of the screen is 'XXXLDPI'.|
62